Skip to content

Commit 01bba1f

Browse files
committed
Refs #23701. Exclude IDLs with @feed from tests.
Signed-off-by: Miguel Company <[email protected]>
1 parent 54f9536 commit 01bba1f

File tree

1 file changed

+28
-2
lines changed

1 file changed

+28
-2
lines changed

.github/workflows/reusable-ubuntu-ci.yml

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,14 @@ on:
5959
required: false
6060
type: boolean
6161
default: false
62+
blacklist_idls:
63+
description: 'Comma-separated list of tests to be blacklisted'
64+
required: false
65+
type: string
66+
default: 'interfaces,interfaces_2'
67+
env:
68+
blacklist_tests: ${{ inputs.run-tests && inputs.blacklist_idls }}
69+
gradle-test-flags: ${{ inputs.blacklist_idls && format('-Dblacklist_tests={0}', inputs.blacklist_idls) }}
6270
defaults:
6371
run:
6472
shell: bash
@@ -217,14 +225,32 @@ jobs:
217225

218226
- name: Test fastddsgen
219227
if: ${{ inputs.run-tests == true }}
228+
env:
229+
gradle-test-flags: ${{ env.blacklist_tests && '-Dblacklist_tests=${{ env.blacklist_tests }}' }}
220230
run: |
221231
source ${{ github.workspace }}/install/local_setup.bash
222232
cd ${{ github.workspace }}/src/fastddsgen
223-
./gradlew test
233+
./gradlew test ${{ env.gradle-test-flags }}
224234
225235
- name: Test fastddsgen with python arg
226236
if: ${{ inputs.run-tests == true }}
227237
run: |
228238
source ${{ github.workspace }}/install/local_setup.bash
229239
cd ${{ github.workspace }}/src/fastddsgen/thirdparty/dds-types-test/IDL
230-
find . -path "*.idl*" -exec fastddsgen -python {} +
240+
# Example: blacklist_tests='file1,file1'
241+
IFS=',' read -r -a BL <<< "${{ env.blacklist_tests }}"
242+
243+
# Build exclusion: ! ( -name file1.idl -o -name file2.idl )
244+
EXCL=()
245+
for f in "${BL[@]}"; do
246+
[[ -n "$f" ]] && EXCL+=(-name "${f}.idl" -o)
247+
done
248+
# Drop trailing -o if present
249+
((${#EXCL[@]})) && unset 'EXCL[${#EXCL[@]}-1]'
250+
251+
# Run find: match *.idl files, exclude blacklist, and batch fastddsgen calls
252+
if ((${#EXCL[@]})); then
253+
find . -type f -name '*.idl' ! \( "${EXCL[@]}" \) -exec fastddsgen -python {} +
254+
else
255+
find . -type f -name '*.idl' -exec fastddsgen -python {} +
256+
fi

0 commit comments

Comments
 (0)