Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 7, 2026

The Test-PSModule framework runs style and standards tests against source code (e.g., enforcing one function per file, requiring CmdletBinding attributes). Users needed guidance on skipping specific tests per-file when framework rules don't apply.

Changes

  • New documentation section "Skipping Individual Framework Tests" added to README
    • Syntax: #SkipTest:<TestID>:<Reason> comment at file top
    • Complete reference table of 10 SourceCode test IDs with descriptions
    • Module test overview (import/manifest validation)
    • Code example demonstrating skip usage
    • Best practices and configuration cross-references

Available Test IDs

Test ID What It Enforces
NumberOfProcessors Use [System.Environment]::ProcessorCount not $env:NUMBER_OF_PROCESSORS
Verbose Don't pass -Verbose to commands (overrides user preference)
OutNull Use $null = ... not | Out-Null
FunctionCount One function per file
FunctionName Filename matches function name
CmdletBinding All functions have [CmdletBinding()]
ParamBlock All functions have param() block
FunctionTest Public functions have tests

Example

#SkipTest:FunctionCount:Contains helper functions for main function

function Get-ComplexData {
    [CmdletBinding()]
    param([string]$Path)
    
    $data = Get-RawData -Path $Path
    return Format-ComplexData -Data $data
}

function Get-RawData { ... }
function Format-ComplexData { ... }

Based on analysis of Test-PSModule framework tests.

Original prompt

This section details on the original issue you should resolve

<issue_title>🩹 [Patch]: Add doc for how to skip framework (PSModule) tests</issue_title>
<issue_description>### Describe the change

Based on the code in PSModule/Test-PSModule, we need to recreate guidance in the readme on Process-PSModule for how users can skip individual tests from the framework, i.e. number of functions to have in a file.</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 3 commits January 7, 2026 00:07
Co-authored-by: MariusStorhaug <17722253+MariusStorhaug@users.noreply.github.com>
Co-authored-by: MariusStorhaug <17722253+MariusStorhaug@users.noreply.github.com>
…s in example

Co-authored-by: MariusStorhaug <17722253+MariusStorhaug@users.noreply.github.com>
Copilot AI changed the title [WIP] Add documentation for skipping framework tests Add documentation for skipping individual PSModule framework tests Jan 7, 2026
Copilot AI requested a review from MariusStorhaug January 7, 2026 00:14
@MariusStorhaug MariusStorhaug marked this pull request as ready for review January 7, 2026 00:25
@MariusStorhaug MariusStorhaug requested a review from a team as a code owner January 7, 2026 00:25
Copilot AI review requested due to automatic review settings January 7, 2026 00:25
@MariusStorhaug MariusStorhaug enabled auto-merge (squash) January 7, 2026 00:27
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds comprehensive documentation for skipping individual PSModule framework tests on a per-file basis. Users can now add #SkipTest:<TestID>:<Reason> comments to skip specific tests when framework rules don't apply to particular files.

  • New documentation section with syntax, complete test reference table, and examples
  • Documents 10 SourceCode test IDs with descriptions and skip comment examples
  • Includes best practices and links to broader configuration options

@MariusStorhaug MariusStorhaug merged commit 3dcca81 into main Jan 7, 2026
71 of 73 checks passed
@MariusStorhaug MariusStorhaug deleted the copilot/add-docs-for-skipping-tests branch January 7, 2026 00:31
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.

🩹 [Patch]: Add doc for how to skip framework (PSModule) tests

2 participants