Skip to content

Commit 0f7255c

Browse files
marc-hbnashif
authored andcommitted
sanitycheck: order results.csv and discards.csv deterministically
One of the first things needed when comparing builds of tests across different environments/systems is to make sure the same (sub)tests were selected and run in the first place. For that purpose sort the output of --testcase-report and --discard-report as they were in random order. Actually make the entire class TestInstance sortable by adding a standard __lt__() method comparing unique instance names; it could be useful again. Signed-off-by: Marc Herbert <[email protected]>
1 parent f098b44 commit 0f7255c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

scripts/sanitycheck

+5-2
Original file line numberDiff line numberDiff line change
@@ -1804,6 +1804,9 @@ class TestInstance:
18041804
or self.check_dependency()
18051805
self.results = {}
18061806

1807+
def __lt__(self, other):
1808+
return self.name < other.name
1809+
18071810
def check_dependency(self):
18081811
build_only = False
18091812
if self.test.harness == 'console':
@@ -2402,7 +2405,7 @@ class TestSuite:
24022405
fieldnames = ["test", "arch", "platform", "reason"]
24032406
cw = csv.DictWriter(csvfile, fieldnames, lineterminator=os.linesep)
24042407
cw.writeheader()
2405-
for instance, reason in self.discards.items():
2408+
for instance, reason in sorted(self.discards.items()):
24062409
rowdict = {"test": instance.test.name,
24072410
"arch": instance.platform.arch,
24082411
"platform": instance.platform.name,
@@ -2625,7 +2628,7 @@ class TestSuite:
26252628
"rom_size"]
26262629
cw = csv.DictWriter(csvfile, fieldnames, lineterminator=os.linesep)
26272630
cw.writeheader()
2628-
for name, goal in self.goals.items():
2631+
for name, goal in sorted(self.goals.items()):
26292632
i = self.instances[name]
26302633
rowdict = {"test": i.test.name,
26312634
"arch": i.platform.arch,

0 commit comments

Comments
 (0)