Skip to content

Commit

Permalink
iox-#eclipse-iceoryx#692 Split tests
Browse files Browse the repository at this point in the history
Signed-off-by: Ibrahim Kuru <[email protected]>
  • Loading branch information
ibrhmkuru committed Jan 18, 2023
1 parent 71964c6 commit 5431af9
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 12 deletions.
39 changes: 33 additions & 6 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,18 +109,45 @@ jobs:
- name: Run Address Sanitizer
run: ./tools/ci/build-test-ubuntu-with-sanitizers.sh clang asan

build-test-ubuntu-with-thread-sanitizer-clang-latest:
# prevent stuck jobs consuming runners for 3 hours
timeout-minutes: 180
build-ubuntu-with-thread-sanitizer-clang-latest:
timeout-minutes: 30
runs-on: ubuntu-latest
needs: pre-flight-check
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install iceoryx dependencies and clang-tidy
uses: ./.github/actions/install-iceoryx-deps-and-clang
- name: Run Thread Sanitizer
run: ./tools/ci/build-test-ubuntu-with-sanitizers.sh clang tsan
- name: Build with Thread Sanitizer
run: ./tools/ci/build-test-ubuntu-with-sanitizers.sh clang tsan skip-tests
- name: temp test
run : ls -al
- name: upload hoofs-test-binaries
uses: actions/upload-artifact@v3
with:
name: hoofs-test-binaries
path: build/hoofs
- name: upload posh-test-binaries
uses: actions/upload-artifact@v3
with:
name: posh-test-binaries
path: build/posh

test-ubuntu-with-thread-sanitizer-hoofs-moduletest:
# prevent stuck jobs consuming runners for 1 hour
timeout-minutes: 60
runs-on: ubuntu-latest
needs: build-ubuntu-with-thread-sanitizer-clang-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install iceoryx dependencies and clang-tidy
uses: ./.github/actions/install-iceoryx-deps-and-clang
- name: download hoofs-test-binaries
uses: actions/download-artifact@v3
with:
name: hoofs-test-binaries
- name: Execute the test
run: ls -al; build/hoofs/hoofs_moduletests --gtest_filter=-*.TimingTest_* --gtest_output=xml:hoofs_ModuleTestResults.xml

build-test-macos-with-address-sanitizer:
# prevent stuck jobs consuming runners for 1 hour
Expand Down
47 changes: 41 additions & 6 deletions tools/ci/build-test-ubuntu-with-sanitizers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,41 @@

set -e

COMPILER=${1:-gcc}
SANITIZER=${2:-asan}
COMPILER=gcc
SANITIZER=asan
SKIP_TESTS=false


while (( "$#" )); do
case "$1" in
"gcc" | "clang")
COMPILER="$1"
shift 1
;;
"asan" | "tsan")
SANITIZER="$1"
shift 1
;;
"skip-tests")
SKIP_TESTS=true
shift 1
;;
"help")
echo "Usage: $0 [gcc|clang] [asan|tsan] [skip-tests]"
echo " gcc | clang : compiler to use (default: gcc)"
echo " asan | tsan : sanitizer to use (default: asan)"
echo " asan: address sanitizer"
echo " tsan: thread sanitizer"
echo " skip-tests: skip tests after the build"

exit 0
;;
*)
echo "Invalid argument '$1'. Try 'help' for options."
exit 1
;;
esac
done

msg() {
printf "\033[1;32m%s: %s\033[0m\n" ${FUNCNAME[1]} "$1"
Expand All @@ -29,16 +62,14 @@ msg() {
WORKSPACE=$(git rev-parse --show-toplevel)
cd "${WORKSPACE}"

msg "COMPILER: ${COMPILER}"
msg "SANITIZER: ${SANITIZER}"
msg "installing build dependencies"
sudo apt-get update && sudo apt-get install -y libacl1-dev libncurses5-dev

msg "creating local test users and groups for testing access control"
sudo ./tools/scripts/add_test_users.sh

if [ "$SANITIZER" != "asan" ] && [ "$SANITIZER" != "tsan" ]; then
msg "Invalid sanitizer."
exit 1
fi

msg "building sources"
if [ "$COMPILER" == "gcc" ]; then
Expand All @@ -49,6 +80,10 @@ if [ "$COMPILER" == "clang" ]; then
./tools/iceoryx_build_test.sh clean build-strict build-shared build-all clang debug $SANITIZER test-add-user out-of-tree
fi

if [ "$SKIP_TESTS" == "true" ]; then
exit 0
fi

msg "running all tests"
cd ./build
if [ "$SANITIZER" == "tsan" ]; then
Expand Down

0 comments on commit 5431af9

Please sign in to comment.