diff --git a/.github/workflows/target-test.yml b/.github/workflows/target-test.yml index 66e7649..c439bce 100644 --- a/.github/workflows/target-test.yml +++ b/.github/workflows/target-test.yml @@ -106,7 +106,7 @@ jobs: upload-mcu-symbols \ --software-type asset-tracker-template-ci-${{ matrix.device }} \ --software-version ${{ inputs.artifact_fw_version }} \ - asset-tracker-template-${{ inputs.artifact_fw_version }}-${{ matrix.device }}-nrf91.elf + asset-tracker-template-${{ inputs.artifact_fw_version }}-${{ vars.DUT_DEVICE_TYPE }}-nrf91.elf - name: Target Tests working-directory: asset-tracker-template/tests/on_target @@ -136,7 +136,7 @@ jobs: shell: bash env: SEGGER: ${{ env.RUNNER_SERIAL_NUMBER }} - DUT_DEVICE_TYPE: ${{ matrix.device }} + DUT_DEVICE_TYPE: ${{ vars.DUT_DEVICE_TYPE }} UUID: ${{ env.UUID }} NRFCLOUD_API_KEY: ${{ secrets.NRF_CLOUD_API_KEY }} LOG_FILENAME: att_test_log @@ -144,15 +144,16 @@ jobs: MEMFAULT_ORGANIZATION_TOKEN: ${{ secrets.MEMFAULT_ORGANIZATION_TOKEN }} MEMFAULT_ORGANIZATION_SLUG: ${{ vars.MEMFAULT_ORGANIZATION_SLUG }} MEMFAULT_PROJECT_SLUG: ${{ vars.MEMFAULT_PROJECT_SLUG }} - - - name: Commit and Push Badge File to gh-pages Branch - if: always() - continue-on-error: true - working-directory: asset-tracker-template - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: ./tests/on_target/scripts/commit_badge.sh - + APP_BUNDLEID: ${{ env.APP_BUNDLEID }} + + # - name: Commit and Push Badge File to gh-pages Branch + # if: ${{ matrix.device }} == ppk_thingy91x + # continue-on-error: true + # working-directory: asset-tracker-template + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # run: ./tests/on_target/scripts/commit_badge.sh + # - name: Results if: always() uses: pmeier/pytest-results-action@v0.7.1 @@ -160,7 +161,7 @@ jobs: path: asset-tracker-template/tests/on_target/results/*.xml summary: true fail-on-empty: true - title: ATT FW Test Results + title: ATT FW Test Results - ${{ matrix.device }} - name: Create Report Artifact if: always() diff --git a/tests/on_target/tests/conftest.py b/tests/on_target/tests/conftest.py index 016e7ec..bb98e19 100644 --- a/tests/on_target/tests/conftest.py +++ b/tests/on_target/tests/conftest.py @@ -84,7 +84,6 @@ def dut_fota(dut_board): device_id = FOTADEVICE_UUID data = { 'job_id': '', - 'bundle_id': '' } fota.cancel_incomplete_jobs(device_id) @@ -95,8 +94,6 @@ def dut_fota(dut_board): data=data ) fota.cancel_incomplete_jobs(device_id) - if data['bundle_id']: - fota.delete_bundle(data['bundle_id']) @pytest.fixture(scope="module") diff --git a/tests/on_target/tests/test_functional/test_fota.py b/tests/on_target/tests/test_functional/test_fota.py index c3c914e..ac5f329 100644 --- a/tests/on_target/tests/test_functional/test_fota.py +++ b/tests/on_target/tests/test_functional/test_fota.py @@ -8,7 +8,7 @@ import os import functools from utils.flash_tools import flash_device, reset_device -from utils.nrfcloud_fota import FWType, NRFCloudFOTAError +from utils.nrfcloud_fota import NRFCloudFOTAError import sys sys.path.append(os.getcwd()) from utils.logger import get_logger @@ -25,6 +25,8 @@ NEW_MFW_DELTA_VERSION = "mfw_nrf91x1_2.0.2-FOTA-TEST" MFW_202_VERSION = "mfw_nrf91x1_2.0.2" +APP_BUNDLEID = os.getenv("APP_BUNDLEID") + TEST_APP_BIN = { "thingy91x": "artifacts/stable_version_jan_2025-update-signed.bin", "nrf9151dk": "artifacts/nrf9151dk_mar_2025_update_signed.bin" @@ -119,22 +121,8 @@ def _run_fota(bundle_id="", fota_type="app", fotatimeout=APP_FOTA_TIMEOUT, new_v dut_fota.uart.flush() reset_device() dut_fota.uart.wait_for_str("Connected to Cloud") - - time.sleep(60) - app_bin = TEST_APP_BIN[dut_fota.device_type] - if fota_type == "app": - bundle_id = dut_fota.fota.upload_firmware( - "nightly_test_app", - app_bin, - TEST_APP_VERSION, - "Bundle used for nightly test", - FWType.app, - ) - logger.info(f"Uploaded file {app_bin}: bundleId: {bundle_id}") - try: dut_fota.data['job_id'] = dut_fota.fota.create_fota_job(dut_fota.device_id, bundle_id) - dut_fota.data['bundle_id'] = bundle_id except NRFCloudFOTAError as e: pytest.skip(f"FOTA create_job REST API error: {e}") logger.info(f"Created FOTA Job (ID: {dut_fota.data['job_id']})") @@ -195,7 +183,9 @@ def test_app_fota(run_fota_fixture): ''' Test application FOTA from nightly version to stable version ''' - run_fota_fixture() # Uses default parameters for app FOTA + run_fota_fixture( + bundle_id=APP_BUNDLEID, + ) def test_delta_mfw_fota(run_fota_fixture): '''