-
Notifications
You must be signed in to change notification settings - Fork 7k
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: shell harness with commands alongside the harness_config #85612
twister: shell harness with commands alongside the harness_config #85612
Conversation
@@ -107,9 +107,17 @@ schema;scenario-schema: | |||
type: map | |||
required: false | |||
mapping: | |||
"shell_params_file": |
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.
why is this being removed? what if I want to have multiple scenarios with different files, i.e not using the default test_shell.yml
?
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.
You can have multiple test configurations with different shell commands in harness_config. However I understand the scenario, to override during testing the test_shell.yml (but you can also change testcase.yml).
I can restore that option to load command from given file or from harness_config.
I though also about more generic approach, to be able to include yaml snippet, e.g. using https://pypi.org/project/pyyaml-include/, than you can keep test configurations in separate files if testcase yaml is to large.
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.
to override during testing the test_shell.yml (but you can also change testcase.yml).
not sure what you mean here, this is not just during testing...
test1:
harness_config:
shell_param_file: x.yml
test2:
harness_config:
shell_param_file: y.yml
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.
so as I wrote: You can have multiple test configurations with different shell commands in harness_config,
it can be replaced with:
test1:
harness_config:
shell_commands:
- command1
expected1
- command2
test2:
harness_config:
shell_commands:
- command2
expected2
- command3
expected3
IMO keeping commands in a separate YAML file introduces unnecessary complexity. It will make it harder to understand what is going on in the tests. It's better to change it now, while no tests are using this feature. Later, we will need to consider backward compatibility.
8adb3aa
to
0a5fd8a
Compare
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.
Flash shell looks ok.
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.
I like it :)
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.
need to add back reading test data from files. As I said here: #85033 (comment) and here #85033 (comment) I can live with testdata in the testcase.yaml file for small sets, but this needs to scale beyond just a few entries and testdata in general should be seperated from test definition and configuration.
Now it basically supports reading from one single file that is pre-defined, which makes it worse that it was before.
a29dd7e
0a5fd8a
to
a29dd7e
Compare
restored option to read commands from file. Changed @nashif Please review |
95a0450
to
053ae1c
Compare
053ae1c
to
4f8b4bd
Compare
rebased and added new lines to twister.rst after code-block... some problems with building docs :( |
4f8b4bd
to
e467959
Compare
e467959
to
2ba3b85
Compare
I don't really know why it is failing on |
smp is sporadic in CI (and locally), I would just exclude this one or we will be hitting it in every other PR. |
Allow user to add shell commands in testcase/sample yaml file alongside the harness_config like in the console harness. Signed-off-by: Grzegorz Chwierut <[email protected]>
6a90a07
2ba3b85
to
6a90a07
Compare
added |
Allow user to add shell commands in testcase/sample yaml file alongside the harness_config like in the console harness.
ref: #85033
Instead of having shell commands in a separate file, one can add:
Added examples in samples/subsys/testsuite/pytest/shell and updated existing samples.
To test you can run:
@nashif , @bjarki-andreasen answering that comment:
#85033 (comment)
in one sample I added example usage of anchors in yaml files, it works!