build-system: add capability to execute scripts with custom executor#18770
Merged
miri64 merged 1 commit intoRIOT-OS:masterfrom Oct 20, 2022
Merged
build-system: add capability to execute scripts with custom executor#18770miri64 merged 1 commit intoRIOT-OS:masterfrom
miri64 merged 1 commit intoRIOT-OS:masterfrom
Conversation
Murdock results✔️ PASSED 14b7abd build-system: add capability to execute scripts with custom executor
ArtifactsThis only reflects a subset of all builds from https://ci-prod.riot-os.org. Please refer to https://ci.riot-os.org for a complete build for now. |
benpicco
approved these changes
Oct 19, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Contribution description
I sometimes find it more convenient to use
pytestto execute and debug my more complex tests (it shows output in order of test execution, in color, you can filter tests and has flags to step in withpdb, ...). However, for that I either need to define all the RIOT environment in my shell, or touchmakefile/tests/tests.mkto execute the test withpytest. Since I do not want to enforcepyteston everyone and the CI, this amends that file with two optional macrosTEST_EXECUTORandTEST_EXECUTOR_FLAGS, so the executor for the tests can be selected from the environment.Testing procedure
Sadly, not all tests are able to be run this way: when the
test...function has an argument,pytestthinks that argument is a fixture and gets confused (another reason why I madepytestoptional). However, all tests that are based on unittest classes (so eitherunittests.TestCaseortestrunner.unittest.PexpectTestCase(e.g.tests/turocan now be executed this way):Of course, the normal approach should also still work:
Issues/PRs references
None, but got the idea while debugging #18769.