-
Notifications
You must be signed in to change notification settings - Fork 2k
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
tests/sys/shell: make test script more robust #21036
Merged
Merged
Conversation
This file contains 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
This fixes: /home/marian.buschsieweke@ml-pa.loc/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.
maribu
requested review from
leandrolanzieri,
aabadie and
MichelRottleuthner
as code owners
November 25, 2024 10:53
maribu
added
Type: bug
The issue reports a bug / The PR fixes a bug (including spelling errors)
Area: tests
Area: tests and testing framework
CI: ready for build
If set, CI server will compile all applications for all available boards for the labeled PR
labels
Nov 25, 2024
github-actions
bot
removed
Type: bug
The issue reports a bug / The PR fixes a bug (including spelling errors)
CI: ready for build
If set, CI server will compile all applications for all available boards for the labeled PR
labels
Nov 25, 2024
maribu
added
Type: bug
The issue reports a bug / The PR fixes a bug (including spelling errors)
CI: ready for build
If set, CI server will compile all applications for all available boards for the labeled PR
labels
Nov 25, 2024
maribu
changed the title
Tests/sys/shell/fix test
tests/sys/shell: make test script more robust
Nov 25, 2024
Teufelchen1
approved these changes
Nov 25, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! Nit: check_help() is a bit hard to read, but still fine for this test case.
maribu
force-pushed
the
tests/sys/shell/fix-test
branch
from
November 25, 2024 12:56
3e08d6c
to
4ed8197
Compare
I sprinkled some comments over the code. |
maribu
force-pushed
the
tests/sys/shell/fix-test
branch
from
November 25, 2024 12:58
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 <benpicco@googlemail.com>
maribu
force-pushed
the
tests/sys/shell/fix-test
branch
from
November 25, 2024 16:23
a6c50c9
to
b858614
Compare
🎉 and thx :) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Area: tests
Area: tests and testing framework
CI: ready for build
If set, CI server will compile all applications for all available boards for the labeled PR
Type: bug
The issue reports a bug / The PR fixes a bug (including spelling errors)
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
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 usehelp_json
to get the list of commands actually provided, so that we know how many rows the command table printed byhelp
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
andhelp_json
would also pass.Testing procedure
make BOARD=samr21-xpro -C tests/sys/shell flash test
Issues/PRs references
Fixes regression from #20958 that caused failing nightlies