-
Notifications
You must be signed in to change notification settings - Fork 85
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
How to write good tests for parallel environments #2182
base: development/2.10
Are you sure you want to change the base?
Conversation
Hello williamlardier,My role is to assist you with the merge of this Available options
Available commands
Status report is not available. |
Incorrect fix versionThe
Considering where you are trying to merge, I ignored possible hotfix versions and I expected to find:
Please check the |
10f2ebf
to
1e35990
Compare
Incorrect fix versionThe
Considering where you are trying to merge, I ignored possible hotfix versions and I expected to find:
Please check the |
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.
should this instead go in a more "natural" location, e.g. docs/writing-ctst-tests.md
?
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.
The current docs folder is used with tox, it's a real doc we used to render as html pages, putting it here is logical but it doesn't look good...
tests/ctst/HOW_TO_WRITE_TESTS.md
Outdated
|
||
**Rule #1** | ||
|
||
> Tests must be idempotent. |
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.
> Tests must be idempotent. | |
> Tests should be idempotent. |
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 "should" and not "must"? it is not supposed to be a suggestion.
tests/ctst/HOW_TO_WRITE_TESTS.md
Outdated
- Location creation; | ||
- Bucket Website endpoints. | ||
|
||
... must be created before the test start, or in a dedicated set of test. |
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.
... must be created before the test start, or in a dedicated set of test. | |
... should be created before the test start, or in a dedicated set of test. |
Issue: ZENKO-4944
e8b2fcb
to
12d3d5f
Compare
Issue: ZENKO-4944
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.
General formatting/presentation remarks:
- It would be more straightforward for readers to just name the rules as titles prefixed by their number. I find the bold rule number followed by the rule itself as a quote a bit distracting.
- The word please is not needed in this sort of document (or any documentation or UI really) and sets a tone of asking for a favor vs giving directions that everyone needs to follow. A former tech writer on the team made sure that we removed all pleases from docs (even internal/technical) and UIs for consistency.
tests/ctst/HOW_TO_WRITE_TESTS.md
Outdated
> Teardown resources. | ||
|
||
If a test creates resources, ensure they are deleted at the end of the test. | ||
Do not delete the resources in case of error, to ease debugging. |
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 both agree and disagree: tearing down resources should always be done and be reliable, and also we need to be able to debug. A middle ground would be to skip teardown on failure only if in debug mode (the one with tmate active), otherwise always do it.
This would make rule #9 redundant as tests relying on other tests to have run would just not work.
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.
Thank you for all the feedback. I updated the page accordingly - I agree with everything but this. I updated as you suggested though.
I think we should not cleanup resources in case of error even if we're not running debug. The reason is that as each test uses a partitioned set of resources (bucket/objects, possibly account), not cleaning in case of error (or flaky) helps us finding the root cause much more easily, by having access to the metadata in the mongodb dumps, as well as the logs of all operations done by CTST for the failing test (identifiable with a single id). The overhead is minimal and it should not affect other tests in any way, even if the bucket is still here.
What does this PR do, and why do we need it?
With 10 rules, ensure the new tests in CTST are following a set of rule to ensure their quality.
Which issue does this PR fix?
Fixes ZENKO-4944.
Special notes for your reviewers:
Please feel free to suggest changes or new rules, or start a discussion if you disagree with a rule.