Skip to content

Commit

Permalink
windows: fix test reporting in CircleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
dil-spayne committed Oct 20, 2020
1 parent 1e4198b commit c6bba2f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions .circleci/config.yml
Expand Up @@ -70,7 +70,7 @@ jobs:
command: |
choco install golang --version=1.15.2 -y
choco install postgresql12 --params '/Password:postgres' -y
mkdir -p $Env:TEST_RESULTS
New-Item -ItemType Directory -Force -Path $Env:TEST_RESULTS
- run:
name: Run Tests
Expand All @@ -81,8 +81,12 @@ jobs:
$Env:GO111MODULE=$go111module
git config --global user.email "circleci-baurtest@example.com"
git config --global user.name "baur"
try { go test --tags=dbtest -v -timeout 5m .\... | Tee-Object -FilePath $Env:TEST_RESULTS\go-test.out } `
finally { Get-Content -Path $Env:TEST_RESULTS\go-test.out | go-junit-report > $Env:TEST_RESULTS\go-test-report.xml }
$testResultDir = Resolve-Path $Env:TEST_RESULTS
$testOutputPath = Join-Path $testResultDir "go-test.out"
$testReportPath = Join-Path $testResultDir "go-test-report.xml"
try { go test --tags=dbtest -v -timeout 5m .\... | Tee-Object -FilePath $testOutputPath } `
finally { Get-Content -Path $testOutputPath | go-junit-report > $testReportPath; `
[System.Io.File]::ReadAllText($testReportPath) | Out-File -FilePath $testReportPath -Encoding utf8 }
- store_test_results:
path: ~\test-results
Expand Down

0 comments on commit c6bba2f

Please sign in to comment.