-
-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: create gists from artefacts (logs) of failed CI tests (#650)
Very often we get "useful" failures on CI that are hard to reproduce locally. Given the headless nature of CI it's impossible to then extract the log files from those failures. This is very frustrating. This commit causes test failures on Travis to create a gist with a base64 encoded .tar.gz of the log files from all tests that have, to that point, run. For convenience, a command is echo-ed that can be copy-pasted into your shell that will change to a new temp dir and untar the log files ready for inspection.
- Loading branch information
Showing
9 changed files
with
143 additions
and
21 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,23 @@ | ||
#!/usr/bin/env bash | ||
|
||
source "${BASH_SOURCE%/*}/common.bash" | ||
|
||
if [ "${CI:-}" != "true" ] | ||
then | ||
exit | ||
fi | ||
|
||
# The ARTEFACTS variable set by .travis.yml cannot expand | ||
# variables so we do that here | ||
ARTEFACTS=$(echo $ARTEFACTS) | ||
|
||
cd $ARTEFACTS | ||
|
||
# Remove all the big directories first | ||
sudo find . -type d \( -name .vim -o -name gopath \) -prune -exec rm -rf '{}' \; | ||
|
||
# Now prune the files we don't want | ||
sudo find . -type f -not -path "*/_tmp/govim_log" -and -not -path "*/_tmp/gopls_log" -and -not -path "*/_tmp/vim_channel_log" -exec rm '{}' \; | ||
|
||
url=$(echo "{ \"public\": false, \"files\": { \"logs.base64\": { \"content\": \"$(find . -type f -print0 | tar -zc --null -T - | base64 | sed ':a;N;$!ba;s/\n/\\n/g')\" } } }" | curl -s -H "Content-Type: application/json" -u $GH_USER:$GH_TOKEN --request POST --data-binary "@-" https://api.github.com/gists | jq -r '.files."logs.base64".raw_url') | ||
echo 'cd $(mktemp -d) && curl -s '$url' | base64 -d | tar -zx' |
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
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