diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..477d176a --- /dev/null +++ b/.gitattributes @@ -0,0 +1,4 @@ +# Need to make sure that this file always has consistent line endings since we store the hash +# of it in GitHubConfiguration.ps1 in order to be able to determine if it has been modified +# or not. +Tests/Config/Settings.ps1 text eol=crlf \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e62fffd8..1cf400fa 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -295,7 +295,7 @@ This module supports testing using the [Pester UT framework](https://github.com/ To install it: ```powershell -Install-Module -Name Pester +Install-Module -Name Pester -RequiredVersion 4.10.1 -AllowClobber -SkipPublisherCheck -Force ``` #### Configuring Your Environment diff --git a/Tests/GitHubContents.tests.ps1 b/Tests/GitHubContents.tests.ps1 index 554ce61b..474d4f1d 100644 --- a/Tests/GitHubContents.tests.ps1 +++ b/Tests/GitHubContents.tests.ps1 @@ -22,7 +22,7 @@ try # Need two separate blocks to set constants because we need to reference a constant from the first block in this block. @{ - htmlOutput = "

$repoGuid

" + htmlOutput = "

$repoGuid

" rawOutput = "# $repoGuid" }.GetEnumerator() | ForEach-Object { Set-Variable -Force -Scope Script -Option ReadOnly -Visibility Private -Name $_.Key -Value $_.Value diff --git a/build/pipelines/azure-pipelines.ci.yaml b/build/pipelines/azure-pipelines.ci.yaml index d294cc72..9adc9f1a 100644 --- a/build/pipelines/azure-pipelines.ci.yaml +++ b/build/pipelines/azure-pipelines.ci.yaml @@ -30,13 +30,17 @@ jobs: - job: Linux pool: vmImage: 'ubuntu-16.04' + dependsOn: Windows # Run in series instead of parallel because the UT's are modifying the same shared state steps: + - template: ./templates/verify-testConfigSettingsHash.yaml - template: ./templates/run-staticAnalysis.yaml - template: ./templates/run-unitTests.yaml - job: macOS pool: vmImage: 'macOS-10.14' + dependsOn: Linux # Run in series instead of parallel because the UT's are modifying the same shared state steps: + - template: ./templates/verify-testConfigSettingsHash.yaml - template: ./templates/run-staticAnalysis.yaml - template: ./templates/run-unitTests.yaml diff --git a/build/pipelines/templates/run-unitTests.yaml b/build/pipelines/templates/run-unitTests.yaml index 58b83298..53d64828 100644 --- a/build/pipelines/templates/run-unitTests.yaml +++ b/build/pipelines/templates/run-unitTests.yaml @@ -15,17 +15,18 @@ steps: - powershell: | - Install-Module -Name Pester -Repository PSGallery -Scope CurrentUser -AllowClobber -SkipPublisherCheck -Force -Verbose + Install-Module -Name Pester -Repository PSGallery -Scope CurrentUser -AllowClobber -SkipPublisherCheck -RequiredVersion 4.10.1 -Force -Verbose displayName: 'Install Pester' - powershell: | + $null = New-Item -Path ..\ -Name Pester -ItemType Directory -Force Invoke-Pester -CodeCoverage .\*.ps*1 -CodeCoverageOutputFile ../Pester/coverage.xml -CodeCoverageOutputFileFormat JaCoCo -EnableExit -Strict -OutputFile ../Pester/test-results.xml -OutputFormat NUnitXml workingDirectory: '$(System.DefaultWorkingDirectory)' displayName: 'Run Unit Tests via Pester' env: ciAccessToken: $(GitHubAccessToken) ciOwnerName: $(GitHubOwnerName) - ciOrganizatioName: $(GitHubOrganizationName) + ciOrganizationName: $(GitHubOrganizationName) - task: PublishTestResults@2 displayName: 'Publish Test Results'