From 819a3627ce58c11b9f77008179db462c95c5b852 Mon Sep 17 00:00:00 2001 From: Lucas Saavedra Vaz <32426024+lucasssvaz@users.noreply.github.com> Date: Mon, 27 May 2024 13:36:35 -0300 Subject: [PATCH 1/3] ci(wokwi): Self host Wokwi CLI server --- .github/workflows/wokwi.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/wokwi.yml b/.github/workflows/wokwi.yml index 1f55235dd39..4678da7c0ba 100644 --- a/.github/workflows/wokwi.yml +++ b/.github/workflows/wokwi.yml @@ -95,6 +95,9 @@ jobs: - name: Install Wokwi CLI run: curl -L https://wokwi.com/ci/install.sh | sh + - name: Wokwi CI Server + uses: wokwi/wokwi-ci-server-action@v1 + - name: Install dependencies run: | pip install -U pip From 21136a2265c944bbdd5e7f8632628a16a17683e8 Mon Sep 17 00:00:00 2001 From: Lucas Saavedra Vaz <32426024+lucasssvaz@users.noreply.github.com> Date: Mon, 27 May 2024 13:51:58 -0300 Subject: [PATCH 2/3] ci(event_file): Fix file upload --- .github/workflows/hil.yml | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/.github/workflows/hil.yml b/.github/workflows/hil.yml index 9d864b2c67e..29b71921c55 100644 --- a/.github/workflows/hil.yml +++ b/.github/workflows/hil.yml @@ -59,6 +59,12 @@ jobs: echo "test_folder=${test_folder}" >> $GITHUB_OUTPUT echo "test_type=${test_type}" >> $GITHUB_OUTPUT + - name: Upload Event file + uses: actions/upload-artifact@v4 + with: + name: event_file + path: ${{github.event_path}} + build: needs: gen_chunks name: ${{matrix.chip}}-Build#${{matrix.chunks}} @@ -267,13 +273,3 @@ jobs: path: | tests/**/*.xml tests/**/result_*.json - - event_file: - name: "Event File" - runs-on: ubuntu-latest - steps: - - name: Upload - uses: actions/upload-artifact@v4 - with: - name: event_file - path: ${{github.event_path}} From 41457e754d1bc7cb3566595284091e1e951bb140 Mon Sep 17 00:00:00 2001 From: Lucas Saavedra Vaz <32426024+lucasssvaz@users.noreply.github.com> Date: Mon, 27 May 2024 14:45:03 -0300 Subject: [PATCH 3/3] change(tests): Re-run once on test failure --- .github/scripts/tests_run.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/scripts/tests_run.sh b/.github/scripts/tests_run.sh index 62fdcfd5af1..4e8ad4bb3b1 100755 --- a/.github/scripts/tests_run.sh +++ b/.github/scripts/tests_run.sh @@ -7,6 +7,7 @@ function run_test() { local erase_flash=$4 local sketchdir=$(dirname $sketch) local sketchname=$(basename $sketchdir) + local result=0 if [[ -f "$sketchdir/.skip.$platform" ]] || [[ -f "$sketchdir/.skip.$target" ]] || [[ -f "$sketchdir/.skip.$platform.$target" ]]; then echo "Skipping $sketchname test for $target, platform: $platform" @@ -61,11 +62,18 @@ function run_test() { extra_args="--embedded-services esp,arduino" fi + result=0 echo "pytest tests --build-dir $build_dir -k test_$sketchname --junit-xml=$report_file $extra_args" - bash -c "pytest tests --build-dir $build_dir -k test_$sketchname --junit-xml=$report_file $extra_args" + bash -c "set +e; pytest tests --build-dir $build_dir -k test_$sketchname --junit-xml=$report_file $extra_args; exit \$?" || result=$? result=$? if [ $result -ne 0 ]; then - return $result + result=0 + echo "Retrying test: $sketchname -- Config: $i" + bash -c "set +e; pytest tests --build-dir $build_dir -k test_$sketchname --junit-xml=$report_file $extra_args; exit \$?" || result=$? + result=$? + if [ $result -ne 0 ]; then + exit $result + fi fi done }