From 91e52ff3d0c299db89b9007103d37addd5177f22 Mon Sep 17 00:00:00 2001 From: Giacomo Dematteis Date: Thu, 29 Aug 2024 16:19:49 +0200 Subject: [PATCH] tests: on_target: adjust fullmfw fota workflow Full mfw fota is only run on cron and on selection. Signed-off-by: Giacomo Dematteis --- .github/workflows/on_target.yml | 23 ++++++++++++++++++++++- .github/workflows/test.yml | 25 +++++++++++++++++++++++++ tests/on_target/tests/pytest.ini | 3 ++- tests/on_target/tests/test_fota.py | 2 +- 4 files changed, 50 insertions(+), 3 deletions(-) diff --git a/.github/workflows/on_target.yml b/.github/workflows/on_target.yml index 019b59b1..83c5f9ee 100644 --- a/.github/workflows/on_target.yml +++ b/.github/workflows/on_target.yml @@ -13,6 +13,10 @@ on: type: boolean required: false default: true + run_fullmfwfota_test: + type: boolean + required: true + default: false run_dfu_tests: type: boolean required: false @@ -35,6 +39,10 @@ on: type: boolean required: true default: false + run_fullmfwfota_test: + type: boolean + required: true + default: false run_dfu_tests: type: boolean required: true @@ -91,7 +99,7 @@ jobs: env: SEGGER: ${{ secrets.SEGGER_DUT_1 }} - - name: Run FOTA tests + - name: Run FOTA tests (standard) if: ${{ inputs.run_fota_tests }} working-directory: thingy91x-oob/tests/on_target run: | @@ -104,6 +112,19 @@ jobs: IMEI: ${{ secrets.IMEI_DUT_1 }} FINGERPRINT: ${{ secrets.FINGERPRINT_DUT_1 }} + - name: Run FOTA tests (FULLMFW) + if: ${{ inputs.run_fullmfwfota_test }} + working-directory: thingy91x-oob/tests/on_target + run: | + pytest -s -v -m "dut1 and fullmfw_fota" \ + --junit-xml=results/test-results-fullmfw-fota.xml \ + --firmware-hex artifacts/hello.nrfcloud.com-${{ inputs.artifact_fw_version }}-thingy91x-debug-app.hex \ + tests + env: + SEGGER: ${{ secrets.SEGGER_DUT_1 }} + IMEI: ${{ secrets.IMEI_DUT_1 }} + FINGERPRINT: ${{ secrets.FINGERPRINT_DUT_1 }} + - name: Run DFU tests if: ${{ inputs.run_dfu_tests }} working-directory: thingy91x-oob/tests/on_target diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6baa9058..41dec385 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,6 +2,23 @@ name: Build and Test on Target on: workflow_dispatch: + inputs: + run_fota_tests: + type: boolean + required: true + default: true + run_fullmfwfota_test: + type: boolean + required: true + default: false + run_dfu_tests: + type: boolean + required: true + default: true + run_connectivity_bridge_tests: + type: boolean + required: true + default: true schedule: - cron: "0 0 * * *" push: @@ -20,3 +37,11 @@ jobs: with: artifact_fw_version: ${{ needs.build.outputs.version }} artifact_run_id: ${{ needs.build.outputs.run_id }} + run_fota_tests: ${{ github.event.inputs.run_fota_tests == 'true' }} + run_fullmfwfota_test: >- + ${{ + github.event_name == 'schedule' || + (github.event_name == 'workflow_dispatch' && github.event.inputs.run_fullmfwfota_test == 'true') + }} + run_dfu_tests: ${{ github.event.inputs.run_dfu_tests == 'true' }} + run_connectivity_bridge_tests: ${{ github.event.inputs.run_connectivity_bridge_tests == 'true' }} diff --git a/tests/on_target/tests/pytest.ini b/tests/on_target/tests/pytest.ini index d8a20901..09109b1c 100644 --- a/tests/on_target/tests/pytest.ini +++ b/tests/on_target/tests/pytest.ini @@ -3,4 +3,5 @@ markers = dut1: device used for uart and fota tests dut2: device used for dfu tests uart: uart tests - fota: fota tests + fota: standard fota tests + fullmfw_fota: fullmfw fota tests diff --git a/tests/on_target/tests/test_fota.py b/tests/on_target/tests/test_fota.py index acbe56f5..6f84dcc5 100644 --- a/tests/on_target/tests/test_fota.py +++ b/tests/on_target/tests/test_fota.py @@ -124,6 +124,6 @@ def test_delta_mfw_fota(t91x_board, hex_file, run_fota_fixture): @pytest.mark.dut1 -@pytest.mark.fota +@pytest.mark.fullmfw_fota def test_full_mfw_fota(t91x_board, hex_file, run_fota_fixture): run_fota_fixture(FULL_MFW_BUNDLEID, "full", FULL_MFW_FOTA_TIMEOUT)