From bf144f61fde04d2f29dd52d84f25e931cea67fd8 Mon Sep 17 00:00:00 2001 From: Chenjie Shi Date: Sun, 24 Apr 2022 15:01:54 +0800 Subject: [PATCH] fix: wrong test output name (#17720) --- eng/scripts/MgmtTestLib.ps1 | 4 ++-- eng/scripts/automation/Invoke-MockTest.ps1 | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/scripts/MgmtTestLib.ps1 b/eng/scripts/MgmtTestLib.ps1 index 1635d41233ee..5b26b9863621 100644 --- a/eng/scripts/MgmtTestLib.ps1 +++ b/eng/scripts/MgmtTestLib.ps1 @@ -309,9 +309,9 @@ function TestAndGenerateReport($dir) $Env:AZURE_PASSWORD = "mock-test" # do test with corage report and convert to cobertura format - Write-Host "go cmd: go test -v -coverprofile coverage.txt | Tee-Object -FilePath output.txt" + Write-Host "go cmd: go test -v -coverprofile coverage.txt | Tee-Object -FilePath outfile.txt" go test -v -coverprofile coverage.txt | Tee-Object -FilePath outfile.txt - Write-Host "report.xml: Get-Content output.txt | go-junit-report > report.xml" + Write-Host "report.xml: Get-Content outfile.txt | go-junit-report > report.xml" Get-Content outfile.txt | go-junit-report > report.xml Write-Host "coverage.json: gocov convert ./coverage.txt > ./coverage.json" gocov convert ./coverage.txt > ./coverage.json diff --git a/eng/scripts/automation/Invoke-MockTest.ps1 b/eng/scripts/automation/Invoke-MockTest.ps1 index b6bd0f4a49ee..b6b7e948930a 100644 --- a/eng/scripts/automation/Invoke-MockTest.ps1 +++ b/eng/scripts/automation/Invoke-MockTest.ps1 @@ -34,7 +34,7 @@ $sdk = Get-GoModuleProperties $packageFolder ExecuteSingleTest $sdk $runLocalMockServer TestAndGenerateReport $packageFolder -$testoutputFile = Join-Path $packageFolder output.txt +$testoutputFile = Join-Path $packageFolder outfile.txt $all = (Select-String -Path $testoutputFile -Pattern "=== RUN").Matches.length $pass = (Select-String -Path $testoutputFile -Pattern "--- PASS").Matches.length $fail = (Select-String -Path $testoutputFile -Pattern "--- FAIL").Matches.length