Skip to content

Commit

Permalink
style
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Dagnelie <pcd@delphix.com>
  • Loading branch information
pcd1193182 committed Nov 17, 2021
1 parent 601b0b5 commit 134d2c6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 15 deletions.
30 changes: 15 additions & 15 deletions tests/test-runner/bin/test-runner.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ Tags: %s
self.failsafe, failsafe_user, self.tags)

def filter(self, keeplist):
self.tests = [ x for x in self.tests if x in keeplist ]
self.tests = [x for x in self.tests if x in keeplist]

def verify(self):
"""
Expand Down Expand Up @@ -767,16 +767,16 @@ class TestRun(object):
config.add_section(test)
for prop in Test.props:
if prop not in self.props:
config.set(testgroup, prop,
getattr(self.testgroups[testgroup], prop))
config.set(test, prop,
getattr(self.tests[test], prop))

for testgroup in sorted(self.testgroups.keys()):
config.add_section(testgroup)
config.set(testgroup, 'tests', self.testgroups[testgroup].tests)
for prop in TestGroup.props:
if prop not in self.props:
config.set(testgroup, prop,
getattr(self.testgroups[testgroup], prop))
getattr(self.testgroups[testgroup], prop))

try:
with open(options.template, 'w') as f:
Expand Down Expand Up @@ -977,17 +977,17 @@ def filter_tests(testrun, options):

failed = {}
while True:
line = fh.readline()
if not line:
break
m = re.match(r'Test: .*(tests/.*)/(\S+).*\[FAIL\]', line)
if not m:
continue
group, test = m.group(1, 2)
try:
failed[group].append(test)
except KeyError:
failed[group] = [ test ]
line = fh.readline()
if not line:
break
m = re.match(r'Test: .*(tests/.*)/(\S+).*\[FAIL\]', line)
if not m:
continue
group, test = m.group(1, 2)
try:
failed[group].append(test)
except KeyError:
failed[group] = [test]
fh.close()

testrun.filter(failed)
Expand Down
3 changes: 3 additions & 0 deletions tests/test-runner/bin/zts-report.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,7 @@ def process_results(pathname):

return d


class ListMaybesAction(argparse.Action):
def __init__(self,
option_strings,
Expand All @@ -393,11 +394,13 @@ class ListMaybesAction(argparse.Action):
default=default,
nargs=0,
help=help)

def __call__(self, parser, namespace, values, option_string=None):
for test in maybe:
print(test)
sys.exit(0)


if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Analyze ZTS logs')
parser.add_argument('logfile')
Expand Down

0 comments on commit 134d2c6

Please sign in to comment.