Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: fota: Remove upload #118

Merged
merged 1 commit into from
Mar 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 13 additions & 12 deletions .github/workflows/target-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -136,31 +136,32 @@ 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
TEST_REPORT_NAME: ATT Firwmare Test Report
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
with:
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()
Expand Down
3 changes: 0 additions & 3 deletions tests/on_target/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ def dut_fota(dut_board):
device_id = FOTADEVICE_UUID
data = {
'job_id': '',
'bundle_id': ''
}
fota.cancel_incomplete_jobs(device_id)

Expand All @@ -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")
Expand Down
22 changes: 6 additions & 16 deletions tests/on_target/tests/test_functional/test_fota.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand Down Expand Up @@ -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']})")
Expand Down Expand Up @@ -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):
'''
Expand Down
Loading