interop/2015.04/required.py
Chris Hoge 1c47d63326 Fixed flagged test list and updated parsing script
Several tests were incorrectly flagged in the 2015.04.flagged.txt
list. The list was corrected, and the required.py script updated
to automate the discovery of the flagged tests.

Change-Id: I198bdb6fbdf2697c28a2afb779e1d97ebc19ca3e
2015-05-01 12:32:30 -07:00

52 lines
1.3 KiB
Python

import json
import urllib
url = 'https://raw.githubusercontent.com/openstack/defcore/master/2015.04.json'
response = urllib.urlopen(url)
defcore = json.loads(response.read())
capabilities = defcore['capabilities']
required_tests = []
flagged_tests = []
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):
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):
print test
found = True
if not found:
print "!!! Did not find flagged test matching " % (flagged)