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 ff2a155
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 2 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
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 ff2a155

Please sign in to comment.