-
Notifications
You must be signed in to change notification settings - Fork 891
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 (aka *.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
ecd88f8
commit dfce181
Showing
9 changed files
with
25 additions
and
3,595 deletions.
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 | grep '\.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} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
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
File renamed without changes.