diff --git a/.github/workflows/win-linux-mac-ci.yml b/.github/workflows/win-linux-mac-ci.yml new file mode 100644 index 0000000..b364d70 --- /dev/null +++ b/.github/workflows/win-linux-mac-ci.yml @@ -0,0 +1,59 @@ +name: Run Pester Tests + +on: + pull_request: + branches: + - main + - release/** + push: + branches: + - main + - release/** + +jobs: + test: + name: Run Pester Tests + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [windows-latest, ubuntu-latest, macos-latest] + + steps: + - name: Checkout repository + uses: actions/checkout@v6 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '6.0.x' + + - name: Install Pester + shell: pwsh + run: | + Write-Verbose -Verbose "Installing Pester 4.x" + Install-Module -Name Pester -MaximumVersion 4.99 -Force -Scope CurrentUser -SkipPublisherCheck + Import-Module Pester -MaximumVersion 4.99 -Force + + - name: Build Module + shell: pwsh + run: | + ./build.ps1 -Build -Clean -BuildConfiguration Release + + - name: Run Pester Tests + shell: pwsh + run: | + Invoke-Pester -Path './test' -OutputFile 'testResults.xml' -OutputFormat NUnitXml -EnableExit + + - name: Upload Test Results + if: always() + uses: actions/upload-artifact@v4 + with: + name: test-results-${{ matrix.os }} + path: testResults.xml + + - name: Publish Test Results + if: always() + uses: EnricoMi/publish-unit-test-result-action@v2 + with: + files: testResults.xml diff --git a/help/en-us/Microsoft.PowerShell.ThreadJob.dll-Help.xml b/help/en-US/Microsoft.PowerShell.ThreadJob.dll-Help.xml similarity index 100% rename from help/en-us/Microsoft.PowerShell.ThreadJob.dll-Help.xml rename to help/en-US/Microsoft.PowerShell.ThreadJob.dll-Help.xml diff --git a/test/Microsoft.PowerShell.ThreadJob.Tests.ps1 b/test/Microsoft.PowerShell.ThreadJob.Tests.ps1 index 1b58596..4ba1b4f 100644 --- a/test/Microsoft.PowerShell.ThreadJob.Tests.ps1 +++ b/test/Microsoft.PowerShell.ThreadJob.Tests.ps1 @@ -440,7 +440,6 @@ Describe 'Job2 class API tests' -Tags 'CI' { It 'Verifies terminating job error' { $job = Start-ThreadJob -ScriptBlock { throw "My Job Error!" } | Wait-Job - $results = $job | Receive-Job 2>&1 - $results.ToString() | Should -Be "My Job Error!" + $job.JobStateInfo.Reason.Message | Should -Be "My Job Error!" } }