Skip to content

Commit b4f5f0e

Browse files
committed
fix(ci): scope required suites by firmware product
1 parent ca06d46 commit b4f5f0e

1 file changed

Lines changed: 17 additions & 3 deletions

File tree

scripts/generate-test-report.py

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3243,6 +3243,15 @@ def screenshot_filter(fw_version):
32433243
'test_msg_solana_lut_attestation': '7.15.0',
32443244
}
32453245

3246+
# A module can be mandatory for the regular product while being intentionally
3247+
# absent from KK_BITCOIN_ONLY. Keep this narrower than MUST_RUN_MODULES: Taproot
3248+
# remains mandatory in both products, and the expected build variant comes from
3249+
# CI rather than the firmware identity being tested.
3250+
FULL_FEATURE_ONLY_MUST_RUN_MODULES = {
3251+
'test_msg_solana_lut_attestation',
3252+
}
3253+
3254+
32463255
def screenshot_audit(fw_version, screenshot_root, junit_path=None):
32473256
"""Which SECTIONS tests DECLARED screens but captured none?
32483257
@@ -3283,7 +3292,7 @@ def screenshot_audit(fw_version, screenshot_root, junit_path=None):
32833292
return (len(missing) == 0, missing)
32843293

32853294

3286-
def validate_junit(fw_version, results):
3295+
def validate_junit(fw_version, results, build_variant='full'):
32873296
"""Check SECTIONS tests against JUnit results. Returns (passed, failed_list).
32883297
32893298
A test is considered failed if it appears in SECTIONS for this firmware version
@@ -3299,7 +3308,10 @@ def validate_junit(fw_version, results):
32993308
status = _lookup(results, mod, meth)
33003309
if status in ('fail', 'error'):
33013310
failures.append((tid, mod, meth, status))
3302-
elif status == 'skip' and ver_ge(fw_version, MUST_RUN_MODULES.get(mod, '99.0.0')):
3311+
elif (status == 'skip'
3312+
and ver_ge(fw_version, MUST_RUN_MODULES.get(mod, '99.0.0'))
3313+
and not (build_variant == 'bitcoin-only'
3314+
and mod in FULL_FEATURE_ONLY_MUST_RUN_MODULES)):
33033315
failures.append((tid, mod, meth, 'skipped-but-required'))
33043316
elif not status:
33053317
failures.append((tid, mod, meth, 'missing'))
@@ -3320,6 +3332,8 @@ def main():
33203332
help='Print pytest -k expression for tests needing screenshots, then exit')
33213333
p.add_argument('--validate-junit', action='store_true',
33223334
help='Validate JUnit results against SECTIONS, exit non-zero on failures')
3335+
p.add_argument('--build-variant', choices=('full', 'bitcoin-only'), default='full',
3336+
help='Expected CI product; controls only explicit build-flag waivers')
33233337
args = p.parse_args()
33243338

33253339
fw = args.fw_version
@@ -3347,7 +3361,7 @@ def main():
33473361
print('ERROR: --validate-junit requires --junit=<path>', file=sys.stderr)
33483362
sys.exit(2)
33493363
results = parse_junit(args.junit)
3350-
ok, failures = validate_junit(fw, results)
3364+
ok, failures = validate_junit(fw, results, args.build_variant)
33513365
if ok:
33523366
print(f'SECTIONS validation passed: all tests for fw {fw} are pass or skip')
33533367
sys.exit(0)

0 commit comments

Comments
 (0)