[LNT] r308565 - LNT API run roundtrips

Chris Matthews via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 19 17:28:26 PDT 2017


Ah, thanks.  At least I checked 999 was not there!

> On Jul 19, 2017, at 5:22 PM, Matthias Braun <mbraun at apple.com> wrote:
> 
>> 
>> On Jul 19, 2017, at 5:09 PM, Chris Matthews via llvm-commits <llvm-commits at lists.llvm.org <mailto:llvm-commits at lists.llvm.org>> wrote:
>> 
>> Author: cmatthews
>> Date: Wed Jul 19 17:09:11 2017
>> New Revision: 308565
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=308565&view=rev
>> Log:
>> LNT API run roundtrips
>> 
>> Allow LNT runs to be downloaded from the API in a format that they can
>> be inserted back into the same or other LNT instances.  This can be used
>> to move runs between LNT instances, or modify them.
>> 
>> I make some changes to the REST API to make the format closer to what we
>> expect, then ignore some fields (like ID) when importing.
>> 
>> 
>> Modified: lnt/trunk/tests/server/ui/test_api_modify.py
>> URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/tests/server/ui/test_api_modify.py?rev=308565&r1=308564&r2=308565&view=diff <http://llvm.org/viewvc/llvm-project/lnt/trunk/tests/server/ui/test_api_modify.py?rev=308565&r1=308564&r2=308565&view=diff>
>> ==============================================================================
>> --- lnt/trunk/tests/server/ui/test_api_modify.py (original)
>> +++ lnt/trunk/tests/server/ui/test_api_modify.py Wed Jul 19 17:09:11 2017
>> @@ -62,7 +62,7 @@ class JSONAPIDeleteTester(unittest.TestC
>>        client = self.client
>> 
>>        j = check_json(client, 'api/db_default/v4/nts/runs/1')
>> -        sample_ids = [s['id'] for s in j['samples']]
>> +        sample_ids = [s['id'] for s in j['tests']]
>>        self.assertNotEqual(len(sample_ids), 0)
>>        for sid in sample_ids:
>>            resp = client.get('api/db_default/v4/nts/samples/{}'.format(sid))
>> @@ -97,7 +97,9 @@ class JSONAPIDeleteTester(unittest.TestC
>>        for run_id in run_ids:
>>            resp = check_json(client,
>>                              'api/db_default/v4/nts/runs/{}'.format(run_id))
>> -            sample_ids.append([s['id'] for s in resp['samples']])
>> +            import pprint
>> +            pprint.pprint(resp['tests'])
>> +            sample_ids.append([s['id'] for s in resp['tests']])
>>        self.assertNotEqual(len(sample_ids), 0)
>> 
>>        resp = client.delete('api/db_default/v4/nts/machines/2')
>> @@ -130,7 +132,7 @@ Deleted machine 2
>>        """Check POST to /runs."""
>>        client = self.client
>> 
>> -        resp = client.get('api/db_default/v4/nts/runs/5')
>> +        resp = client.get('api/db_default/v4/nts/runs/999')
>>        self.assertEqual(resp.status_code, 404)
> This was intended to check that the particular run we are going to post didn't exist before posting... according to the later asserts, we should end up with runs/5 not runs/999.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170719/c596e51f/attachment.html>


More information about the llvm-commits mailing list