From a65aa2465a8ef14d1802999bca499c37bfaada4f Mon Sep 17 00:00:00 2001 From: Anay Dhawan Date: Mon, 17 Aug 2026 09:27:54 +0530 Subject: [PATCH 1/2] test: run apply.sh once per detected stack against a throwaway fixture demo/scaffold.sh's fixture is node-only, so no fixture had ever run apply.sh's fill()/command tables against any other stack -- exactly how a real, shipped-since-v1.0.0 crash on every Go repo went unnoticed until it was reported and fixed separately. Adds a smoke_stack loop covering all 11 detected stacks plus generic: writes a bare marker file, runs apply.sh against it with a throwaway config, and asserts a clean exit. Fixes #42. --- tests/run.sh | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/tests/run.sh b/tests/run.sh index fc610d7..73e9149 100644 --- a/tests/run.sh +++ b/tests/run.sh @@ -166,6 +166,51 @@ for stack in node python rust go php dotnet ruby java swift kotlin scala generic done done +echo "" +echo "── apply.sh per-stack smoke test ──" + +# Regression guard for the class of bug a real, shipped-since-v1.0.0 crash belonged to (a +# crash on every Go repo, since fixed): demo/scaffold.sh's fixture is node-only, so no +# fixture had ever run apply.sh's fill()/command tables against any other stack. This +# drives apply.sh once per detected stack against a bare marker file; a stack-specific +# crash now shows up here instead of in a user's terminal. +SMOKE_CONFIG="$TMP/smoke.oss-launch.config" +cat > "$SMOKE_CONFIG" <<'EOF' +AUTHOR="Smoke Test" +SECURITY_EMAIL="smoke@example.com" +TAGLINE="A smoke-tested project" +OWNER="smoke" +EOF + +smoke_stack() { # smoke_stack [marker-content] + local stack="$1" marker="$2" content="${3:-}" dir="$TMP/smoke-$stack" err + mkdir -p "$dir" + if [ -n "$marker" ]; then + mkdir -p "$dir/$(dirname "$marker")" + printf '%s' "$content" > "$dir/$marker" + fi + printf '# smoke\n' > "$dir/README.md" + if err="$(bash "$ROOT/scripts/apply.sh" "$dir" --config "$SMOKE_CONFIG" 2>&1 >/dev/null)"; then + echo " PASS $stack: apply.sh ran clean" + else + echo " FAIL $stack: apply.sh exited non-zero -- $(tail -1 <<<"$err")" + FAILURES=$((FAILURES + 1)) + fi +} + +smoke_stack node package.json '{"name":"smoke","version":"0.1.0"}' +smoke_stack python pyproject.toml $'[project]\nname = "smoke"\nversion = "0.1.0"' +smoke_stack rust Cargo.toml $'[package]\nname = "smoke"\nversion = "0.1.0"' +smoke_stack go go.mod 'module smoke' +smoke_stack php composer.json '{"name":"smoke/smoke"}' +smoke_stack dotnet smoke.csproj '' +smoke_stack ruby Gemfile 'source "https://rubygems.org"' +smoke_stack java pom.xml '' +smoke_stack swift Package.swift '// swift-tools-version:5.9' +smoke_stack kotlin build.gradle.kts 'plugins { kotlin("jvm") version "1.9.0" }' +smoke_stack scala build.sbt 'name := "smoke"' +smoke_stack generic "" "" + echo "" if [ "$FAILURES" -eq 0 ]; then echo "All assertions passed." From dea5c6720e1d665bdfd9abf38715f7cf481f39dc Mon Sep 17 00:00:00 2001 From: Anay Dhawan Date: Mon, 17 Aug 2026 09:30:48 +0530 Subject: [PATCH 2/2] fix: split local declaration so dir doesn't read stack before it's set (SC2318) --- tests/run.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/run.sh b/tests/run.sh index 73e9149..c77d028 100644 --- a/tests/run.sh +++ b/tests/run.sh @@ -183,7 +183,8 @@ OWNER="smoke" EOF smoke_stack() { # smoke_stack [marker-content] - local stack="$1" marker="$2" content="${3:-}" dir="$TMP/smoke-$stack" err + local stack="$1" marker="$2" content="${3:-}" dir err + dir="$TMP/smoke-$stack" mkdir -p "$dir" if [ -n "$marker" ]; then mkdir -p "$dir/$(dirname "$marker")"