interop/2015.04/required.py
Chris Hoge 3d67722b75 Updated flagged test list
Updated the supplemental file of flagged tests to match current
flagged tests in 2015.04.json. Updated required.py file to
generate the required and flagged list automatically from the
most recent 2015.04.json file

Change-Id: I4a4b1f1537a05fa81ecf0df6063f3df754ec81a1
2015-05-10 08:59:36 -07:00

58 lines
1.5 KiB
Python

import json
import urllib
capabilities_file = open('../2015.04.json','r')
defcore = json.loads(capabilities_file.read())
capabilities = defcore['capabilities']
required_tests = []
flagged_tests = []
required_tests_file = open('2015.04.required.txt','w')
flagged_tests_file = open('2015.04.flagged.txt', 'w')
for capability_name in capabilities:
capability = capabilities[capability_name]
if capability['status'] == 'required':
tests = capability['tests']
for test in tests:
required_tests.append(test)
flagged = capability['flagged']
for test in flagged:
flagged_tests.append(test)
required_tests.sort()
alltests = []
for line in open('7c8fcc67-api-test-list.txt'):
alltests.append(line.rstrip())
alltests.sort()
# n^2, terrible
for rtest in required_tests:
testmatch = rtest + '['
found = False
for test in alltests:
if test.startswith(testmatch):
required_tests_file.write(test + '\n')
print test
found = True
if not found:
print "!!! Did not find test matching " % (rtest)
print "\nflagged\n======="
for flagged in flagged_tests:
testmatch = flagged + '['
found = False
for test in alltests:
if test.startswith(testmatch):
flagged_tests_file.write(test + '\n')
print test
found = True
if not found:
print "!!! Did not find flagged test matching " % (flagged)
required_tests_file.close()
flagged_tests_file.close()