Skip to content

Commit

Permalink
Collect test-failure artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
rocallahan committed May 26, 2024
1 parent 65bbaa0 commit d4f43fb
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 2 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,12 @@ jobs:
run: ./scripts/github-actions-build.sh

- name: Test
id: test
run: ./scripts/github-actions-test.sh

- uses: actions/upload-artifact@v4
if: failure() && steps.test.outcome == 'failure'
with:
name: failed-tests
path: failed-tests/*
compression-level: 0
2 changes: 1 addition & 1 deletion scripts/github-actions-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
16 changes: 15 additions & 1 deletion scripts/github-actions-test.sh
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
2 changes: 2 additions & 0 deletions src/test/prctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit d4f43fb

Please sign in to comment.