Skip to content

MDLSITE-5960 [docs] Ban use of resetAfterTest in shared setup#1626

Open
safatshahin wants to merge 1 commit into
moodle:mainfrom
safatshahin:MDLSITE-5960
Open

MDLSITE-5960 [docs] Ban use of resetAfterTest in shared setup#1626
safatshahin wants to merge 1 commit into
moodle:mainfrom
safatshahin:MDLSITE-5960

Conversation

@safatshahin

Copy link
Copy Markdown
Collaborator

Included stronger recommendation and red flags for this matter.

Copilot AI review requested due to automatic review settings June 29, 2026 04:58
@netlify

netlify Bot commented Jun 29, 2026

Copy link
Copy Markdown

Deploy Preview for moodledevdocs ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit f5a18ad
🔍 Latest deploy log https://app.netlify.com/projects/moodledevdocs/deploys/6a4202cbcebde3000865ebc7
😎 Deploy Preview https://deploy-preview-1626--moodledevdocs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 shared setUp.
  • 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.

Comment thread docs/guides/testing/index.md Outdated
Comment thread versioned_docs/version-5.1/guides/testing/index.md Outdated
Comment thread versioned_docs/version-5.2/guides/testing/index.md Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants