Skip to content

Commit bcb0ccf

Browse files
committed
CI: move T coverage check after staged promotion; accept _staging as present; dedupe promotion step
1 parent 3039e62 commit bcb0ccf

File tree

1 file changed

+16
-87
lines changed

1 file changed

+16
-87
lines changed

.github/workflows/claude-nl-suite.yml

Lines changed: 16 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -415,19 +415,7 @@ jobs:
415415
timeout_minutes: "30"
416416
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
417417

418-
- name: Assert T coverage (before backfill)
419-
if: always()
420-
shell: bash
421-
run: |
422-
set -euo pipefail
423-
missing=()
424-
for id in T-A T-B T-C T-D T-E T-F T-G T-H T-I T-J; do
425-
[[ -s "reports/${id}_results.xml" ]] || missing+=("$id")
426-
done
427-
if (( ${#missing[@]} )); then
428-
echo "::error::Missing T fragments: ${missing[*]}"
429-
exit 1
430-
fi
418+
# (moved) Assert T coverage after staged fragments are promoted
431419

432420
- name: Retry T pass (Sonnet) if incomplete
433421
if: failure()
@@ -468,85 +456,26 @@ jobs:
468456
exit 1
469457
fi
470458
471-
- name: Finalize staged report fragments (promote to reports/)
472-
if: always()
473-
shell: bash
474-
run: |
475-
python3 - <<'PY'
476-
from pathlib import Path
477-
import xml.etree.ElementTree as ET, re
478-
479-
def id_from_filename(p: Path):
480-
n = p.name
481-
m = re.match(r'NL(\d+)_results\.xml$', n, re.I)
482-
if m:
483-
return f"NL-{int(m.group(1))}"
484-
m = re.match(r'T([A-J])_results\.xml$', n, re.I)
485-
if m:
486-
return f"T-{m.group(1).upper()}"
487-
return None
459+
# (kept) Finalize staged report fragments (promote to reports/)
488460

489-
src_dir = Path('reports/_staging')
490-
dst_dir = Path('reports')
491-
dst_dir.mkdir(parents=True, exist_ok=True)
461+
# (removed duplicate) Finalize staged report fragments
492462

493-
for frag in sorted(src_dir.glob('*_results.xml')):
494-
try:
495-
tree = ET.parse(frag); root = tree.getroot()
496-
except Exception:
497-
continue
498-
if root.tag != 'testcase':
499-
continue
500-
file_id = id_from_filename(frag)
501-
old = root.get('name') or ''
502-
if file_id:
503-
title = re.sub(r'^\s*(NL-\d+|T-[A-Z])\s*[—–:\-]\s*', '', old).strip()
504-
new = f"{file_id} — {title}" if title else file_id
505-
if new != old and new:
506-
root.set('name', new)
507-
out = dst_dir / frag.name
508-
tree.write(out, encoding='utf-8', xml_declaration=False)
509-
PY
510-
511-
- name: Finalize staged report fragments (promote to reports/)
463+
- name: Assert T coverage (after promotion)
512464
if: always()
513465
shell: bash
514466
run: |
515-
python3 - <<'PY'
516-
from pathlib import Path
517-
import xml.etree.ElementTree as ET, re
518-
519-
def id_from_filename(p: Path):
520-
n = p.name
521-
m = re.match(r'NL(\d+)_results\.xml$', n, re.I)
522-
if m:
523-
return f"NL-{int(m.group(1))}"
524-
m = re.match(r'T([A-J])_results\.xml$', n, re.I)
525-
if m:
526-
return f"T-{m.group(1).upper()}"
527-
return None
528-
529-
src_dir = Path('reports/_staging')
530-
dst_dir = Path('reports')
531-
dst_dir.mkdir(parents=True, exist_ok=True)
532-
533-
for frag in sorted(src_dir.glob('*_results.xml')):
534-
try:
535-
tree = ET.parse(frag); root = tree.getroot()
536-
except Exception:
537-
continue
538-
if root.tag != 'testcase':
539-
continue
540-
file_id = id_from_filename(frag)
541-
old = root.get('name') or ''
542-
if file_id:
543-
title = re.sub(r'^\s*(NL-\d+|T-[A-Z])\s*[—–:\-]\s*', '', old).strip()
544-
new = f"{file_id} — {title}" if title else file_id
545-
if new != old and new:
546-
root.set('name', new)
547-
out = dst_dir / frag.name
548-
tree.write(out, encoding='utf-8', xml_declaration=False)
549-
PY
467+
set -euo pipefail
468+
missing=()
469+
for id in T-A T-B T-C T-D T-E T-F T-G T-H T-I T-J; do
470+
if [[ ! -s "reports/${id}_results.xml" ]]; then
471+
# Accept staged fragment as present
472+
[[ -s "reports/_staging/${id}_results.xml" ]] || missing+=("$id")
473+
fi
474+
done
475+
if (( ${#missing[@]} )); then
476+
echo "::error::Missing T fragments: ${missing[*]}"
477+
exit 1
478+
fi
550479
551480
- name: Canonicalize testcase names (NL/T prefixes)
552481
if: always()

0 commit comments

Comments
 (0)