Skip to content

Commit e141597

Browse files
mergify[bot]Mario-DLemiliocuestaf
authored
Test generation of types with -python in ci (backport #399) (#402)
* Run generation of types with -python in ci (#399) Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> (cherry picked from commit e605e07) # Conflicts: # .github/workflows/reusable-ubuntu-ci.yml * Updating jdk version to work in Ubuntu 22 Signed-off-by: Emilio Cuesta <emiliocuesta@eprosima.com> * Downgrade dds-types-test commit Signed-off-by: Emilio Cuesta <emiliocuesta@eprosima.com> * Try again with older commit Signed-off-by: Emilio Cuesta <emiliocuesta@eprosima.com> * Addfailing tests to blacklist Signed-off-by: Emilio Cuesta <emiliocuesta@eprosima.com> * Hardcode test removal Signed-off-by: Emilio Cuesta <emiliocuesta@eprosima.com> * Add separate blacklist for python tests Signed-off-by: Emilio Cuesta <emiliocuesta@eprosima.com> * WIP Signed-off-by: Emilio Cuesta <emiliocuesta@eprosima.com> * Test to run only python with blacklist Signed-off-by: Emilio Cuesta <emiliocuesta@eprosima.com> * Add common tests back Signed-off-by: Emilio Cuesta <emiliocuesta@eprosima.com> --------- Signed-off-by: Emilio Cuesta <emiliocuesta@eprosima.com> Co-authored-by: Mario Domínguez López <116071334+Mario-DL@users.noreply.github.com> Co-authored-by: Emilio Cuesta <emiliocuesta@eprosima.com>
1 parent 7378a44 commit e141597

File tree

4 files changed

+32
-2
lines changed

4 files changed

+32
-2
lines changed

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

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@ on:
6464
required: false
6565
type: string
6666
default: 'exceptions,interfaces,interfaces_2,inner_const_and_typedef'
67+
python_blacklist_idls:
68+
description: 'Comma-separated list of tests to be blacklisted when running fastddsgen with the -python argument'
69+
required: false
70+
type: string
71+
default: 'aliases,unions'
6772
env:
6873
cdr-test-flag: ${{ inputs.fastcdr-branch == '1.1.x' && format('-Dcdr_version=v1 -Dblacklist_tests=external,optional,{0}', inputs.blacklist_idls) || (inputs.fastcdr-branch == '2.x' && format('-Dcdr_version=v2 -Dblacklist_tests={0}', inputs.blacklist_idls) || '-Dcdr_version=both' )}}
6974
defaults:
@@ -236,3 +241,27 @@ jobs:
236241
source ${{ github.workspace }}/install/local_setup.bash
237242
cd ${{ github.workspace }}/src/fastddsgen
238243
./gradlew test ${{ env.cdr-test-flag }}
244+
245+
- name: Test fastddsgen with python arg
246+
if: ${{ inputs.run-tests == true }}
247+
run: |
248+
source ${{ github.workspace }}/install/local_setup.bash
249+
cd ${{ github.workspace }}/src/fastddsgen/thirdparty/dds-types-test/IDL
250+
251+
# Example: python_blacklist_idls='file1,file1'
252+
IFS=',' read -r -a BL <<< "${{ inputs.python_blacklist_idls }}"
253+
254+
# Build exclusion: ! ( -name file1.idl -o -name file2.idl )
255+
EXCL=()
256+
for f in "${BL[@]}"; do
257+
[[ -n "$f" ]] && EXCL+=(-name "${f}.idl" -o)
258+
done
259+
# Drop trailing -o if present
260+
((${#EXCL[@]})) && unset 'EXCL[${#EXCL[@]}-1]'
261+
262+
# Run find: match *.idl files, exclude blacklist, and batch fastddsgen calls
263+
if ((${#EXCL[@]})); then
264+
find . -type f -name '*.idl' ! \( "${EXCL[@]}" \) -exec sh -c 'echo "Running command: fastddsgen -python $@"; fastddsgen -python "$@"' {} +
265+
else
266+
find . -type f -name '*.idl' -exec sh -c 'echo "NO excl Running command: fastddsgen -python $@"; fastddsgen -python "$@"' {} +
267+
fi

.github/workflows/ubuntu-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
matrix:
5858
java-version:
5959
- 'openjdk-11-jdk'
60-
- 'openjdk-19-jdk'
60+
- 'openjdk-17-jdk'
6161
fastcdr-branch:
6262
- '1.1.x'
6363
- '2.x'

src/test/java/com/eprosima/fastdds/FastDDSGenTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ public void runTests()
142142
list_tests,
143143
blacklist_tests);
144144
tests.addCMakeArguments("-DCMAKE_BUILD_TYPE=Debug");
145+
// Remove tests that are not supported
145146
tests.removeTests("basic_inner_types");
146147

147148
boolean testResult = tests.runTests();

0 commit comments

Comments
 (0)