Skip to content

Commit 31bfb78

Browse files
committed
Added flag to ignore tests
1 parent e617038 commit 31bfb78

File tree

3 files changed

+34
-3
lines changed

3 files changed

+34
-3
lines changed

.github/template/fwe-build/action.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ inputs:
1616
required: true
1717
dist-files:
1818
required: true
19+
ignore-tests:
20+
required: false
1921

2022
runs:
2123
using: "composite"
@@ -62,7 +64,7 @@ runs:
6264
shell: bash
6365
if: inputs.build-arch == 'native'
6466
run: |
65-
./tools/test-fwe.sh ${{ inputs.extra-options }}
67+
./tools/test-fwe.sh ${{ inputs.extra-options }} ${{inputs.ignore-tests}}
6668
6769
- name: upload-artifacts
6870
uses: actions/upload-artifact@v4

.github/workflows/ci.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ on:
1616

1717
env:
1818
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19+
IGNORE_TESTS: CANDataSourceTest,ISOTPOverCANProtocolTest,IoTFleetWiseEngineTest,OBDOverCANModuleTest
1920

2021
jobs:
2122
linting:
@@ -37,6 +38,7 @@ jobs:
3738
with:
3839
build-arch: "native"
3940
upload-arch: "amd64"
41+
ignore-tests: "--ignore-tests ${{env.IGNORE_TESTS}}"
4042
dist-name: "aws-iot-fleetwise-edge"
4143
cache-paths: /usr/local/x86_64-linux-gnu
4244
dist-files: build/aws-iot-fleetwise-edge:.
@@ -49,6 +51,7 @@ jobs:
4951
with:
5052
build-arch: "cross-arm64"
5153
upload-arch: "arm64"
54+
ignore-tests: "--ignore-tests ${{env.IGNORE_TESTS}}"
5255
dist-name: "aws-iot-fleetwise-edge"
5356
cache-paths: /usr/local/aarch64-linux-gnu:/usr/local/x86_64-linux-gnu
5457
dist-files: build/aws-iot-fleetwise-edge:.
@@ -62,6 +65,7 @@ jobs:
6265
build-arch: "cross-armhf"
6366
upload-arch: "armhf"
6467
extra-options: "--with-iwave-gps-support"
68+
ignore-tests: "--ignore-tests ${{env.IGNORE_TESTS}}"
6569
dist-name: "aws-iot-fleetwise-edge"
6670
cache-paths: /usr/local/arm-linux-gnueabihf:/usr/local/x86_64-linux-gnu
6771
dist-files: build/aws-iot-fleetwise-edge:.
@@ -75,6 +79,7 @@ jobs:
7579
build-arch: "native"
7680
upload-arch: "amd64"
7781
extra-options: "--with-ros2-support"
82+
ignore-tests: "--ignore-tests ${{env.IGNORE_TESTS}}"
7883
dist-name: "aws-iot-fleetwise-edge-ros2"
7984
cache-paths: /usr/local/x86_64-linux-gnu:/opt/ros
8085
dist-files: build/iotfleetwise/aws-iot-fleetwise-edge:.
@@ -88,6 +93,7 @@ jobs:
8893
build-arch: "cross-arm64"
8994
upload-arch: "arm64"
9095
extra-options: "--with-ros2-support"
96+
ignore-tests: "--ignore-tests ${{env.IGNORE_TESTS}}"
9197
dist-name: "aws-iot-fleetwise-edge-ros2"
9298
cache-paths: /usr/local/aarch64-linux-gnu:/usr/local/x86_64-linux-gnu:/opt/ros
9399
dist-files: build/iotfleetwise/aws-iot-fleetwise-edge:.
@@ -101,6 +107,7 @@ jobs:
101107
build-arch: "cross-armhf"
102108
upload-arch: "armhf"
103109
extra-options: "--with-ros2-support"
110+
ignore-tests: "--ignore-tests ${{env.IGNORE_TESTS}}"
104111
dist-name: "aws-iot-fleetwise-edge-ros2"
105112
cache-paths: /usr/local/arm-linux-gnueabihf:/usr/local/x86_64-linux-gnu:/opt/ros
106113
dist-files: build/iotfleetwise/aws-iot-fleetwise-edge:.
@@ -113,6 +120,7 @@ jobs:
113120
with:
114121
build-arch: "cross-android"
115122
upload-arch: "android"
123+
ignore-tests: "--ignore-tests ${{env.IGNORE_TESTS}}"
116124
dist-name: "aws-iot-fleetwise-edge"
117125
cache-paths: /usr/local/x86_64-linux-android:/usr/local/aarch64-linux-android:/usr/local/armv7a-linux-androideabi:/usr/local/x86_64-linux-gnu
118126
dist-files:

tools/test-fwe.sh

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,23 @@
55
set -eo pipefail
66

77
WITH_ROS2_SUPPORT="false"
8+
IGNORE_TESTS=""
89

910
parse_args() {
1011
while [ "$#" -gt 0 ]; do
1112
case $1 in
1213
--with-ros2-support)
1314
WITH_ROS2_SUPPORT="true"
15+
shift
16+
;;
17+
--ignore-tests)
18+
IGNORE_TESTS="$2"
19+
shift
1420
;;
1521
--help)
1622
echo "Usage: $0 [OPTION]"
1723
echo " --with-ros2-support Test with ROS2 support"
24+
echo " --ignore-tests <tests seperated with comma> Ignore tests matching the given pattern"
1825
exit 0
1926
;;
2027
esac
@@ -28,8 +35,22 @@ if ${WITH_ROS2_SUPPORT}; then
2835
source /opt/ros/galactic/setup.bash
2936
# colcon hides the test output, so use tail in the background.
3037
tail -F log/latest_test/iotfleetwise/stdout_stderr.log &
31-
colcon test --return-code-on-test-failure
38+
if [ -n "$IGNORE_TESTS" ]; then
39+
# Split the comma-separated list of test names into an array
40+
IFS=',' read -ra ignored_tests <<< "$IGNORE_TESTS"
41+
# Construct the ctest command with the --exclude-regex option
42+
ctest -V --exclude-regex "$(printf '|%s' "${ignored_tests[@]}")"
43+
else
44+
ctest -V
45+
fi
3246
else
3347
cd build
34-
ctest -V
48+
if [ -n "$IGNORE_TESTS" ]; then
49+
# Split the comma-separated list of test names into an array
50+
IFS=',' read -ra ignored_tests <<< "$IGNORE_TESTS"
51+
# Construct the ctest command with the --exclude-regex option
52+
ctest -V --exclude-regex "$(printf '|%s' "${ignored_tests[@]}")"
53+
else
54+
ctest -V
55+
fi
3556
fi

0 commit comments

Comments
 (0)