File: github-actions-test.sh

package info (click to toggle)
rr 5.9.0-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 12,060 kB
  • sloc: ansic: 66,406; cpp: 57,678; python: 4,627; asm: 1,331; sh: 576; xml: 411; makefile: 30
file content (31 lines) | stat: -rwxr-xr-x 1,060 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash

set +x # echo commands

# Enable perf events for rr
echo 0 | sudo tee /proc/sys/kernel/perf_event_paranoid > /dev/null
# Enable ptrace-attach to any process. This lets us get more data when tests fail.
echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope > /dev/null
# Disable AppArmor restrictions on user namespaces, which our tests need to use
(echo 0 | sudo tee /proc/sys/kernel/apparmor_restrict_unprivileged_userns) > /dev/null || true
let halfproc=`nproc`/2
cd obj
mkdir -p Testing/Temporary
mv ../scripts/github-actions-CTestCostData.txt Testing/Temporary/CTestCostData.txt
ctest -j$halfproc --verbose

STATUS=$?
if [[ $STATUS != 0 ]]; then
  mkdir $GITHUB_WORKSPACE/failed-tests
  #cp -a Testing/Temporary/CTestCostData.txt $GITHUB_WORKSPACE/failed-tests/rr-test-ctestcostdata.txt
  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