-
Notifications
You must be signed in to change notification settings - Fork 252
doc/contributions/: enhance Python test framework #1348
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
base: master
Are you sure you want to change the base?
Conversation
1fbbebd to
5fd0910
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.
I'm ok merging as is. If you update based on my comments, that's fine too.
|
|
||
| ### General conventions | ||
|
|
||
| * **PEP 8 compliance**: follow [PEP 8](https://pep8.org/) style guidelines. |
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.
(Took a quick look under .github/workflows and share/ansible, and didn't see anything, but maybe I missed it)
Can we have CI enforce these?
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.
We are already doing it since #1349 was merged 😉
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.
It's called python-linter and you can see it running in this PR
| 1. Test steps | ||
| :expectedresults: | ||
| 1. Expected outcomes | ||
| :customerscenario: False |
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.
What does customerscenario mean?
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.
This means that a customer or end user has found the issue. It is usually accompanied by a ticket in the marker (i.e. gh=1348).
|
|
||
| **Container management:** | ||
| - **List containers**: `docker ps -a` to see all containers and their status. | ||
| - **Access container**: `docker exec -it <container-name> bash` to get shell access. |
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.
let's say that the groupdel test fails. Is there a command like --shell-on-fail that can be passed to pytest to give you a bash shell in the container after the failure, so you can look around? Or does it always leave the container running so you can launch a shell in it, in the failed state?
(Either way, that would be good info in the debug documentation here :) )
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'm not aware of any command that would give you a shell after the test failed but the container is left running after all tests run, this way you can look around if anything fails.
I've updated this section to make this point clear.
Document the new Python system tests: - Benefits - Contribution guidance - How to setup the testing environment - Test configuration and execution - Advanced testing features - Development patterns - Debugging information - Troubleshooting & FAQs Signed-off-by: Iker Pedrosa <[email protected]>
Extend the container section to document the container troubleshooting. Signed-off-by: Iker Pedrosa <[email protected]>
Extend the system tests section. Signed-off-by: Iker Pedrosa <[email protected]>
Document coding style for Python code used in system tests. Signed-off-by: Iker Pedrosa <[email protected]>
5fd0910 to
80021c7
Compare
This documentation update began with the sole purpose of documenting the Python system tests, but it has grown as I have discovered new aspects of the documentation that could be improved.
As a summary: