Skip to content

📖 [Docs]: PowerShell module test profiles now match recursive discovery#98

Draft
Marius Storhaug (MariusStorhaug) wants to merge 7 commits into
mainfrom
docs-powershell-test-layouts
Draft

📖 [Docs]: PowerShell module test profiles now match recursive discovery#98
Marius Storhaug (MariusStorhaug) wants to merge 7 commits into
mainfrom
docs-powershell-test-layouts

Conversation

@MariusStorhaug

@MariusStorhaug Marius Storhaug (MariusStorhaug) commented Jul 26, 2026

Copy link
Copy Markdown
Member

PowerShell module authors can now choose a documented Simple, Standard, or Advanced test profile, with Process-PSModule discovery and trigger behavior described consistently across the authoring and framework guidance.

New: Three module test profiles

Simple keeps one root-level ./tests/<ModuleName>.Tests.ps1 suite. Standard keeps one root-level ./tests/<Group>.Tests.ps1 suite per public function group, while allowing separately named root-level suites for ungrouped functions and cross-cutting behavior. Advanced is recommended when independent configurations, containers, or ordinary test files should be organized in recursively discovered subdirectories. These are documentation conventions over one filesystem discovery engine, not selectable modes.

Changed: Framework discovery and triggering are explicit

Process-PSModule applies precedence independently in every directory: exactly one *.Configuration.ps1 is selected first and suppresses sibling containers and tests; more than one configuration errors. Otherwise, one or more *.Container.ps1 files are selected and suppress sibling tests. Otherwise, all *.Tests.ps1 files are selected. Layouts may mix across directories because child directories are inspected independently.

Every discovered artifact needs a unique prefix before its first dot because that prefix becomes TestName. Only root tests/BeforeAll.ps1 and tests/AfterAll.ps1 are special workflow phases. .github/PSModule.yml exposes no profile, layout, or suite-matrix selector; Settings.Test.Module.Suites is computed internally from module-local files.

Recursive discovery is separate from important-file triggering. The default ImportantFilePatterns match only ^src/ and ^README\.md$, so test-only changes do not enter the important-change build, test, and publish path unless a repository adds ^tests/ and any relevant settings or workflow paths while retaining the defaults it still needs.


Technical details
  • Adds the general PowerShell test profile guidance under src/docs/Coding-Standards/PowerShell/Testing.md and links it from the generated index and site navigation.
  • Keeps exact recursive discovery precedence, sibling suppression, unique naming, and root-only phase mechanics in Process-PSModule framework documentation.
  • Aligns Process-PSModule repository structure, pipeline stages, usage, and configuration pages with recursive module-local discovery.
  • Marks internal *.Suites matrices as computed workflow outputs rather than authorable settings.
  • Documents that test-only changes require ^tests/ in ImportantFilePatterns to trigger the important-change path and shows settings/workflow path examples.
Relevant issues (or links)
  • No linked issue — implementation was explicitly requested by the release integration session.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@MariusStorhaug Marius Storhaug (MariusStorhaug) changed the title 📖 [Docs]: PowerShell module test layouts now distinguish Simple and Standard 📖 [Docs]: PowerShell module test profiles now match recursive discovery Jul 26, 2026
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Docs NoRelease No release required

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant