Skip to content

Commit ef84d45

Browse files
fix(tests): terminate find -exec and pass {} — the placeholder step was a no-op (#192)
`tests/e2e/template_instantiation_test.sh` ran `find … -exec bash -c '…' _ "\$file"`, which has **two** defects on one line: 1. **No `;` or `+` terminator** — the file does not parse (`SC2067`). 2. **`"\$file"` where `{}` belongs** — `\$file` is assigned *only inside* the `-exec` body, so in the outer scope it is **unset**. `\$1` arrived empty, `file=""`, and every `grep`/`sed` operated on an empty path. ⚠ **The consequence is worse than a lint error.** The placeholder-replacement step **silently did nothing**, then logged *"All placeholder tokens replaced"*. A test whose entire purpose is to prove instantiation worked was passing without replacing a single token — a plausible cause of estate repos shipping with literal `{{project}}` still in their sources. Corrected to `' _ {} \;` so `find` passes each matched path. Found by an estate-wide sweep of 5,111 scripts across 375 repos: this identical stale copy exists in **30 repositories**. `rsr-template-repo`'s own copy is already correct and restructured (371 lines vs the 268 here), so these are stale duplicates that never picked up the upstream fix.
1 parent 7a57b26 commit ef84d45

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎affinescript-ecosystem/rattlescript/tests/e2e/template_instantiation_test.sh‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ replace_placeholder() {
112112
}
113113

114114
# Replace in all text files
115+
export TEST_REPO_NAME TEST_OWNER TEST_FORGE TEST_PROJECT_NAME \
116+
TEST_DESCRIPTION TEST_PRIMARY_LANGUAGE TEST_AUTHOR TEST_AUTHOR_EMAIL
115117
find "$TEST_REPO_PATH" -type f \
116118
\( -name "*.md" -o -name "*.adoc" -o -name "*.a2ml" -o -name "*.zig" -o -name "*.idr" \
117119
-o -name "Justfile" -o -name "Containerfile" -o -name "*.yml" -o -name "*.yaml" \
@@ -137,7 +139,7 @@ find "$TEST_REPO_PATH" -type f \
137139
sed -i "s|$placeholder|$value|g" "$file"
138140
fi
139141
done
140-
' _ "$file"
142+
' _ {} \;
141143

142144
log_pass "All placeholder tokens replaced"
143145

0 commit comments

Comments
 (0)