@@ -79,6 +79,12 @@ def select(specpath, version, sections, tests):
7979
8080
8181def _update_scorecard (scorecard , report , testcase_lookup ):
82+ subject = report ['subject' ]
83+ scopeuuid = report ['scope' ]
84+ if subject != scorecard .setdefault ('subject' , subject ):
85+ raise RuntimeError ('subjects do not match' )
86+ if scopeuuid != scorecard .setdefault ('scope' , scopeuuid ):
87+ raise RuntimeError ('scopes do not match' )
8288 scores = scorecard .setdefault ('tests' , {})
8389 checked_at = report ['checked_at' ]
8490 checked_at_str = str (checked_at )[:19 ]
@@ -150,12 +156,6 @@ def score(specpath, subject, score_yaml, report_yaml):
150156 report_yaml = f'report-{ ts } -{ subject } .yaml'
151157 _atomic_write (report_yaml , _dump (report ))
152158 if score_yaml :
153- scorecard .setdefault ('subject' , subject )
154- scorecard .setdefault ('scope' , scopeuuid )
155- if subject != scorecard ['subject' ]:
156- raise RuntimeError ('subjects do not match' )
157- if scopeuuid != scorecard ['scope' ]:
158- raise RuntimeError ('scopes do not match' )
159159 _prune_scorecard (scorecard )
160160 _update_scorecard (scorecard , report , spec ['testcases' ])
161161 _atomic_write (score_yaml , _dump (scorecard ))
0 commit comments