MDLSITE-5960 [docs] Ban use of resetAfterTest in shared setup#1626
Open
safatshahin wants to merge 1 commit into
Open
MDLSITE-5960 [docs] Ban use of resetAfterTest in shared setup#1626safatshahin wants to merge 1 commit into
safatshahin wants to merge 1 commit into
Conversation
✅ Deploy Preview for moodledevdocs ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
There was a problem hiding this comment.
Pull request overview
Strengthens Moodle DevDocs testing guidance by explicitly documenting where resetAfterTest should be called and adding a clear prohibition against calling it from shared setUp, to prevent unnecessary DB resets across a whole test class and to keep test suites performant and predictable.
Changes:
- Adds a new “Where to call
resetAfterTest” subsection clarifying valid call sites (test body or helper invoked by a test). - Introduces a danger admonition banning use of
resetAfterTest(and other cleanup-requiring fixtures) in sharedsetUp. - Applies the same guidance to current docs and the 5.1/5.2 versioned docs.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| docs/guides/testing/index.md | Adds explicit placement guidance for resetAfterTest and bans its use in shared setUp. |
| versioned_docs/version-5.1/guides/testing/index.md | Mirrors the new resetAfterTest placement guidance and shared setUp prohibition for 5.1 docs. |
| versioned_docs/version-5.2/guides/testing/index.md | Mirrors the new resetAfterTest placement guidance and shared setUp prohibition for 5.2 docs. |
14589b4 to
f5a18ad
Compare
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.
Included stronger recommendation and red flags for this matter.