diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 6de2dcdc8..798d6c24a 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -126,18 +126,27 @@ jobs: display_name: "Linux" go_path: '$(go env GOPATH)/bin/' suffix: '' + run_e2e: 'go test -timeout=1h -v ./e2etest | tee test.txt' + save_exit_code: 'exit_code=${PIPESTATUS[0]}' + return_exit_code: 'exit "$exit_code"' Windows: imageName: 'windows-2019' build_name: 'azcopy_windows_amd64.exe' display_name: "Windows" go_path: 'C:\Users\VssAdministrator\go\bin\' suffix: '.exe' + run_e2e: 'go test -timeout=1h -v ./e2etest > test.txt' + save_exit_code: 'set exit_code=%errorlevel%' + return_exit_code: 'exit %exit_code%' MacOS: imageName: 'macos-11' build_name: 'azcopy_darwin_amd64' display_name: "MacOS" go_path: '$(go env GOPATH)/bin/' suffix: '' + run_e2e: 'go test -timeout=1h -v ./e2etest | tee test.txt' + save_exit_code: 'exit_code=${PIPESTATUS[0]}' + return_exit_code: 'exit "$exit_code"' pool: vmImage: $(imageName) @@ -158,13 +167,17 @@ jobs: echo 'Building executable' go build -cover -o $(build_name) echo 'Running tests' - go test -timeout=1h -v ./e2etest 2>&1 | $(go_path)go-junit-report$(suffix) > report.xml + $(run_e2e) + $(save_exit_code) + echo "Generating junit report" + cat test.txt | $(go_path)go-junit-report$(suffix) > report.xml echo 'Formatting coverage directory to legacy txt format' go tool covdata textfmt -i=coverage -o coverage.txt echo 'Formatting coverage to json format' $(go_path)gocov$(suffix) convert coverage.txt > coverage.json echo 'Formatting coverage to xml format' $(go_path)gocov-xml$(suffix) < coverage.json > coverage.xml + $(return_exit_code) env: AZCOPY_E2E_ACCOUNT_KEY: $(AZCOPY_E2E_ACCOUNT_KEY) AZCOPY_E2E_ACCOUNT_NAME: $(AZCOPY_E2E_ACCOUNT_NAME)