Skip to content

Commit 986f351

Browse files
committed
tests: Add nrf9151dk
Signed-off-by: Jorgen Kvalvaag <jorgen.kvalvaag@nordicsemi.no>
1 parent 6ee3743 commit 986f351

File tree

8 files changed

+131
-110
lines changed

8 files changed

+131
-110
lines changed

.github/workflows/build.yml

+33-20
Original file line numberDiff line numberDiff line change
@@ -93,33 +93,47 @@ jobs:
9393
fi
9494
9595
# Asset Tracker Template firmware build
96-
97-
- name: Build nrf91 firmware
96+
- name: Build thingy91x firmware
9897
working-directory: asset-tracker-template/app
9998
run: |
99+
mkdir -p artifacts
100100
cp overlay-memfault.conf overlay-memfault-att.conf
101101
echo "CONFIG_MEMFAULT_NCS_PROJECT_KEY=\"${{ secrets.MEMFAULT_PROJECT_KEY }}\"" >> overlay-memfault-att.conf
102102
echo CONFIG_MEMFAULT_NCS_FW_VERSION_STATIC=y >> overlay-memfault-att.conf
103103
echo CONFIG_MEMFAULT_NCS_FW_VERSION=\"${{ env.VERSION }}\" >> overlay-memfault-att.conf
104104
echo CONFIG_MEMFAULT_NCS_FW_TYPE=\"${{ env.MEMFAULT_SW_TYPE }}\" >> overlay-memfault-att.conf
105-
west build -b thingy91x/nrf9151/ns -p --sysbuild -- -DEXTRA_CONF_FILE="overlay-memfault-att.conf"
106-
107-
- name: Rename artifacts
108-
working-directory: asset-tracker-template/app/build
109-
run: |
110-
cp merged.hex asset-tracker-template-${{ env.VERSION }}-thingy91x-nrf91.hex
111-
cp app/zephyr/.config asset-tracker-template-${{ env.VERSION }}-thingy91x-nrf91.config
112-
cp app/zephyr/zephyr.signed.bin asset-tracker-template-${{ env.VERSION }}-thingy91x-nrf91-update-signed.bin
113-
cp app/zephyr/zephyr.signed.hex asset-tracker-template-${{ env.VERSION }}-thingy91x-nrf91-update-signed.hex
114-
cp app/zephyr/zephyr.elf asset-tracker-template-${{ env.VERSION }}-thingy91x-nrf91.elf
115-
cp dfu_application.zip asset-tracker-template-${{ env.VERSION }}-thingy91x-nrf91-dfu.zip
105+
west build -b thingy91x/nrf9151/ns -d build -p --sysbuild -- -DEXTRA_CONF_FILE="overlay-memfault-att.conf"
106+
cp build/merged.hex artifacts/asset-tracker-template-${{ env.VERSION }}-thingy91x-nrf91.hex
107+
cp build/app/zephyr/.config artifacts/asset-tracker-template-${{ env.VERSION }}-thingy91x-nrf91.config
108+
cp build/app/zephyr/zephyr.signed.bin artifacts/asset-tracker-template-${{ env.VERSION }}-thingy91x-nrf91-update-signed.bin
109+
cp build/app/zephyr/zephyr.signed.hex artifacts/asset-tracker-template-${{ env.VERSION }}-thingy91x-nrf91-update-signed.hex
110+
cp build/app/zephyr/zephyr.elf artifacts/asset-tracker-template-${{ env.VERSION }}-thingy91x-nrf91.elf
111+
cp build/dfu_application.zip artifacts/asset-tracker-template-${{ env.VERSION }}-thingy91x-nrf91-dfu.zip
112+
cd build
113+
ninja partition_manager_report
114+
ninja partition_manager_report > ../artifacts/pmr-thingy91x-nrf91-default-${{ env.VERSION }}.txt
115+
sed -i '1d' ../artifacts/pmr-thingy91x-nrf91-default-${{ env.VERSION }}.txt
116116
117-
- name: Create partition manager report for nRF91 firmware
118-
working-directory: asset-tracker-template/app/build
117+
- name: Build nrf9151dk firmware
118+
working-directory: asset-tracker-template/app
119119
run: |
120+
mkdir -p artifacts
121+
cp overlay-memfault.conf overlay-memfault-att.conf
122+
echo "CONFIG_MEMFAULT_NCS_PROJECT_KEY=\"${{ secrets.MEMFAULT_PROJECT_KEY }}\"" >> overlay-memfault-att.conf
123+
echo CONFIG_MEMFAULT_NCS_FW_VERSION_STATIC=y >> overlay-memfault-att.conf
124+
echo CONFIG_MEMFAULT_NCS_FW_VERSION=\"${{ env.VERSION }}\" >> overlay-memfault-att.conf
125+
echo CONFIG_MEMFAULT_NCS_FW_TYPE=\"${{ env.MEMFAULT_SW_TYPE }}\" >> overlay-memfault-att.conf
126+
west build -b nrf9151dk/nrf9151/ns -d build -p --sysbuild -- -DEXTRA_CONF_FILE="overlay-memfault-att.conf"
127+
cp build/merged.hex artifacts/asset-tracker-template-${{ env.VERSION }}-nrf9151dk-nrf91.hex
128+
cp build/app/zephyr/.config artifacts/asset-tracker-template-${{ env.VERSION }}-nrf9151dk-nrf91.config
129+
cp build/app/zephyr/zephyr.signed.bin artifacts/asset-tracker-template-${{ env.VERSION }}-nrf9151dk-nrf91-update-signed.bin
130+
cp build/app/zephyr/zephyr.signed.hex artifacts/asset-tracker-template-${{ env.VERSION }}-nrf9151dk-nrf91-update-signed.hex
131+
cp build/app/zephyr/zephyr.elf artifacts/asset-tracker-template-${{ env.VERSION }}-nrf9151dk-nrf91.elf
132+
cp build/dfu_application.zip artifacts/asset-tracker-template-${{ env.VERSION }}-nrf9151dk-nrf91-dfu.zip
133+
cd build
120134
ninja partition_manager_report
121-
ninja partition_manager_report > pmr-nrf91-default-${{ env.VERSION }}.txt
122-
sed -i '1d' pmr-nrf91-default-${{ env.VERSION }}.txt
135+
ninja partition_manager_report > ../artifacts/pmr-nrf9151dk-nrf91-default-${{ env.VERSION }}.txt
136+
sed -i '1d' ../artifacts/pmr-nrf9151dk-nrf91-default-${{ env.VERSION }}.txt
123137
124138
- name: Upload artifact
125139
uses: actions/upload-artifact@v4
@@ -128,11 +142,10 @@ jobs:
128142
name: firmware-att
129143
if-no-files-found: error
130144
path: |
131-
asset-tracker-template/app/build/asset-tracker-template-*.*
145+
asset-tracker-template/app/artifacts/*
132146
133147
# Asset Tracker Template debug firmware build
134-
135-
- name: Build nrf91 debug firmware
148+
- name: Build thingy91x debug firmware
136149
if: ${{ inputs.build_debug }}
137150
working-directory: asset-tracker-template/app
138151
run: |

.github/workflows/target-test.yml

+8-4
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,15 @@ jobs:
4141
target_test:
4242
# This will create multiple jobs, one for each target defined in the matrix
4343
strategy:
44-
fail-fast: false # Don't fail all jobs if one fails
44+
fail-fast: false # Don't fail all jobs if one fails
4545
matrix:
4646
include:
47-
- device: cia-trd-thingy91x
47+
- device: nrf9151dk
48+
- device: thingy91x
4849

4950
# Self-hosted runner is labeled according to the device it is linked with
50-
runs-on: ${{ matrix.device }}
51+
runs-on: cia-trd-${{ matrix.device }}
52+
environment: ${{ matrix.device }}
5153
name: Target Test - ${{ matrix.device }}
5254

5355
permissions:
@@ -94,6 +96,7 @@ jobs:
9496
pip install -r requirements.txt --break-system-packages
9597
9698
- name: Upload symbol file to Memfault
99+
if: ${{ matrix.device != 'ppk_thingy91x' }}
97100
working-directory: asset-tracker-template/tests/on_target/artifacts
98101
run: |
99102
memfault \
@@ -103,7 +106,7 @@ jobs:
103106
upload-mcu-symbols \
104107
--software-type asset-tracker-template-ci \
105108
--software-version ${{ inputs.artifact_fw_version }} \
106-
asset-tracker-template-${{ inputs.artifact_fw_version }}-thingy91x-nrf91.elf
109+
asset-tracker-template-${{ inputs.artifact_fw_version }}-${{ matrix.device }}-nrf91.elf
107110
108111
- name: Target Tests
109112
working-directory: asset-tracker-template/tests/on_target
@@ -133,6 +136,7 @@ jobs:
133136
shell: bash
134137
env:
135138
SEGGER: ${{ env.RUNNER_SERIAL_NUMBER }}
139+
DUT_DEVICE_TYPE: ${{ matrix.device }}
136140
UUID: ${{ env.UUID }}
137141
NRFCLOUD_API_KEY: ${{ secrets.NRF_CLOUD_API_KEY }}
138142
LOG_FILENAME: att_test_log
Binary file not shown.

tests/on_target/tests/conftest.py

+13-10
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
UART_ID = os.getenv('UART_ID', SEGGER)
2323
FOTADEVICE_UUID = os.getenv('UUID')
2424
NRFCLOUD_API_KEY = os.getenv('NRFCLOUD_API_KEY')
25+
DUT_DEVICE_TYPE = os.getenv('DUT_DEVICE_TYPE')
2526

2627
def get_uarts():
2728
base_path = "/dev/serial/by-id"
@@ -54,14 +55,17 @@ def pytest_runtest_logfinish(nodeid, location):
5455
logger.info(f"Finished test: {nodeid}")
5556

5657
@pytest.fixture(scope="function")
57-
def t91x_board():
58+
def dut_board():
5859
all_uarts = get_uarts()
5960
if not all_uarts:
6061
pytest.fail("No UARTs found")
6162
log_uart_string = all_uarts[0]
6263
uart = Uart(log_uart_string, timeout=UART_TIMEOUT)
6364

64-
yield types.SimpleNamespace(uart=uart)
65+
yield types.SimpleNamespace(
66+
uart=uart,
67+
device_type=DUT_DEVICE_TYPE
68+
)
6569

6670
uart_log = uart.whole_log
6771
uart.stop()
@@ -70,7 +74,7 @@ def t91x_board():
7074
scan_log_for_assertions(uart_log)
7175

7276
@pytest.fixture(scope="function")
73-
def t91x_fota(t91x_board):
77+
def dut_fota(dut_board):
7478
if not NRFCLOUD_API_KEY:
7579
pytest.skip("NRFCLOUD_API_KEY environment variable not set")
7680
if not FOTADEVICE_UUID:
@@ -85,35 +89,34 @@ def t91x_fota(t91x_board):
8589
fota.cancel_incomplete_jobs(device_id)
8690

8791
yield types.SimpleNamespace(
92+
**dut_board.__dict__,
8893
fota=fota,
89-
uart=t91x_board.uart,
9094
device_id=device_id,
9195
data=data
9296
)
93-
9497
fota.cancel_incomplete_jobs(device_id)
9598
if data['bundle_id']:
9699
fota.delete_bundle(data['bundle_id'])
97100

98101

99102
@pytest.fixture(scope="module")
100-
def t91x_traces(t91x_board):
103+
def dut_traces(dut_board):
101104
all_uarts = get_uarts()
102105
trace_uart_string = all_uarts[1]
103106
uart_trace = UartBinary(trace_uart_string)
104107

105108
yield types.SimpleNamespace(
109+
**dut_board.__dict__,
106110
trace=uart_trace,
107-
uart=t91x_board.uart
108111
)
109112

110113
uart_trace.stop()
111114

112115
@pytest.fixture(scope="session")
113116
def hex_file():
114117
# Search for the firmware hex file in the artifacts folder
115-
artifacts_dir = "artifacts"
116-
hex_pattern = r"asset-tracker-template-[0-9a-z\.]+-thingy91x-nrf91\.hex"
118+
artifacts_dir = "artifacts/"
119+
hex_pattern = f"asset-tracker-template-{r"[0-9a-z\.]+"}-{DUT_DEVICE_TYPE}-nrf91.hex"
117120

118121
for file in os.listdir(artifacts_dir):
119122
if re.match(hex_pattern, file):
@@ -125,7 +128,7 @@ def hex_file():
125128
def bin_file():
126129
# Search for the firmware bin file in the artifacts folder
127130
artifacts_dir = "artifacts"
128-
hex_pattern = r"asset-tracker-template-[0-9a-z\.]+-thingy91x-nrf91-update-signed\.bin"
131+
hex_pattern = f"asset-tracker-template-{r"[0-9a-z\.]+"}-{DUT_DEVICE_TYPE}-nrf91-update-signed.hex"
129132

130133
for file in os.listdir(artifacts_dir):
131134
if re.match(hex_pattern, file):

0 commit comments

Comments
 (0)