@@ -39,33 +39,32 @@ Depending on the labels in the pull requests, the [workflow will result in diffe
3939
4040![ Process diagram] ( ./media/Process-PSModule.png )
4141
42-
4342- [ Get settings] ( #get-settings )
44- - Reads the settings file ` github/PSModule.yml ` in the module repository to configure the workflow.
45- - Gathers context for the process from GitHub and the repo files, configuring what tests to run, if and what kind of release to create, and wether
46- to setup testing infrastructure and what operating systems to run the tests on.
47- - [ Build module] ( ./.github/workflows/Build-Module.yml )
43+ - Gathers context from GitHub, the ` github/PSModule.yml ` file and other files in the repository to configure the workflow.
44+ - Outputs the gathered context for use in later steps.
45+ - [ Build module] ( #build-module )
4846 - Compiles the module source code into a PowerShell module.
49- - [ Test source code] ( ./.github/workflows/Test-SourceCode.yml )
50- - Tests the source code in parallel (matrix) using:
47+ - Uploads the built module as an artifact for use in later steps.
48+ - [ Test source code] ( #test-source-code )
49+ - Tests the source code using:
5150 - [ PSModule framework settings for style and standards for source code] ( https://github.com/PSModule/Test-PSModule?tab=readme-ov-file#sourcecode-tests )
52- - This produces a JSON-based report that is used to later evaluate the results of the tests.
51+ - This produces a JSON-based report that is used by [ Get-PesterTestResults ] ( #get-test-results ) evaluate the results of the tests.
5352- [ Lint source code] ( ./.github/workflows/Lint-SourceCode.yml )
5453 - Lints the source code in parallel (matrix) using:
5554 - [ PSScriptAnalyzer rules] ( https://github.com/PSModule/Invoke-ScriptAnalyzer )
56- - This produces a JSON-based report that is used to later evaluate the results of the linter.
55+ - This produces a JSON-based report that is used by [ Get-PesterTestResults ] ( #get-test-results ) evaluate the results of the linter.
5756- [ Framework test] ( ./.github/workflows/Test-Module.yml )
5857 - Tests and lints the module in parallel (matrix) using:
5958 - [ PSModule framework settings for style and standards for modules] ( https://github.com/PSModule/Test-PSModule?tab=readme-ov-file#module-tests )
6059 - [ PSScriptAnalyzer rules] ( https://github.com/PSModule/Invoke-ScriptAnalyzer )
61- - This produces a JSON-based report that is used to later evaluate the results of the tests.
60+ - This produces a JSON-based report that is used by [ Get-PesterTestResults ] ( #get-test-results ) evaluate the results of the tests.
6261- [ Test module] ( ./.github/workflows/Test-ModuleLocal.yml )
6362 - Imports and tests the module in parallel (matrix) using Pester tests from the module repository.
6463 - Supports setup and teardown scripts executed via separate dedicated jobs:
6564 - ` BeforeAll ` : Runs once before all test matrix jobs to set up the test environment (e.g., deploy infrastructure, download test data).
6665 - ` AfterAll ` : Runs once after all test matrix jobs complete to clean up the test environment (e.g., remove test resources, clean up databases).
6766 - Setup/teardown scripts are automatically detected in test directories and executed with the same environment variables as the tests.
68- - This produces a JSON-based report that is used to later evaluate the results of the tests.
67+ - This produces a JSON-based report that is used by [ Get-PesterTestResults ] ( #get-test-results ) evaluate the results of the tests.
6968- [ Get test results] ( ./.github/workflows/Get-TestResults.yml )
7069 - Gathers the test results from the previous steps and creates a summary of the results.
7170 - If any tests have failed, the workflow will fail here.
@@ -109,22 +108,38 @@ Depending on the labels in the pull requests, the [workflow will result in diffe
109108[ workflow] ( ./.github/workflows/Test-SourceCode.yml )
110109 - Tests the source code in parallel (matrix) using:
111110 - [ PSModule framework settings for style and standards for source code] ( https://github.com/PSModule/Test-PSModule?tab=readme-ov-file#sourcecode-tests )
112- - This produces a JSON-based report that is used to later evaluate the results of the tests.
111+ - This produces a JSON-based report that is used by [ Get-PesterTestResults] ( #get-test-results ) evaluate the results of the tests.
112+
113+ The [ PSModule - SourceCode tests] ( ./scripts/tests/SourceCode/PSModule/PSModule.Tests.ps1 ) verifies the following coding practices that the framework enforces:
114+
115+ | ID | Category | Description |
116+ | ---------------------| ---------------------| --------------------------------------------------------------------------------------------|
117+ | NumberOfProcessors | General | Should use ` [System.Environment]::ProcessorCount ` instead of ` $env:NUMBER_OF_PROCESSORS ` . |
118+ | Verbose | General | Should not contain ` -Verbose ` unless it is explicitly disabled with ` :$false ` . |
119+ | OutNull | General | Should use ` $null = ... ` instead of piping output to ` Out-Null ` . |
120+ | NoTernary | General | Should not use ternary operations to maintain compatibility with PowerShell 5.1 and below. |
121+ | LowercaseKeywords | General | All PowerShell keywords should be written in lowercase. |
122+ | FunctionCount | Functions (Generic) | Each script file should contain exactly one function or filter. |
123+ | FunctionName | Functions (Generic) | Script filenames should match the name of the function or filter they contain. |
124+ | CmdletBinding | Functions (Generic) | Functions should include the ` [CmdletBinding()] ` attribute. |
125+ | ParamBlock | Functions (Generic) | Functions should have a parameter block (` param() ` ). |
126+ | FunctionTest | Functions (Public) | All public functions/filters should have corresponding tests. |
127+
113128
114129### Lint source code
115130
116131[ workflow] ( ./.github/workflows/Lint-SourceCode.yml )
117132 - Lints the source code in parallel (matrix) using:
118133 - [ PSScriptAnalyzer rules] ( https://github.com/PSModule/Invoke-ScriptAnalyzer )
119- - This produces a JSON-based report that is used to later evaluate the results of the linter.
134+ - This produces a JSON-based report that is used by [ Get-PesterTestResults ] ( #get-test-results ) evaluate the results of the linter.
120135
121136### Framework test
122137
123138[ workflow] ( ./.github/workflows/Test-Module.yml )
124139 - Tests and lints the module in parallel (matrix) using:
125140 - [ PSModule framework settings for style and standards for modules] ( https://github.com/PSModule/Test-PSModule?tab=readme-ov-file#module-tests )
126141 - [ PSScriptAnalyzer rules] ( https://github.com/PSModule/Invoke-ScriptAnalyzer )
127- - This produces a JSON-based report that is used to later evaluate the results of the tests.
142+ - This produces a JSON-based report that is used by [ Get-PesterTestResults ] ( #get-test-results ) evaluate the results of the tests.
128143
129144### Test module
130145
@@ -134,8 +149,7 @@ Depending on the labels in the pull requests, the [workflow will result in diffe
134149 - ` BeforeAll ` : Runs once before all test matrix jobs to set up the test environment (e.g., deploy infrastructure, download test data).
135150 - ` AfterAll ` : Runs once after all test matrix jobs complete to clean up the test environment (e.g., remove test resources, clean up databases).
136151 - Setup/teardown scripts are automatically detected in test directories and executed with the same environment variables as the tests.
137- - This produces a JSON-based report that is used to later evaluate the results of the tests.
138-
152+ - This produces a JSON-based report that is used by [ Get-PesterTestResults] ( #get-test-results ) evaluate the results of the tests.
139153
140154#### Setup and Teardown Scripts
141155
@@ -179,6 +193,15 @@ Write-Host "Cleanup completed!"
179193```
180194
181195
196+ #### Module tests
197+
198+ The [ PSModule - Module tests] ( ./scripts/tests/Module/PSModule/PSModule.Tests.ps1 ) verifies the following coding practices that the framework enforces:
199+
200+ | Name | Description |
201+ | ------ | ----------- |
202+ | Module Manifest exists | Verifies that a module manifest file is present. |
203+ | Module Manifest is valid | Verifies that the module manifest file is valid. |
204+
182205### Get test results
183206
184207[ workflow] ( ./.github/workflows/Get-TestResults.yml )
0 commit comments