tests/sys/shell: make test script more robust#21036
Merged
Teufelchen1 merged 2 commits intoRIOT-OS:masterfrom Nov 27, 2024
Merged
tests/sys/shell: make test script more robust#21036Teufelchen1 merged 2 commits intoRIOT-OS:masterfrom
Teufelchen1 merged 2 commits intoRIOT-OS:masterfrom
Conversation
This fixes:
/home/[email protected]/Repos/software/RIOT/master/tests/sys/shell/tests/01-run.py:86: SyntaxWarning: invalid escape sequence '\e'
Python still assumes `\\<char>` if `\<char>` is not valid, but started
to warn. Chances are good that this will be elevated to an error in
future python releases.
Teufelchen1
approved these changes
Nov 25, 2024
Contributor
Teufelchen1
left a comment
There was a problem hiding this comment.
Great! Nit: check_help() is a bit hard to read, but still fine for this test case.
3e08d6c to
4ed8197
Compare
Member
Author
I sprinkled some comments over the code. |
4ed8197 to
ad4206d
Compare
benpicco
reviewed
Nov 25, 2024
This changes the behavior of the test script for verifying the `help` command: It no longer assumes a specific order for the list of commands. Making the test robust is a bit tricky, as the module `shell_cmds_default` that is used here may add commands specific to a set of board. We use `help_json` to get the list of commands actually provided, so that we know how many rows the command table printed by `help` need to be parsed. A minimum set of commands that *must* be present for all boards is hard-coded in the test script and the actually provided commands are tested against this. Otherwise e.g. an empty list of commands presented by `help` and `help_json` would also pass. Co-authored-by: benpicco <[email protected]>
a6c50c9 to
b858614
Compare
Member
Author
|
🎉 and thx :) |
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
This changes the behavior of the test script for verifying the
helpcommand: It no longer assumes a specific order for the list of commands.Making the test robust is a bit tricky, as the module
shell_cmds_defaultthat is used here may add commands specific to a set of board. We usehelp_jsonto get the list of commands actually provided, so that we know how many rows the command table printed byhelpneed to be parsed.A minimum set of commands that must be present for all boards is hard-coded in the test script and the actually provided commands are tested against this. Otherwise e.g. an empty list of commands presented by
helpandhelp_jsonwould also pass.Testing procedure
make BOARD=samr21-xpro -C tests/sys/shell flash testIssues/PRs references
Fixes regression from #20958 that caused failing nightlies