-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Save kind logs after each failed test
Some e2e test restart the multi-networkpolicy daemon, making the logs gathering at the end of the CI job useless. Create a script to loop over all the test files and collect logs every time a test fails. Signed-off-by: Andrea Panattoni <[email protected]>
- Loading branch information
Showing
2 changed files
with
20 additions
and
7 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,18 @@ | ||
#!/bin/bash | ||
|
||
E2E="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" | ||
|
||
pushd ${E2E} | ||
|
||
suite_failed=0 | ||
|
||
for f in ./tests/*.bats; do | ||
bats $f | ||
retval=$? | ||
if [ $retval -ne 0 ]; then | ||
suite_failed=1 | ||
./bin/kind export logs ./artifacts/`basename $f`.test/kind-logs | ||
fi | ||
done | ||
|
||
exit $suite_failed |