diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 4df07cb..43214b7 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - updated actions from `v2` to `v3` - Moved CHANGELOG from `.github` to `docs` - `actions_bootstrap.ps1` - bumped module versions to latest + - All Infra/Infrastructure references changed to Integration - Misc - Updated README to reference new badge urls for Github actions - Updated `settings.json` for tab requirements to support Readthedocs diff --git a/src/Tests/Infrastructure/pwshCloudCommands.Infra.Tests.ps1 b/src/Tests/Integration/pwshCloudCommands.Infra.Tests.ps1 similarity index 100% rename from src/Tests/Infrastructure/pwshCloudCommands.Infra.Tests.ps1 rename to src/Tests/Integration/pwshCloudCommands.Infra.Tests.ps1 diff --git a/src/pwshCloudCommands.build.ps1 b/src/pwshCloudCommands.build.ps1 index 56a4bdf..704e495 100644 --- a/src/pwshCloudCommands.build.ps1 +++ b/src/pwshCloudCommands.build.ps1 @@ -12,7 +12,7 @@ - DevCC - CreateHelpStart - Build - - InfraTest + - IntegrationTest - Archive .EXAMPLE Invoke-Build @@ -23,7 +23,7 @@ This will perform only the Analyze and Test Add-BuildTasks. .NOTES - This build will pull in configurations from the ".Settings.ps1" file as well, where users can more easily customize the build process if required. + This build file by Catesta will pull in configurations from the ".Settings.ps1" file as well, where users can more easily customize the build process if required. https://github.com/nightroman/Invoke-Build https://github.com/nightroman/Invoke-Build/wiki/Build-Scripts-Guidelines If using VSCode you can use the generated tasks.json to execute the various tasks in this build file. @@ -53,7 +53,7 @@ $str += 'Analyze', 'Test' $str += 'CreateHelpStart' $str2 = $str $str2 += 'Build', 'Archive' -$str += 'Build', 'InfraTest', 'Archive' +$str += 'Build', 'IntegrationTest', 'Archive' Add-BuildTask -Name . -Jobs $str #Local testing build process @@ -62,8 +62,8 @@ Add-BuildTask TestLocal Clean, ImportModuleManifest, Analyze, Test #Local help file creation process Add-BuildTask HelpLocal Clean, ImportModuleManifest, CreateHelpStart -#Full build sans infra tests -Add-BuildTask BuildNoInfra -Jobs $str2 +#Full build sans integration tests +Add-BuildTask BuildNoIntegration -Jobs $str2 # Pre-build variables to be used by other portions of the script Enter-Build { @@ -82,7 +82,7 @@ Enter-Build { $script:TestsPath = Join-Path -Path $BuildRoot -ChildPath 'Tests' $script:UnitTestsPath = Join-Path -Path $script:TestsPath -ChildPath 'Unit' - $script:InfraTestsPath = Join-Path -Path $script:TestsPath -ChildPath 'Infrastructure' + $script:IntegrationTestsPath = Join-Path -Path $script:TestsPath -ChildPath 'Integration' $script:ArtifactsPath = Join-Path -Path $BuildRoot -ChildPath 'Artifacts' $script:ArchivePath = Join-Path -Path $BuildRoot -ChildPath 'Archive' @@ -92,9 +92,9 @@ Enter-Build { # Ensure our builds fail until if below a minimum defined code test coverage threshold $script:coverageThreshold = 95 - [version]$script:MinPesterVersion = '5.2.2' [version]$script:MaxPesterVersion = '5.99.99' + $script:testOutputFormat = 'NUnitXML' } #Enter-Build # Define headers as separator, task path, synopsis, and location, e.g. for Ctrl+Click in VSCode. @@ -133,7 +133,7 @@ Add-BuildTask TestModuleManifest -Before ImportModuleManifest { Assert-Build (Test-Path $script:ModuleManifestFile) 'Unable to locate the module manifest file.' Assert-Build (Test-ManifestBool -Path $script:ModuleManifestFile) 'Module Manifest test did not pass verification.' Write-Build Green ' ...Module Manifest Verification Complete!' -} +} #f5b33218-bde4-4028-b2a1-9c206f089503 # Synopsis: Load the module project Add-BuildTask ImportModuleManifest { @@ -185,7 +185,6 @@ Add-BuildTask Analyze { Add-BuildTask AnalyzeTests -After Analyze { if (Test-Path -Path $script:TestsPath) { - $scriptAnalyzerParams = @{ Path = $script:TestsPath Setting = 'PSScriptAnalyzerSettings.psd1' @@ -247,8 +246,7 @@ Add-BuildTask Test { New-Item -Path $testOutPutPath -ItemType Directory | Out-Null } if (Test-Path -Path $script:UnitTestsPath) { - - $pesterConfiguration = [PesterConfiguration]::new() + $pesterConfiguration = New-PesterConfiguration $pesterConfiguration.run.Path = $script:UnitTestsPath $pesterConfiguration.Run.PassThru = $true $pesterConfiguration.Run.Exit = $false @@ -259,11 +257,11 @@ Add-BuildTask Test { $pesterConfiguration.CodeCoverage.OutputFormat = 'JaCoCo' $pesterConfiguration.TestResult.Enabled = $true $pesterConfiguration.TestResult.OutputPath = "$testOutPutPath\PesterTests.xml" - $pesterConfiguration.TestResult.OutputFormat = 'NUnitXml' + $pesterConfiguration.TestResult.OutputFormat = $script:testOutputFormat $pesterConfiguration.Output.Verbosity = 'Detailed' Write-Build White ' Performing Pester Unit Tests...' - # Publish Test Results as NUnitXml + # Publish Test Results $testResults = Invoke-Pester -Configuration $pesterConfiguration # This will output a nice json for each failed test (if running in CodeBuild) @@ -278,7 +276,6 @@ Add-BuildTask Test { $numberFails = $testResults.FailedCount Assert-Build($numberFails -eq 0) ('Failed "{0}" unit tests.' -f $numberFails) - Write-Build Gray (' ...CODE COVERAGE - CommandsExecutedCount: {0}' -f $testResults.CodeCoverage.CommandsExecutedCount) Write-Build Gray (' ...CODE COVERAGE - CommandsAnalyzedCount: {0}' -f $testResults.CodeCoverage.CommandsAnalyzedCount) @@ -313,8 +310,7 @@ Add-BuildTask DevCC { Write-Build White " Importing desired Pester version. Min: $script:MinPesterVersion Max: $script:MaxPesterVersion" Remove-Module -Name Pester -Force -ErrorAction SilentlyContinue # there are instances where some containers have Pester already in the session Import-Module -Name Pester -MinimumVersion $script:MinPesterVersion -MaximumVersion $script:MaxPesterVersion -ErrorAction 'Stop' - - $pesterConfiguration = [PesterConfiguration]::new() + $pesterConfiguration = New-PesterConfiguration $pesterConfiguration.run.Path = $script:UnitTestsPath $pesterConfiguration.CodeCoverage.Enabled = $true $pesterConfiguration.CodeCoverage.Path = "$PSScriptRoot\$ModuleName\*\*.ps1" @@ -496,18 +492,17 @@ Add-BuildTask Build { Write-Build Green ' ...Build Complete!' } #Build -#Synopsis: Invokes all Pester Infrastructure Tests in the Tests\Infrastructure folder (if it exists) -Add-BuildTask InfraTest { - if (Test-Path -Path $script:InfraTestsPath) { +#Synopsis: Invokes all Pester Integration Tests in the Tests\Integration folder (if it exists) +Add-BuildTask IntegrationTest { + if (Test-Path -Path $script:IntegrationTestsPath) { Write-Build White " Importing desired Pester version. Min: $script:MinPesterVersion Max: $script:MaxPesterVersion" Remove-Module -Name Pester -Force -ErrorAction SilentlyContinue # there are instances where some containers have Pester already in the session Import-Module -Name Pester -MinimumVersion $script:MinPesterVersion -MaximumVersion $script:MaxPesterVersion -ErrorAction 'Stop' - Write-Build White " Performing Pester Infrastructure Tests in $($invokePesterParams.path)" - + Write-Build White " Performing Pester Integration Tests in $($invokePesterParams.path)" - $pesterConfiguration = [PesterConfiguration]::new() - $pesterConfiguration.run.Path = $script:InfraTestsPath + $pesterConfiguration = New-PesterConfiguration + $pesterConfiguration.run.Path = $script:IntegrationTestsPath $pesterConfiguration.Run.PassThru = $true $pesterConfiguration.Run.Exit = $false $pesterConfiguration.CodeCoverage.Enabled = $false @@ -526,9 +521,9 @@ Add-BuildTask InfraTest { $numberFails = $testResults.FailedCount Assert-Build($numberFails -eq 0) ('Failed "{0}" unit tests.' -f $numberFails) - Write-Build Green ' ...Pester Infrastructure Tests Complete!' + Write-Build Green ' ...Pester Integration Tests Complete!' } -} #InfraTest +} #IntegrationTest #Synopsis: Creates an archive of the built Module Add-BuildTask Archive {