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

twister: Pass extra test args to pytest #82620

Merged
merged 1 commit into from
Dec 12, 2024

Conversation

gchwier
Copy link
Collaborator

@gchwier gchwier commented Dec 5, 2024

Pass additional args to test binary.
Fixes #82463

to test just run command:
./scripts/twister -vv -p native_sim -T samples/subsys/testsuite/pytest/shell -ll debug --no-clean --pytest-args='-k test_shell_print_version' -- -stop_at=3 -testargs abc

in the log you can find, that twister calls:
pytest --twister-harness -s -v ... --device-type=native '--extra-test-args=-stop_at=3 -testargs abc' '-k test_shell_print_version' -p twister_harness.plugin
and then pytest calls:
./twister-out/native_sim_native/samples/subsys/testsuite/pytest/shell/sample.pytest.shell/zephyr/zephyr.exe -stop_at=3 -testargs abc

Twister passes additional args to pytest subprocess only for native_sim (as it is for normal Twister applications, I mean console harness or ztest).

nashif
nashif previously approved these changes Dec 5, 2024
lylezhu2012
lylezhu2012 previously approved these changes Dec 6, 2024
@gchwier gchwier added the DNM This PR should not be merged (Do Not Merge) label Dec 6, 2024
Pass additional args to test binary. Twister
passes it only for native_sim.
Fixes zephyrproject-rtos#82463

Signed-off-by: Grzegorz Chwierut <[email protected]>
@gchwier gchwier dismissed stale reviews from lylezhu2012 and nashif via a83e89c December 6, 2024 08:47
@gchwier gchwier force-pushed the grch-pytest-extra-args branch from 77b2534 to a83e89c Compare December 6, 2024 08:47
@gchwier gchwier removed the DNM This PR should not be merged (Do Not Merge) label Dec 6, 2024
@gchwier
Copy link
Collaborator Author

gchwier commented Dec 6, 2024

I have fixed the unit tests and added a new one.

@nashif nashif merged commit c4d884c into zephyrproject-rtos:main Dec 12, 2024
28 of 29 checks passed
@gchwier gchwier deleted the grch-pytest-extra-args branch December 12, 2024 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

twister: it is not working to pass additional args to native_sim test binary
5 participants