-
Notifications
You must be signed in to change notification settings - Fork 893
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add CI check for unecessary template tests
When the regression tests output differs between PG versions we create a template test file (*.sql.in) and add several different output files for each supported version. Over time we support new PG version and deprecate older ones, for example nowadays we're working on PG16 support and removed PG12 so we need to check if we still need template files.
- Loading branch information
1 parent
5752c33
commit f12ed00
Showing
2 changed files
with
22 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
|
||
ERROR=0 | ||
|
||
for FILE in $(git ls-files test/sql/*.sql.in tsl/test/sql/*.sql.in) | ||
do | ||
DIRNAME=$(dirname "${FILE}" | sed 's/sql/expected/g') | ||
TESTNAME=$(basename "${FILE}" .sql.in) | ||
|
||
if diff --from-file ${DIRNAME}/${TESTNAME}-*.out > /dev/null 2>&1; then | ||
echo "ERROR: all template output test files are equal: \"${DIRNAME}/${TESTNAME}-*.out\"" | ||
echo "HINT: Please turn template test file \"${FILE}\" into a regular test file" | ||
ERROR=1 | ||
fi | ||
done | ||
|
||
exit ${ERROR} |