Skip to content

Commit

Permalink
[EngSys] display output of go test (Azure#15257)
Browse files Browse the repository at this point in the history
  • Loading branch information
seankane-msft authored and vindicatesociety committed Sep 18, 2021
1 parent a5e6c51 commit 00554b6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions eng/pipelines/templates/steps/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ steps:
$testDirs = (./eng/scripts/get_test_dirs.ps1 -serviceDir $(SCOPE))
foreach ($td in $testDirs) {
pushd $td
Write-Host "##[command]Executing go test -run "^Test" -v -coverprofile coverage.txt $td | go-junit-report -set-exit-code > report.xml"
go test -run "^Test" -v -coverprofile coverage.txt . | go-junit-report -set-exit-code > report.xml
Write-Host "##[command]Executing 'go test -run "^Test" -v -coverprofile coverage.txt .' in $td"
go test -run "^Test" -v -coverprofile coverage.txt . | Tee-Object -FilePath outfile.txt
if ($LASTEXITCODE) { exit $LASTEXITCODE }
cat outfile.txt | go-junit-report > report.xml
# if no tests were actually run (e.g. examples) delete the coverage file so it's omitted from the coverage report
if (Select-String -path ./report.xml -pattern '<testsuites></testsuites>' -simplematch -quiet) {
Write-Host "##[command]Deleting empty coverage file"
Expand Down
2 changes: 1 addition & 1 deletion sdk/postgresql/armpostgresql/go_mod_tidy_hack.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
package armpostgresql

// Necessary for safely adding multi-module repo. See: https://github.com/golang/go/wiki/Modules#is-it-possible-to-add-a-module-to-a-multi-module-repository
import _ "github.com/Azure/azure-sdk-for-go"
import _ "github.com/Azure/azure-sdk-for-go"

0 comments on commit 00554b6

Please sign in to comment.