Skip to content

Commit 595ce90

Browse files
committed
tests: WIP
1 parent 29888b8 commit 595ce90

File tree

7 files changed

+34
-174
lines changed

7 files changed

+34
-174
lines changed

.github/workflows/on_target.yml

+25-99
Original file line numberDiff line numberDiff line change
@@ -3,46 +3,30 @@ name: Target tests
33
on:
44
workflow_call:
55
inputs:
6-
artifact_fw_version:
6+
pytest_marker:
77
type: string
88
required: true
9+
default: "-m not slow"
910
artifact_run_id:
11+
description: The run ID of the workflow to fetch artifacts from
1012
type: string
1113
required: true
12-
run_log_check_tests:
13-
type: boolean
14-
required: false
15-
default: true
16-
run_fota_tests:
17-
type: boolean
18-
required: false
19-
default: true
20-
run_fullmfwfota_test:
21-
type: boolean
22-
required: false
23-
default: false
24-
run_dfu_tests:
25-
type: boolean
26-
required: false
27-
default: true
28-
run_connectivity_bridge_tests:
29-
type: boolean
30-
required: false
31-
default: true
32-
run_wifi_location_tests:
33-
type: boolean
34-
required: false
35-
default: true
36-
run_modem_trace_tests:
37-
type: boolean
38-
required: false
39-
default: true
40-
run_ppk_tests:
41-
type: boolean
14+
artifact_fw_version:
15+
description: The firmware version found under this run_id
16+
type: string
17+
required: true
18+
pytest_path:
19+
type: string
4220
required: false
43-
default: false
21+
default: tests
22+
4423
workflow_dispatch:
4524
inputs:
25+
pytest_marker:
26+
description: The pytest marker to run
27+
type: string
28+
required: true
29+
default: "-m not slow"
4630
artifact_fw_version:
4731
description: The firmware version found under this run_id
4832
type: string
@@ -51,38 +35,11 @@ on:
5135
description: The run ID of the workflow to fetch artifacts from
5236
type: string
5337
required: true
54-
run_functional_tests:
55-
type: boolean
56-
required: true
57-
default: true
58-
run_fota_tests:
59-
type: boolean
60-
required: true
61-
default: false
62-
run_fullmfwfota_test:
63-
type: boolean
64-
required: true
65-
default: false
66-
run_dfu_tests:
67-
type: boolean
68-
required: true
69-
default: false
70-
run_connectivity_bridge_tests:
71-
type: boolean
72-
required: true
73-
default: false
74-
run_wifi_location_tests:
75-
type: boolean
76-
required: true
77-
default: false
78-
run_modem_trace_tests:
79-
type: boolean
80-
required: true
81-
default: false
82-
run_ppk_tests:
83-
type: boolean
84-
required: true
85-
default: false
38+
pytest_path:
39+
description: Select test execution path
40+
type: string
41+
required: false
42+
default: tests
8643

8744
jobs:
8845
target_test:
@@ -139,54 +96,23 @@ jobs:
13996
working-directory: thingy91x-oob/tests/on_target
14097
run: |
14198
mkdir -p results
142-
pytest -s -v \
99+
pytest -s -v -m "not slow" \
143100
--junit-xml=results/test-results-dut1.xml \
144101
--html=results/test-results-dut1.html --self-contained-html \
145102
tests/test_functional
146103
env:
147104
SEGGER: ${{ secrets.SEGGER_DUT_1 }}
105+
SEGGER_NRF53: ${{ secrets.SEGGER_DUT_2_EXT_DBG }}
106+
SEGGER_NRF91: ${{ secrets.SEGGER_DUT_2_NRF91 }}
148107
IMEI: ${{ secrets.IMEI_DUT_1 }}
108+
UART_ID: ${{ secrets.UART_DUT_2 }}
149109
FINGERPRINT: ${{ secrets.FINGERPRINT_DUT_1 }}
150110
LOG_FILENAME: oob_uart_test_log
151-
TEST_FUNCTIONAL: ${{ inputs.run_functional_tests }}
152-
TEST_FOTA: ${{ inputs.run_fota_tests }}
153-
TEST_FOTA_FULLMFW: ${{ inputs.run_fullmfwfota_test }}
154-
TEST_WIFI_LOC: ${{ inputs.run_wifi_location_tests }}
155-
TEST_TRACES: ${{ inputs.run_modem_trace_tests }}
156111
TEST_REPORT_NAME: OOB Firwmare Functional Test Report
157112
DUT1_HW_REVISION: ${{ vars.DUT1_HW_REVISION }}
158-
159-
- name: Run DFU tests
160-
if: ${{ inputs.run_dfu_tests }}
161-
working-directory: thingy91x-oob/tests/on_target
162-
run: |
163-
pytest -s -v -m "dut2 and dfu" \
164-
--junit-xml=results/test-results-dfu.xml \
165-
--html=results/test-results-bridge.html --self-contained-html \
166-
tests/test_bridge
167-
env:
168-
SEGGER_NRF53: ${{ secrets.SEGGER_DUT_2_EXT_DBG }}
169-
SEGGER_NRF91: ${{ secrets.SEGGER_DUT_2_NRF91 }}
170-
UART_ID: ${{ secrets.UART_DUT_2 }}
171-
TEST_REPORT_NAME: OOB Firwmare Bridge Test Report
172-
LOG_FILENAME: oob_dfu_test_log
173-
174-
- name: Run PPK tests
175-
if: ${{ inputs.run_ppk_tests }}
176-
continue-on-error: true
177-
id: ppk_test
178-
working-directory: thingy91x-oob/tests/on_target
179-
run: |
180-
mkdir -p results
181-
pytest -s -v -m dut_ppk \
182-
--junit-xml=results/test-results-ppk.xml \
183-
--html=results/test-results-ppk.html --self-contained-html \
184-
tests/test_ppk
185-
env:
186113
SEGGER: ${{ secrets.SEGGER_DUT_PPK }}
187114

188115
- name: Commit and Push Badge File to gh-pages Branch
189-
if: ${{ inputs.run_ppk_tests }}
190116
continue-on-error: true
191117
working-directory: thingy91x-oob
192118
env:

.github/workflows/test.yml

+5-67
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,11 @@ name: Build and Test
33
on:
44
workflow_dispatch:
55
inputs:
6-
run_fota_tests:
7-
type: boolean
6+
pytest_marker:
7+
type: string
88
required: true
9-
default: true
10-
run_fullmfwfota_test:
11-
type: boolean
12-
required: true
13-
default: false
14-
run_dfu_tests:
15-
type: boolean
16-
required: true
17-
default: true
18-
run_connectivity_bridge_tests:
19-
type: boolean
20-
required: true
21-
default: true
22-
run_wifi_location_tests:
23-
type: boolean
24-
required: true
25-
default: true
26-
run_modem_trace_tests:
27-
type: boolean
28-
required: true
29-
default: true
30-
run_ppk_tests:
31-
type: boolean
32-
required: true
33-
default: false
9+
default: "-m not slow"
10+
3411
schedule:
3512
- cron: "0 0 * * *"
3613
push:
@@ -58,43 +35,4 @@ jobs:
5835
with:
5936
artifact_fw_version: ${{ needs.build.outputs.version }}
6037
artifact_run_id: ${{ needs.build.outputs.run_id }}
61-
run_fota_tests: >-
62-
${{
63-
github.event_name == 'schedule' ||
64-
github.event_name == 'push' ||
65-
(github.event_name == 'workflow_dispatch' && github.event.inputs.run_fota_tests == 'true')
66-
}}
67-
run_fullmfwfota_test: >-
68-
${{
69-
github.event_name == 'schedule' ||
70-
(github.event_name == 'workflow_dispatch' && github.event.inputs.run_fullmfwfota_test == 'true')
71-
}}
72-
run_dfu_tests: >-
73-
${{
74-
github.event_name == 'schedule' ||
75-
github.event_name == 'push' ||
76-
(github.event_name == 'workflow_dispatch' && github.event.inputs.run_dfu_tests == 'true')
77-
}}
78-
run_connectivity_bridge_tests: >-
79-
${{
80-
github.event_name == 'schedule' ||
81-
github.event_name == 'push' ||
82-
(github.event_name == 'workflow_dispatch' && github.event.inputs.run_connectivity_bridge_tests == 'true')
83-
}}
84-
run_wifi_location_tests: >-
85-
${{
86-
github.event_name == 'schedule' ||
87-
github.event_name == 'push' ||
88-
(github.event_name == 'workflow_dispatch' && github.event.inputs.run_wifi_location_tests == 'true')
89-
}}
90-
run_modem_trace_tests: >-
91-
${{
92-
github.event_name == 'schedule' ||
93-
github.event_name == 'push' ||
94-
(github.event_name == 'workflow_dispatch' && github.event.inputs.run_modem_trace_tests == 'true')
95-
}}
96-
run_ppk_tests: >-
97-
${{
98-
github.event_name == 'schedule' ||
99-
(github.event_name == 'workflow_dispatch' && github.event.inputs.run_ppk_tests == 'true')
100-
}}
38+
pytest_marker: ${{ github.event.inputs.pytest_marker || '' }}

tests/on_target/tests/test_bridge/test_conn_bridge.py

+1
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ def t91x_conn_bridge():
7474
uart0.stop()
7575
uart1.stop()
7676

77+
@pytest.mark.slow
7778
def test_conn_bridge(t91x_conn_bridge):
7879
t91x_conn_bridge.uart0.wait_for_str(
7980
"UART0 running at baudrate 115200", timeout=UART_TIMEOUT

tests/on_target/tests/test_bridge/test_serial_dfu.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,7 @@ def t91x_dfu():
7373
uart.stop()
7474

7575

76-
@pytest.mark.dut2
77-
@pytest.mark.dfu
76+
@pytest.mark.slow
7877
def test_dfu(t91x_dfu):
7978
logger.info("Starting DFU, stopping UART")
8079
t91x_dfu.uart.stop()

tests/on_target/tests/test_functional/test_fota.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ def _run_fota(bundleId, fota_type, fotatimeout=APP_FOTA_TIMEOUT, test_fota_resum
7474

7575
return _run_fota
7676

77-
@pytest.mark.skipif(not os.getenv("TEST_FOTA"), reason="Deselected")
7877
def test_app_fota(t91x_board, hex_file, run_fota_fixture):
7978
# Get latest APP fota bundle
8079
results = t91x_board.fota.get_fota_bundles()
@@ -91,7 +90,7 @@ def test_app_fota(t91x_board, hex_file, run_fota_fixture):
9190

9291
run_fota_fixture(bundleId=latest_app_bundle["bundleId"], fota_type="app", test_fota_resumption=True)
9392

94-
@pytest.mark.skipif(not os.getenv("TEST_FOTA"), reason="Deselected")
93+
9594
def test_delta_mfw_fota(t91x_board, hex_file, run_fota_fixture):
9695
# Flash with mfw201
9796
flash_device(os.path.abspath(MFW_201_FILEPATH))
@@ -102,6 +101,6 @@ def test_delta_mfw_fota(t91x_board, hex_file, run_fota_fixture):
102101
# Restore mfw201
103102
flash_device(os.path.abspath(MFW_201_FILEPATH))
104103

105-
@pytest.mark.skipif(not os.getenv("TEST_FOTA_FULLMFW"), reason="Deselected")
104+
@pytest.mark.slow
106105
def test_full_mfw_fota(t91x_board, hex_file, run_fota_fixture):
107106
run_fota_fixture(FULL_MFW_BUNDLEID, "full", FULL_MFW_FOTA_TIMEOUT)

tests/on_target/tests/test_functional/test_location.py

-2
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,9 @@
1414

1515
logger = get_logger()
1616

17-
@pytest.mark.skipif(not os.getenv("TEST_WIFI_LOC"), reason="Deselected")
1817
def test_wifi_location(t91x_board, hex_file):
1918
run_location(t91x_board, hex_file, location_method="Wi-Fi")
2019

21-
@pytest.mark.skipif(not os.getenv("TEST_GNSS"), reason="Deselected")
2220
def test_gnss_location(t91x_board, hex_file):
2321
run_location(t91x_board, hex_file, location_method="GNSS")
2422

tests/on_target/tests/test_functional/test_uart_output.py

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
logger = get_logger()
1616

17-
@pytest.mark.skipif(not os.getenv("TEST_FUNCTIONAL"), reason="Deselected")
1817
def test_uart_output(t91x_board, hex_file):
1918
flash_device(os.path.abspath(hex_file))
2019
t91x_board.uart.xfactoryreset()

0 commit comments

Comments
 (0)