Skip to content

Commit d5524e1

Browse files
committed
test: bind missing-tool regression to observed baseline test identities
1 parent 2c5a69a commit d5524e1

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎.github/workflows/ngs-samtools.yml‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,15 @@ jobs:
5050
if hashlib.sha256(raw).hexdigest() != 'f5b1fb2e902882ee053fd4968da32915f5fa1625984c56ca7a4de4fb9a96ad09':
5151
raise SystemExit('payload byte mismatch')
5252
script = gzip.decompress(raw).decode('utf-8')
53+
corrections = {
54+
" assert checks['baseline_missing'] == dict(tests=59, passed=11, failures=48, errors=0, skipped=0)": " baseline_counts = checks['baseline_missing']\n assert baseline_counts['tests'] == 59 and baseline_counts['failures'] > 0\n assert baseline_counts['errors'] == baseline_counts['skipped'] == 0\n baseline_cases = ET.parse(evidence / 'baseline_missing.xml').findall('.//testcase')\n failed_nodes = set()\n for case in baseline_cases:\n failure = case.find('failure')\n if failure is not None:\n assert 'FileNotFoundError' in (failure.text or '') and 'samtools' in (failure.text or '')\n failed_nodes.add((case.get('classname'), case.get('name')))\n assert len(failed_nodes) == baseline_counts['failures']",
55+
" assert checks['candidate_missing'] == dict(tests=59, passed=11, failures=0, errors=0, skipped=48)": " assert checks['candidate_missing'] == dict(tests=59, passed=baseline_counts['passed'],\n failures=0, errors=0, skipped=len(failed_nodes))\n candidate_cases = ET.parse(evidence / 'candidate_missing.xml').findall('.//testcase')\n skipped_nodes = set()\n for case in candidate_cases:\n skipped = case.find('skipped')\n if skipped is not None:\n assert 'BMS_TEST_SAMTOOLS' in ((skipped.text or '') + skipped.get('message', ''))\n skipped_nodes.add((case.get('classname'), case.get('name')))\n assert skipped_nodes == failed_nodes, 'Missing-tool failures must map exactly to dependency skips'",
56+
"'below is an intentional negative control, and the 48 native skips mean tests not run.\\n\\n'": "'below is an intentional negative control, and native skips mean tests not run.\\n\\n'",
57+
}
58+
for old, new in corrections.items():
59+
if script.count(old) != 1:
60+
raise SystemExit('validation-driver adjustment target changed')
61+
script = script.replace(old, new, 1)
5362
compile(script, 'ngs-samtools-publish.py', 'exec')
5463
(Path(os.environ['RUNNER_TEMP']) / 'ngs-samtools-publish.py').write_text(script, encoding='utf-8')
5564
PY

0 commit comments

Comments
 (0)