Skip to content

Commit

Permalink
references changed to Integration
Browse files Browse the repository at this point in the history
  • Loading branch information
techthoughts2 committed Dec 8, 2023
1 parent 1737170 commit d3f9f02
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 25 deletions.
1 change: 1 addition & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
45 changes: 20 additions & 25 deletions src/pwshCloudCommands.build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
- DevCC
- CreateHelpStart
- Build
- InfraTest
- IntegrationTest
- Archive
.EXAMPLE
Invoke-Build
Expand All @@ -23,7 +23,7 @@
This will perform only the Analyze and Test Add-BuildTasks.
.NOTES
This build will pull in configurations from the "<module>.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 "<module>.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.
Expand Down Expand Up @@ -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
Expand All @@ -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 {
Expand All @@ -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'
Expand All @@ -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.
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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'
Expand Down Expand Up @@ -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
Expand All @@ -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)
Expand All @@ -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)

Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand All @@ -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 {
Expand Down

0 comments on commit d3f9f02

Please sign in to comment.