Skip to content

Commit 4b19a0e

Browse files
committed
test: fota: Remove upload
Use env vars instead of runner vars Signed-off-by: Jorgen Kvalvaag <jorgen.kvalvaag@nordicsemi.no>
1 parent 6b9e39c commit 4b19a0e

File tree

3 files changed

+19
-31
lines changed

3 files changed

+19
-31
lines changed

.github/workflows/target-test.yml

+13-12
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ jobs:
106106
upload-mcu-symbols \
107107
--software-type asset-tracker-template-ci-${{ matrix.device }} \
108108
--software-version ${{ inputs.artifact_fw_version }} \
109-
asset-tracker-template-${{ inputs.artifact_fw_version }}-${{ matrix.device }}-nrf91.elf
109+
asset-tracker-template-${{ inputs.artifact_fw_version }}-${{ vars.DUT_DEVICE_TYPE }}-nrf91.elf
110110
111111
- name: Target Tests
112112
working-directory: asset-tracker-template/tests/on_target
@@ -136,31 +136,32 @@ jobs:
136136
shell: bash
137137
env:
138138
SEGGER: ${{ env.RUNNER_SERIAL_NUMBER }}
139-
DUT_DEVICE_TYPE: ${{ matrix.device }}
139+
DUT_DEVICE_TYPE: ${{ vars.DUT_DEVICE_TYPE }}
140140
UUID: ${{ env.UUID }}
141141
NRFCLOUD_API_KEY: ${{ secrets.NRF_CLOUD_API_KEY }}
142142
LOG_FILENAME: att_test_log
143143
TEST_REPORT_NAME: ATT Firwmare Test Report
144144
MEMFAULT_ORGANIZATION_TOKEN: ${{ secrets.MEMFAULT_ORGANIZATION_TOKEN }}
145145
MEMFAULT_ORGANIZATION_SLUG: ${{ vars.MEMFAULT_ORGANIZATION_SLUG }}
146146
MEMFAULT_PROJECT_SLUG: ${{ vars.MEMFAULT_PROJECT_SLUG }}
147-
148-
- name: Commit and Push Badge File to gh-pages Branch
149-
if: always()
150-
continue-on-error: true
151-
working-directory: asset-tracker-template
152-
env:
153-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
154-
run: ./tests/on_target/scripts/commit_badge.sh
155-
147+
APP_BUNDLEID: ${{ env.APP_BUNDLEID }}
148+
149+
# - name: Commit and Push Badge File to gh-pages Branch
150+
# if: ${{ matrix.device }} == ppk_thingy91x
151+
# continue-on-error: true
152+
# working-directory: asset-tracker-template
153+
# env:
154+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
155+
# run: ./tests/on_target/scripts/commit_badge.sh
156+
#
156157
- name: Results
157158
if: always()
158159
uses: pmeier/pytest-results-action@v0.7.1
159160
with:
160161
path: asset-tracker-template/tests/on_target/results/*.xml
161162
summary: true
162163
fail-on-empty: true
163-
title: ATT FW Test Results
164+
title: ATT FW Test Results - ${{ matrix.device }}
164165

165166
- name: Create Report Artifact
166167
if: always()

tests/on_target/tests/conftest.py

-3
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ def dut_fota(dut_board):
8484
device_id = FOTADEVICE_UUID
8585
data = {
8686
'job_id': '',
87-
'bundle_id': ''
8887
}
8988
fota.cancel_incomplete_jobs(device_id)
9089

@@ -95,8 +94,6 @@ def dut_fota(dut_board):
9594
data=data
9695
)
9796
fota.cancel_incomplete_jobs(device_id)
98-
if data['bundle_id']:
99-
fota.delete_bundle(data['bundle_id'])
10097

10198

10299
@pytest.fixture(scope="module")

tests/on_target/tests/test_functional/test_fota.py

+6-16
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import os
99
import functools
1010
from utils.flash_tools import flash_device, reset_device
11-
from utils.nrfcloud_fota import FWType, NRFCloudFOTAError
11+
from utils.nrfcloud_fota import NRFCloudFOTAError
1212
import sys
1313
sys.path.append(os.getcwd())
1414
from utils.logger import get_logger
@@ -25,6 +25,8 @@
2525
NEW_MFW_DELTA_VERSION = "mfw_nrf91x1_2.0.2-FOTA-TEST"
2626
MFW_202_VERSION = "mfw_nrf91x1_2.0.2"
2727

28+
APP_BUNDLEID = os.getenv("APP_BUNDLEID")
29+
2830
TEST_APP_BIN = {
2931
"thingy91x": "artifacts/stable_version_jan_2025-update-signed.bin",
3032
"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
119121
dut_fota.uart.flush()
120122
reset_device()
121123
dut_fota.uart.wait_for_str("Connected to Cloud")
122-
123-
time.sleep(60)
124-
app_bin = TEST_APP_BIN[dut_fota.device_type]
125-
if fota_type == "app":
126-
bundle_id = dut_fota.fota.upload_firmware(
127-
"nightly_test_app",
128-
app_bin,
129-
TEST_APP_VERSION,
130-
"Bundle used for nightly test",
131-
FWType.app,
132-
)
133-
logger.info(f"Uploaded file {app_bin}: bundleId: {bundle_id}")
134-
135124
try:
136125
dut_fota.data['job_id'] = dut_fota.fota.create_fota_job(dut_fota.device_id, bundle_id)
137-
dut_fota.data['bundle_id'] = bundle_id
138126
except NRFCloudFOTAError as e:
139127
pytest.skip(f"FOTA create_job REST API error: {e}")
140128
logger.info(f"Created FOTA Job (ID: {dut_fota.data['job_id']})")
@@ -195,7 +183,9 @@ def test_app_fota(run_fota_fixture):
195183
'''
196184
Test application FOTA from nightly version to stable version
197185
'''
198-
run_fota_fixture() # Uses default parameters for app FOTA
186+
run_fota_fixture(
187+
bundle_id=APP_BUNDLEID,
188+
)
199189

200190
def test_delta_mfw_fota(run_fota_fixture):
201191
'''

0 commit comments

Comments
 (0)