1
0
Fork 0

Consolidate regression artifacts into per-tier flat structure

This commit is contained in:
Brendan Szymanski 2026-07-21 22:03:38 -04:00
parent 8bfeea2ed2
commit 745a4c3401
66 changed files with 55721 additions and 40 deletions

View file

@ -1,10 +1,10 @@
#!/usr/bin/env bash
# compile-gate.sh — the generator's primary acceptance gate.
#
# Generates the tier's monorepo from configs/tierN.toml, then requires the
# Generates the tier's monorepo from regression/tierN/config.toml, then requires the
# generated package to `swift build` with ZERO errors. Pass/fail only: error
# counts are not a metric. Also diffs each module's skip report against the
# committed baseline in docs/skip-baseline/tierN/ (if present) so that new
# committed baseline in regression/tierN/ (JSON files only) so that new
# skips in supported categories fail loudly.
#
# Usage:
@ -45,7 +45,7 @@ FAILED=0
run_tier() {
local tier="$1"
local config="$ROOT/configs/tier${tier}.toml"
local config="$ROOT/regression/tier${tier}/config.toml"
local out="$GATE_ROOT/tier-${tier}"
if [[ ! -f "$config" ]]; then
@ -79,16 +79,21 @@ run_tier() {
return 1
fi
local baseline="$ROOT/docs/skip-baseline/tier${tier}"
local baseline="$ROOT/regression/tier${tier}"
if [[ -d "$baseline" ]]; then
echo "==> Tier $tier: diffing skip reports against $baseline"
if ! diff -ru "$baseline" "$out/skip-reports" >"$out/skip-diff.log" 2>&1; then
local tmp_baseline
tmp_baseline="$(mktemp -d)"
cp "$baseline"/*.json "$tmp_baseline/" 2>/dev/null || true
if ! diff -ru "$tmp_baseline" "$out/skip-reports" >"$out/skip-diff.log" 2>&1; then
rm -rf "$tmp_baseline"
echo "!! tier $tier: SKIP REPORT CHANGED (see $out/skip-diff.log)" >&2
head -n 40 "$out/skip-diff.log" >&2
echo " If the change is intentional (coverage grew), refresh the baseline:" >&2
echo " cp -r $out/skip-reports/. $baseline/" >&2
echo " cp -r $out/skip-reports/*.json $baseline/" >&2
return 1
fi
rm -rf "$tmp_baseline"
else
echo "==> Tier $tier: no skip baseline at $baseline (skipping diff)"
fi

View file

@ -3,9 +3,8 @@
#
# The compile gate proves the generated Swift type-checks. This goes further:
# it generates a tier's bindings, links them against the REAL C libraries via
# pkg-config, and runs hand-written swift-testing cases (smoke/*.swift, plus
# smoke/tier<N>/*.swift for tier N ≥ 2) that invoke real GLib/GObject/Gio
# functionality through the wrappers and check the results at runtime.
# pkg-config, and runs hand-written swift-testing cases from
# regression/tier<N>/*.swift (plus regression/tier1/SmokeTests.swift for all tiers)
#
# Usage: scripts/smoke-test.sh [tier] [--fresh]
#
@ -29,7 +28,7 @@ for arg in "$@"; do
fi
done
CONFIG="$ROOT/configs/tier${TIER}.toml"
CONFIG="$ROOT/regression/tier${TIER}/config.toml"
OUT="${TMPDIR:-/tmp}/gobject-generator-smoke/tier-${TIER}"
if [[ ! -f "$CONFIG" ]]; then
@ -49,14 +48,9 @@ echo "==> Generating tier $TIER bindings (with SmokeTests target) into $OUT"
echo "==> Installing smoke tests"
mkdir -p "$OUT/Tests/SmokeTests"
# Refresh so edits to smoke/*.swift always take effect.
rm -f "$OUT/Tests/SmokeTests/"*.swift
cp "$ROOT/smoke/"*.swift "$OUT/Tests/SmokeTests/"
# Tier-specific smoke cases (e.g. smoke/tier2/*.swift exercises Gio) are only
# installed — and only need to compile — for tiers that generate their deps.
if [[ -d "$ROOT/smoke/tier${TIER}" ]]; then
cp "$ROOT/smoke/tier${TIER}/"*.swift "$OUT/Tests/SmokeTests/"
fi
# Install foundational tier1 smoke tests (GLib/GObject) plus tier-specific tests.
cp "$ROOT/regression/tier1/SmokeTests.swift" "$OUT/Tests/SmokeTests/"
cp "$ROOT/regression/tier${TIER}/"*.swift "$OUT/Tests/SmokeTests/"
echo "==> Running smoke tests against the real C libraries"
swift test --package-path "$OUT"