Skip to content

Commit 0d11455

Browse files
tests: on_target: memfault test uses debug hex
Now memfault is only built on debug build. Signed-off-by: Giacomo Dematteis <giacomo.dematteis@nordicsemi.no>
1 parent 06b1974 commit 0d11455

File tree

4 files changed

+20
-24
lines changed

4 files changed

+20
-24
lines changed

.github/workflows/publish-symbol-files-to-memfault.yml

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -32,26 +32,7 @@ jobs:
3232
3333
- run: node .github/workflows/fetch-release-assets.mjs ${{ inputs.version }}
3434

35-
- name: Publish symbol files
36-
run: |
37-
source venv/bin/activate
38-
memfault \
39-
--org-token ${{ secrets.MEMFAULT_ORGANIZATION_TOKEN }} \
40-
--org ${{ vars.MEMFAULT_ORGANIZATION_SLUG }} \
41-
--project ${{ vars.MEMFAULT_PROJECT_SLUG }} \
42-
upload-mcu-symbols \
43-
--check-uploaded \
44-
asset-tracker-template-${{ inputs.version }}-thingy91x-nrf91.elf
45-
46-
memfault \
47-
--org-token ${{ secrets.MEMFAULT_ORGANIZATION_TOKEN }} \
48-
--org ${{ vars.MEMFAULT_ORGANIZATION_SLUG }} \
49-
--project ${{ vars.MEMFAULT_PROJECT_SLUG }} \
50-
upload-mcu-symbols \
51-
--check-uploaded \
52-
asset-tracker-template-${{ inputs.version }}-nrf9151dk-nrf91.elf
53-
54-
- name: Publish debug symbol files
35+
- name: Publish Memfault debug symbols
5536
run: |
5637
source venv/bin/activate
5738
memfault \

.github/workflows/target-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ jobs:
128128
nrfutil install trace
129129
130130
- name: Upload symbol file to Memfault
131-
if: ${{ matrix.device != 'ppk_thingy91x' }}
131+
if: ${{ matrix.device == 'thingy91x' }}
132132
working-directory: asset-tracker-template/tests/on_target/artifacts
133133
run: |
134134
memfault \
@@ -137,7 +137,7 @@ jobs:
137137
--project ${{ vars.MEMFAULT_PROJECT_SLUG }} \
138138
upload-mcu-symbols \
139139
--check-uploaded \
140-
asset-tracker-template-${{ inputs.artifact_fw_version }}-${{ vars.DUT_DEVICE_TYPE }}-nrf91.elf
140+
asset-tracker-template-${{ inputs.artifact_fw_version }}-debug-${{ vars.DUT_DEVICE_TYPE }}-nrf91.elf
141141
142142
- name: Generate and Push RAM and FLASH Badges
143143
if: ${{ matrix.device == 'thingy91x' && inputs.is_scheduled }}

tests/on_target/tests/conftest.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,18 @@ def hex_file():
140140

141141
pytest.fail("No matching firmware .hex file found in the artifacts directory")
142142

143+
@pytest.fixture(scope="session")
144+
def debug_hex_file():
145+
# Search for the debug firmware hex file in the artifacts folder
146+
artifacts_dir = "artifacts/"
147+
hex_pattern = f"asset-tracker-template-{r'[0-9a-z\.]+'}-debug-{DUT_DEVICE_TYPE}-nrf91.hex"
148+
149+
for file in os.listdir(artifacts_dir):
150+
if re.match(hex_pattern, file):
151+
return os.path.join(artifacts_dir, file)
152+
153+
pytest.fail("No matching debug firmware .hex file found in the artifacts directory")
154+
143155
@pytest.fixture(scope="session")
144156
def bin_file():
145157
# Search for the firmware bin file in the artifacts folder

tests/on_target/tests/test_functional/test_memfault.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,17 @@ def timestamp(event):
8989
event["captured_date"], "%Y-%m-%dT%H:%M:%S.%f%z"
9090
)
9191

92-
def test_memfault(dut_board, hex_file):
92+
def test_memfault(dut_board, debug_hex_file):
93+
if dut_board.device_type != 'thingy91x':
94+
pytest.skip("Memfault testing requires debug build which is only available for thingy91x")
95+
9396
# Save timestamp of latest coredump
9497
coredumps = get_latest_coredump_traces(IMEI)
9598
logger.debug(f"Found coredumps: {coredumps}")
9699
timestamp_old_coredump = timestamp(coredumps[0]) if coredumps else None
97100
logger.debug(f"Timestamp old coredump: {timestamp_old_coredump}")
98101

99-
flash_device(os.path.abspath(hex_file))
102+
flash_device(os.path.abspath(debug_hex_file))
100103
dut_board.uart.xfactoryreset()
101104
dut_board.uart.flush()
102105
reset_device()

0 commit comments

Comments
 (0)