diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 3f724635216..019a1593194 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -31,6 +31,13 @@ jobs: distribution: 'temurin' java-version: 8 + - name: Docker Images Cleanup + run: | + df -h + docker image ls + docker image rm $(docker image ls -q) -f + df -h + - name: befor install -> docker.sh run: ./tools/travis/docker.sh @@ -53,7 +60,11 @@ jobs: # run: ./tools/travis/runUnitTests.sh && ./tools/travis/checkAndUploadLogs.sh unit db - name: script -> System Tests - run: ./tools/travis/runSystemTests.sh && ./tools/travis/checkAndUploadLogs.sh system + run: | + df -h \ + && ./tools/travis/runSystemTests.sh \ + && df-h \ + && ./tools/travis/checkAndUploadLogs.sh system #- name: script -> Multi-Runtime Tests # run: ./tools/travis/runMultiRuntimeTests.sh && ./tools/travis/checkAndUploadLogs.sh multi-runtime diff --git a/tools/travis/docker.sh b/tools/travis/docker.sh index 21eed7c2b16..bc93d4dc869 100755 --- a/tools/travis/docker.sh +++ b/tools/travis/docker.sh @@ -23,6 +23,10 @@ sudo gpasswd -a travis docker sudo usermod -aG docker travis #sudo -E bash -c 'echo '\''DOCKER_OPTS="-H tcp://0.0.0.0:4243 -H unix:///var/run/docker.sock --storage-driver=overlay --userns-remap=default"'\'' > /etc/default/docker' +# change default data directory for docker to /mnt/docker (in githubactions) +sudo mkdir -p /mnt/docker +sudo -E bash -c 'echo '\''DOCKER_OPTS="-g /mnt/docker"'\'' > /etc/default/docker' + # Docker sudo apt-get clean sudo apt-get update diff --git a/tools/travis/runSystemTests.sh b/tools/travis/runSystemTests.sh index 8325caddbae..fd2bfc43b5b 100755 --- a/tools/travis/runSystemTests.sh +++ b/tools/travis/runSystemTests.sh @@ -18,6 +18,7 @@ # set -e +set -x SCRIPTDIR=$(cd $(dirname "$0") && pwd) ROOTDIR="$SCRIPTDIR/../.." diff --git a/tools/travis/runTests.sh b/tools/travis/runTests.sh index e2a7f7a4b32..3627df1900c 100755 --- a/tools/travis/runTests.sh +++ b/tools/travis/runTests.sh @@ -17,6 +17,7 @@ # set -e +set -x # Build script for Travis-CI. @@ -26,7 +27,21 @@ ROOTDIR="$SCRIPTDIR/../.." cd $ROOTDIR cat whisk.properties -TERM=dumb ./gradlew :tests:testCoverageLean :tests:reportCoverage :tests:testSwaggerCodegen +( # run this in a subshell to get the result code but not terminating the process to print the logs. + set +e + TERM=dumb ./gradlew :tests:testCoverageLean :tests:reportCoverage :tests:testSwaggerCodegen + + if [[ "$?" != "0" ]]; then + # debugging notes + # || true; set -x; docker ps -a; for i in $(docker ps -a --format="{{.Names}}"); do docker logs $i || true; done; ls -alhR /tmp/wsklogs; + # || true; set -x; docker ps -a; ls -R /tmp/wsklogs ;cat /tmp/wsklogs/invoker0/invoker0_logs.log; cat /tmp/wsklogs/controller0/controller0_logs.log; + + set -x # show the following commands in the output + cat /tmp/wsklogs/invoker0/invoker0_logs.log + cat /tmp/wsklogs/controller0/controller0_logs.log + exit 1 + fi +) bash <(curl -s https://codecov.io/bash) echo "Time taken for ${0##*/} is $SECONDS secs"