From 77779b2df41136c7c72088af4336f5253020a26d Mon Sep 17 00:00:00 2001 From: Pavel Zorin Date: Tue, 17 Oct 2023 15:46:06 +0200 Subject: [PATCH] Propagate exit code on windows --- .buildkite/pipeline.yml | 80 ++++++++++++------------- .buildkite/scripts/steps/unit-tests.ps1 | 8 +++ 2 files changed, 48 insertions(+), 40 deletions(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index e39ff071790..5345c3db34d 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -4,33 +4,33 @@ env: VAULT_PATH: "kv/ci-shared/observability-ingest/cloud/gcp" DOCKER_REGISTRY: "docker.elastic.co" steps: - # - label: "Unit tests - Ubuntu 22.04" - # key: "unit-tests-2204" - # command: ".buildkite/scripts/steps/unit-tests.sh" - # artifact_paths: - # - "build/TEST-**" - # - "build/diagnostics/*" - # agents: - # provider: "gcp" - # image: "family/core-ubuntu-2204" - # retry: - # manual: - # allowed: true + - label: "Unit tests - Ubuntu 22.04" + key: "unit-tests-2204" + command: ".buildkite/scripts/steps/unit-tests.sh" + artifact_paths: + - "build/TEST-**" + - "build/diagnostics/*" + agents: + provider: "gcp" + image: "family/core-ubuntu-2204" + retry: + manual: + allowed: true - # - label: "Unit tests - Ubuntu 22.04 ARM64" - # key: "unit-tests-2204-arm64" - # command: ".buildkite/scripts/steps/unit-tests.sh" - # artifact_paths: - # - "build/TEST-**" - # - "build/diagnostics/*" - # agents: - # provider: "aws" - # imagePrefix: "core-ubuntu-2204-aarch64" - # diskSizeGb: 200 - # instanceType: "m6g.4xlarge" - # retry: - # manual: - # allowed: true + - label: "Unit tests - Ubuntu 22.04 ARM64" + key: "unit-tests-2204-arm64" + command: ".buildkite/scripts/steps/unit-tests.sh" + artifact_paths: + - "build/TEST-**" + - "build/diagnostics/*" + agents: + provider: "aws" + imagePrefix: "core-ubuntu-2204-aarch64" + diskSizeGb: 200 + instanceType: "m6g.4xlarge" + retry: + manual: + allowed: true - label: "Unit tests - Windows 2022" key: "unit-tests-win2022" @@ -64,20 +64,20 @@ steps: manual: allowed: true - # - label: ":sonarqube: Continuous Code Inspection" - # env: - # VAULT_SONAR_TOKEN_PATH: "kv/ci-shared/platform-ingest/elastic/elastic-agent/sonar-analyze-token" - # agents: - # image: "docker.elastic.co/cloud-ci/sonarqube/buildkite-scanner:latest" - # command: - # - "buildkite-agent artifact download build/TEST-go-unit.cov ." - # - "buildkite-agent artifact download build/TEST-go-unit.out.json ." - # - "/scan-source-code.sh" - # depends_on: - # - "unit-tests" - # retry: - # manual: - # allowed: true + - label: ":sonarqube: Continuous Code Inspection" + env: + VAULT_SONAR_TOKEN_PATH: "kv/ci-shared/platform-ingest/elastic/elastic-agent/sonar-analyze-token" + agents: + image: "docker.elastic.co/cloud-ci/sonarqube/buildkite-scanner:latest" + command: + - "buildkite-agent artifact download build/TEST-go-unit.cov ." + - "buildkite-agent artifact download build/TEST-go-unit.out.json ." + - "/scan-source-code.sh" + depends_on: + - "unit-tests" + retry: + manual: + allowed: true # - label: "Integration tests" # key: "integration-tests" diff --git a/.buildkite/scripts/steps/unit-tests.ps1 b/.buildkite/scripts/steps/unit-tests.ps1 index b2e48c156d5..bb2d05f87a3 100644 --- a/.buildkite/scripts/steps/unit-tests.ps1 +++ b/.buildkite/scripts/steps/unit-tests.ps1 @@ -3,6 +3,14 @@ $ErrorActionPreference = "Stop" Write-Host "--- Build" mage build +if ($LASTEXITCODE -ne 0) { + exit 1 +} + Write-Host "--- Unit tests" $env:TEST_COVERAGE = $true mage unitTest + +if ($LASTEXITCODE -ne 0) { + exit 1 +}