diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 8b8bc7ef4f5..f2b0f99d25e 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -21,3 +21,10 @@ jobs: - name: Test run: ./scripts/github-actions-test.sh + + - uses: actions/upload-artifact@v4 + with: + name: failed-tests + path: failed-tests/* + if-no-files-found: ignore + compression-level: 0 diff --git a/scripts/github-actions-build.sh b/scripts/github-actions-build.sh index 83948868894..dc2de21634f 100755 --- a/scripts/github-actions-build.sh +++ b/scripts/github-actions-build.sh @@ -7,7 +7,7 @@ uname -a EXTRA_PACKAGES= MACHINE_TYPE=`uname -m` -if [ ${MACHINE_TYPE} == 'x86_64' ]; then +if [ $MACHINE_TYPE == 'x86_64' ]; then EXTRA_PACKAGES=g++-multilib fi diff --git a/scripts/github-actions-test.sh b/scripts/github-actions-test.sh index 18b886aa961..892bb027993 100755 --- a/scripts/github-actions-test.sh +++ b/scripts/github-actions-test.sh @@ -1,7 +1,6 @@ #!/bin/bash set +x # echo commands -set -e # default to exiting on error" # Enable perf events for rr echo 0 | sudo tee /proc/sys/kernel/perf_event_paranoid > /dev/null @@ -12,3 +11,18 @@ echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope > /dev/null let halfproc=`nproc`/2 cd obj ctest -j$halfproc --verbose + +STATUS=$? +if [[ $STATUS != 0 ]]; then + mkdir $GITHUB_WORKSPACE/failed-tests + cd /tmp + rm rr-test-cpu-lock || true + for dir in rr-test-*; do + echo "Packing test /tmp/$dir" + $GITHUB_WORKSPACE/obj/bin/rr pack $dir/latest-trace + tar zcf $GITHUB_WORKSPACE/failed-tests/$dir.tar.gz $dir + rm -rf $dir + done +fi + +exit $STATUS diff --git a/src/test/prctl.c b/src/test/prctl.c index ffdf71caf9b..5f875ada99c 100644 --- a/src/test/prctl.c +++ b/src/test/prctl.c @@ -79,6 +79,8 @@ int main(void) { test_assert(-1 == prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, 0x7000000, page_size, "foo") && (errno == EINVAL || errno == EBADF || errno == ENOMEM)); + return 1; + atomic_puts("EXIT-SUCCESS"); return 0; }