Skip to content

Commit 9cc759e

Browse files
committed
Added initial stability HIL CI tests
1 parent 74b699c commit 9cc759e

File tree

4 files changed

+627
-1
lines changed

4 files changed

+627
-1
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: DepthAI Core HIL Stability
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
- develop
9+
tags:
10+
- 'v*'
11+
pull_request:
12+
branches:
13+
- main
14+
- develop
15+
16+
# Only allow latest run on same branch to be tested
17+
concurrency:
18+
group: ci-stability-${{ github.ref }}-1
19+
cancel-in-progress: true
20+
21+
jobs:
22+
23+
# Testing
24+
test:
25+
runs-on: ['self-hosted', 'hil-stability', 'linux']
26+
27+
steps:
28+
- name: Cache .hunter folder
29+
uses: actions/cache@v2
30+
with:
31+
path: $HOME/.hun_vanilla
32+
key: hunter-linux-stability-vanilla
33+
- uses: actions/checkout@v2
34+
with:
35+
submodules: 'recursive'
36+
37+
# TODO also modify above hunter key to 'asan'
38+
# - name: Specify ASAN toolchain path
39+
# run: echo "CMAKE_TOOLCHAIN_PATH=$PWD/cmake/toolchain/asan.cmake" >> $GITHUB_ENV
40+
41+
# - name: Configure, Build and Test
42+
# run: |
43+
# cmake -S . -B build -D CMAKE_BUILD_TYPE=Release -D HUNTER_ROOT=$HOME/.hun_vanilla -D DEPTHAI_BUILD_TESTS=ON
44+
# cmake --build build --parallel 8 --config Release --target stability_stress_test
45+
# cd build
46+
# ../ci/stability_stress_test_combined.sh
47+
48+
# Release build
49+
- name: Configure, Build and Test
50+
run: |
51+
cmake -S . -B build -D CMAKE_BUILD_TYPE=Release -D HUNTER_ROOT=$HOME/.hun_vanilla -D DEPTHAI_BUILD_TESTS=ON
52+
cmake --build build --parallel 8 --config Release --target stability_stress_test
53+
cd build
54+
../ci/stability_stress_test_combined.sh 86400
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Cleanup in case the script dies
2+
cleanup() {
3+
# kill all processes whose parent is this process
4+
pkill -P $$
5+
}
6+
7+
for sig in INT QUIT HUP TERM; do
8+
trap "
9+
cleanup
10+
trap - $sig EXIT
11+
kill -s $sig "'"$$"' "$sig"
12+
done
13+
trap cleanup EXIT
14+
15+
# Print timeout if set, otherwise use default
16+
echo "Timeout set to: $1"
17+
18+
# Run USB & PoE stability stress test
19+
DEPTHAI_PROTOCOL=usb timeout $(($1+30)) ./tests/stability_stress_test $1 &
20+
jobUsb=$!
21+
DEPTHAI_PROTOCOL=tcpip timeout $(($1+30)) ./tests/stability_stress_test $1 &
22+
jobTcpip=$!
23+
24+
# Wait for tests and save result code
25+
wait $jobUsb ; resultUsb=$?
26+
wait $jobTcpip ; resultTcpip=$?
27+
28+
# Print results
29+
echo "Stability test USB: $resultUsb"
30+
echo "Stability test PoE: $resultTcpip"
31+
32+
# If both tests concluded successfully, exit with code 0
33+
if [[ "$resultUsb" == "0" ]] && [[ "$resultTcpip" == "0" ]]; then
34+
echo "Success!"
35+
exit 0
36+
fi
37+
echo "Failed!"
38+
exit 1

tests/CMakeLists.txt

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,13 @@ hunter_private_data(
184184
FILE "text-image-super-resolution-0001_2022.1.0_4shave.blob"
185185
LOCATION openvino_2022_1_blob
186186
)
187+
# YoloV4 resource
188+
hunter_private_data(
189+
URL "https://artifacts.luxonis.com/artifactory/luxonis-depthai-data-local/network/yolo-v4-tiny-tf_openvino_2021.4_4shave.blob"
190+
SHA1 "7da2f96f7300e3828940557e6a86ac6f243eef7e"
191+
FILE "yolo-v4-tiny-tf_openvino_2021.4_4shave.blob"
192+
LOCATION tiny_yolo_v4_2021-4_4shave_blob
193+
)
187194

188195

189196
# Add tests
@@ -234,4 +241,25 @@ dai_test_compile_definitions(filesystem_test_20 PRIVATE BLOB_PATH="${mobilenet_b
234241
dai_add_test(bootloader_version_test src/bootloader_version_test.cpp)
235242

236243
# XLinkIn -> XLinkOut passthrough with large frames
237-
dai_add_test(xlink_roundtrip_test src/xlink_roundtrip_test.cpp)
244+
dai_add_test(xlink_roundtrip_test src/xlink_roundtrip_test.cpp)
245+
246+
# Stability stress test (OAK-D oriented USB/PoE)
247+
# TODO
248+
# # dai_add_test(stability_stress_test src/stability_stress_test.cpp)
249+
option(DEPTHAI_STABILITY_STRESS_TEST_DEBUG "Enable visualization for stability stress test" OFF)
250+
add_executable(stability_stress_test src/stability_stress_test.cpp)
251+
add_default_flags(stability_stress_test LEAN)
252+
if(COMMAND target_clangformat_setup)
253+
target_clangformat_setup(stability_stress_test "")
254+
endif()
255+
if(DEPTHAI_STABILITY_TEST_DEBUG)
256+
target_link_libraries(stability_stress_test PRIVATE depthai::opencv opencv_highgui)
257+
target_compile_definitions(stability_stress_test PRIVATE DEPTHAI_STABILITY_TEST_DEBUG)
258+
else()
259+
target_link_libraries(stability_stress_test PRIVATE depthai::core)
260+
endif()
261+
target_compile_definitions(stability_stress_test PRIVATE BLOB_PATH="${tiny_yolo_v4_2021-4_4shave_blob}")
262+
# add_test(stability_stress_test stability_stress_test)
263+
# add_test(stability_stress_test_poe stability_stress_test)
264+
# set_tests_properties(stability_stress_test PROPERTIES ENVIRONMENT "UBSAN_OPTIONS=halt_on_error=1;DEPTHAI_PROTOCOL=usb" LABELS stability_usb)
265+
# set_tests_properties(stability_stress_test_poe PROPERTIES ENVIRONMENT "UBSAN_OPTIONS=halt_on_error=1;DEPTHAI_PROTOCOL=poe" LABELS stability_poe)

0 commit comments

Comments
 (0)