Skip to content

Commit

Permalink
fix CI tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Irgang (thir820) committed Feb 21, 2025
1 parent 40d0278 commit 27e390a
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 39 deletions.
20 changes: 3 additions & 17 deletions .github/workflows/robot-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,7 @@ jobs:
- name: Generate Test Matrix
id: get_tests
run: |
sudo apt-get update && sudo apt-get install -y python3 python3-venv python3-pip
python3 -m pip install --upgrade pip
pip install robotframework
echo "test_cases=$(./robot_tests/tools/extract_cases_names.py ./robot_tests/images.robot)" >> $GITHUB_OUTPUT
echo "$(cat ./robot_tests/ci_tests)" >> $GITHUB_OUTPUT
Test:
runs-on: ubuntu-latest
Expand All @@ -60,21 +57,12 @@ jobs:
id: pull_dev
run: docker pull ghcr.io/elektrobit/ebcl_dev_container:${{ needs.prepare-sdk.outputs.container_tag }}

# Replace '/' in Test Case Names with '_'
# '/' not allowed in File Names
- name: Sanitize Test Name
id: sanitize
run: |
test_name="${{ matrix.test_case }}"
sanitized_test_name=$(echo "$test_name" | tr '/' '_') # Replace slashes with underscores
echo "sanitized_test_name=$sanitized_test_name" >> $GITHUB_ENV
- name: Run Robot Test in dev container
id: robot
uses: devcontainers/ci@v0.3
with:
runCmd: |
robot --outputdir ./robot_tests --test "${{ matrix.test_case }}" ./robot_tests/images.robot
FORCE_CLEAN_REBUILD=1 ./run_tests.sh "${{ matrix.test_case }}"
- name: Upload test report
# Upload artifacts always when Robot Test failed but never when prepare steps fail.
Expand All @@ -83,6 +71,4 @@ jobs:
with:
name: "report-${{ env.sanitized_test_name }}"
path: |
./robot_tests/report.html
./robot_tests/output.xml
./robot_tests/log.html
./robot_tests/test_report*.zip
1 change: 1 addition & 0 deletions robot_tests/ci_tests
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
["amd64_appdev_qemu_crinit.test.env","arm64_appdev_qemu_crinit.test.env","arm64_appdev_qemu_crinit.test.env"]
2 changes: 1 addition & 1 deletion robot_tests/resources/image.resource
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Library robot/libraries/String.py

*** Keywords ***
Build Image
[Arguments] ${path}= ${max_time}=15m
[Arguments] ${path}= ${max_time}=25m
[Timeout] ${max_time}
Log Using build timeout of ${max_time}.
Clear ${path}
Expand Down
8 changes: 5 additions & 3 deletions robot_tests/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,11 @@ if [[ $# -eq 0 ]] ; then
else
if [[ $1 == *.test.env ]]
then
echo "Running test env: $1"
source $1
run_test_classes ${EBCL_TC_ROBOT_FILES}
for test in $@; do
echo "Running test env: $1"
source $1
run_test_classes ${EBCL_TC_ROBOT_FILES}
done
else
echo "Running robot with arguments: \"$@\""
robot --outputdir ${log_dir} "$@"
Expand Down
18 changes: 0 additions & 18 deletions robot_tests/tools/extract_cases_names.py

This file was deleted.

0 comments on commit 27e390a

Please sign in to comment.