-
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #92 from HumorBaby/fix-refactor-tests
Fix broken CI testing, including from `conf.d`
- Loading branch information
Showing
11 changed files
with
75 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
rules: | ||
from_first: off |
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
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
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,47 @@ | ||
#!/bin/bash | ||
|
||
export INSP_VERSION | ||
|
||
clean_up() { | ||
local ret_val="$?" | ||
|
||
# Clean up any remaining containers (e.g., due to fast-failing test) | ||
local inspircd_containers="$(docker ps -q -a -f "ancestor=inspircd:testing")" | ||
if [[ -n "${inspircd_containers}" ]]; then | ||
docker rm -fv ${inspircd_containers} | ||
fi | ||
|
||
# Exit with ultimate exit code | ||
exit "${ret_val}" | ||
} | ||
trap clean_up EXIT | ||
|
||
# Make sure test-tracking file exists | ||
touch ok_tests.txt | ||
pad=$(printf '.%.0s' {1..100}) | ||
|
||
for test_file in tests/*.sh; do | ||
printf "%.35s " "${test_file} ${pad}" | ||
|
||
# Check if test already passed. | ||
grep -w -q "$(sha1sum "${test_file}")" ok_tests.txt \ | ||
&& { printf "0 ( OK )\n"; continue; } \ | ||
|| true | ||
|
||
# Run test, capturing all output to log variable | ||
test_log=$(sh "${test_file}" 2>&1) | ||
[[ $? -eq 0 ]] \ | ||
&& { | ||
echo "0 ( OK )" | ||
sha1sum "${test_file}" >> ok_tests.txt | ||
} \ | ||
|| { | ||
ret=$? | ||
echo "${ret} (FAIL)" | ||
# Print full output of test script | ||
echo "${test_log}" | ||
exit ${ret} | ||
} | ||
done | ||
# Remove test-tracking cache on successful tests. | ||
rm ok_tests.txt |
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
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
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