From 1d23d9bda995a2c634f93cf0b352d9f4985ddf18 Mon Sep 17 00:00:00 2001 From: Pavel Zorin Date: Tue, 11 Jun 2024 12:15:27 +0200 Subject: [PATCH 01/17] [CI] Monorepo diff plugin for integration tests --- .buildkite/integration.pipeline.yml | 70 +++++++++++++++-------------- .buildkite/pipeline.yml | 43 ++++++++++++++++++ .buildkite/pull-requests.json | 17 ------- 3 files changed, 80 insertions(+), 50 deletions(-) diff --git a/.buildkite/integration.pipeline.yml b/.buildkite/integration.pipeline.yml index 37b4c2d1d25..65709bd882d 100644 --- a/.buildkite/integration.pipeline.yml +++ b/.buildkite/integration.pipeline.yml @@ -7,67 +7,71 @@ env: steps: - label: "Serverless integration test" key: "serverless-integration-tests" - concurrency_group: elastic-agent-extended-testing/serverless-integration - concurrency: 8 + # concurrency_group: elastic-agent-extended-testing/serverless-integration + # concurrency: 8 env: # we run each step in a different data center to spread the load TEST_INTEG_AUTH_GCP_DATACENTER: "us-central1-a" - command: ".buildkite/scripts/steps/integration_tests.sh serverless integration:single TestLogIngestionFleetManaged" #right now, run a single test in serverless mode as a sort of smoke test, instead of re-running the entire suite - artifact_paths: - - "build/TEST-**" - - "build/diagnostics/*" - agents: - provider: "gcp" - machineType: "n1-standard-8" + # command: ".buildkite/scripts/steps/integration_tests.sh serverless integration:single TestLogIngestionFleetManaged" #right now, run a single test in serverless mode as a sort of smoke test, instead of re-running the entire suite + command: "echo 'serverless'" + # artifact_paths: + # - "build/TEST-**" + # - "build/diagnostics/*" + # agents: + # provider: "gcp" + # machineType: "n1-standard-8" notify: - github_commit_status: context: "buildkite/elastic-agent-extended-testing - Serverless integration test" - label: "Extended runtime leak tests" key: "extended-integration-tests" - concurrency_group: elastic-agent-extended-testing/leak-tests - concurrency: 8 + # concurrency_group: elastic-agent-extended-testing/leak-tests + # concurrency: 8 env: TEST_INTEG_AUTH_GCP_DATACENTER: "us-central1-b" - command: ".buildkite/scripts/steps/integration_tests.sh stateful integration:TestForResourceLeaks" - artifact_paths: - - "build/TEST-**" - - "build/diagnostics/*" - agents: - provider: "gcp" - machineType: "n1-standard-8" + # command: ".buildkite/scripts/steps/integration_tests.sh stateful integration:TestForResourceLeaks" + command: "echo 'leak'" + # artifact_paths: + # - "build/TEST-**" + # - "build/diagnostics/*" + # agents: + # provider: "gcp" + # machineType: "n1-standard-8" notify: - github_commit_status: context: "buildkite/elastic-agent-extended-testing - Extended runtime leak tests" - label: "Integration tests" key: "integration-tests" - concurrency_group: elastic-agent-extended-testing/integration - concurrency: 8 + # concurrency_group: elastic-agent-extended-testing/integration + # concurrency: 8 env: TEST_INTEG_AUTH_GCP_DATACENTER: "us-central1-f" - command: ".buildkite/scripts/steps/integration_tests.sh stateful" - artifact_paths: - - "build/TEST-**" - - "build/diagnostics/*" - agents: - provider: "gcp" - machineType: "n1-standard-8" + # command: ".buildkite/scripts/steps/integration_tests.sh stateful" + command: "echo 'it'" + # artifact_paths: + # - "build/TEST-**" + # - "build/diagnostics/*" + # agents: + # provider: "gcp" + # machineType: "n1-standard-8" notify: - github_commit_status: context: "buildkite/elastic-agent-extended-testing - Integration tests" - label: "Serverless Beats Tests" key: "serverless-beats-integration-tests" - concurrency_group: elastic-agent-extended-testing/beats-integration - concurrency: 8 + # concurrency_group: elastic-agent-extended-testing/beats-integration + # concurrency: 8 env: TEST_INTEG_AUTH_GCP_DATACENTER: "us-central1-a" - command: ".buildkite/scripts/steps/beats_tests.sh" + # command: ".buildkite/scripts/steps/beats_tests.sh" + command: "echo 'serverless beats'" # if: "build.env('CRON') == 'yes'" - agents: - provider: "gcp" - machineType: "n1-standard-8" + # agents: + # provider: "gcp" + # machineType: "n1-standard-8" retry: manual: allowed: true diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 6c73bf31c09..6cfe81d026b 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -232,3 +232,46 @@ steps: image: "family/core-ubuntu-2204" env: - GH_VERSION=2.4.0 + + # Trigger for pull requests + - label: "Trigger Integration tests" + if: | + (build.pull_request.id != null && !build.pull_request.draft && build.pull_request.labels !includes "skip-it") || + env("GITHUB_PR_TRIGGER_COMMENT") ~= /extended/ + plugins: + - monorepo-diff#v1.0.1: + diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD" + watch: + - path: + - internal/ + - dev-tools/ + - pkg/ + - testing/ + - .agent-versions.json + - .go-version + - .package-version + - go.mod + - magefile.go + - main.go + + - .buildkite/integration.pipeline.yml + - .buildkite/scripts/ + - .buildkite/hooks/ + + config: + trigger: "elastic-agent-extended-testing" + build: + commit: "${BUILDKITE_COMMIT}" + branch: "${BUILDKITE_BRANCH}" + env: + - BUILDKITE_PULL_REQUEST=${BUILDKITE_PULL_REQUEST} + - BUILDKITE_PULL_REQUEST_BASE_BRANCH=${BUILDKITE_PULL_REQUEST_BASE_BRANCH} + - GITHUB_PR_LABELS=${GITHUB_PR_LABELS} + + # Trigger for branches + - label: "Triggering Integration tests" + if: build.pull_request.id == null + trigger: "elastic-agent-extended-testing" + build: + commit: "${BUILDKITE_COMMIT}" + branch: "${BUILDKITE_BRANCH}" diff --git a/.buildkite/pull-requests.json b/.buildkite/pull-requests.json index 607d70ac9ea..6495b79054d 100644 --- a/.buildkite/pull-requests.json +++ b/.buildkite/pull-requests.json @@ -16,23 +16,6 @@ "skip_ci_on_only_changed": [ "^.ci/", "^changelog", "^docs/", "\\.md$", "^docker-compose.yml", "^.pre-commit-config.yaml", "skaffold.yaml", "^Dockerfile.skaffold", "^Dockerfile"], "always_require_ci_on_changed": [ ] }, - { - "enabled": true, - "build_drafts": false, - "pipelineSlug": "elastic-agent-extended-testing", - "allow_org_users": true, - "allowed_repo_permissions": ["admin", "write"], - "allowed_list": ["dependabot[bot]", "mergify[bot]", "github-actions[bot]"], - "set_commit_status": true, - "build_on_commit": true, - "build_on_comment": true, - "trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:build|test)\\W+(?:extended))|^/test extended$", - "always_trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:build|test)\\W+(?:extended))|^/test extended$", - "skip_ci_labels": [ "skip-ci", "skip-it" ], - "skip_target_branches": [ ], - "skip_ci_on_only_changed": [ "^.ci/", "^changelog", "^docs/", "\\.md$", "^sonar-project.properties", "^docker-compose.yml", "^.pre-commit-config.yaml", "skaffold.yaml", "^Dockerfile.skaffold", "^Dockerfile"], - "always_require_ci_on_changed": [ ] - }, { "enabled": true, "pipelineSlug": "elastic-agent-package", From 67371c996c2d1c84d208207853fc04d0d3ef7c14 Mon Sep 17 00:00:00 2001 From: Pavel Zorin Date: Tue, 11 Jun 2024 12:44:24 +0200 Subject: [PATCH 02/17] [CI] Monorepo diff plugin for integration tests --- .buildkite/pipeline.yml | 2 +- .buildkite/pull-requests.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 6cfe81d026b..c8ffd838db7 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -236,7 +236,7 @@ steps: # Trigger for pull requests - label: "Trigger Integration tests" if: | - (build.pull_request.id != null && !build.pull_request.draft && build.pull_request.labels !includes "skip-it") || + (build.pull_request.id != null && !build.pull_request.draft && !(build.pull_request.labels includes "skip-it")) || env("GITHUB_PR_TRIGGER_COMMENT") ~= /extended/ plugins: - monorepo-diff#v1.0.1: diff --git a/.buildkite/pull-requests.json b/.buildkite/pull-requests.json index 6495b79054d..3da0d4d696c 100644 --- a/.buildkite/pull-requests.json +++ b/.buildkite/pull-requests.json @@ -9,8 +9,8 @@ "set_commit_status": true, "build_on_commit": true, "build_on_comment": true, - "trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:build|test)\\W+(?:this|it))|^/test$", - "always_trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:build|test)\\W+(?:this|it))|^/test$", + "trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:build|test)\\W+(?:this|it|extended))|^/test (?:extended)$", + "always_trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:build|test)\\W+(?:this|it|extended))|^/test (?:extended)$", "skip_ci_labels": [ "skip-ci" ], "skip_target_branches": [ ], "skip_ci_on_only_changed": [ "^.ci/", "^changelog", "^docs/", "\\.md$", "^docker-compose.yml", "^.pre-commit-config.yaml", "skaffold.yaml", "^Dockerfile.skaffold", "^Dockerfile"], From fa97159f8c5cdf7e934d0a9b117757925e7b2e13 Mon Sep 17 00:00:00 2001 From: Pavel Zorin Date: Tue, 11 Jun 2024 12:55:56 +0200 Subject: [PATCH 03/17] [CI] Monorepo diff plugin for integration tests --- .buildkite/pipeline.yml | 2 +- .buildkite/pull-requests.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index c8ffd838db7..15e89dcb192 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -237,7 +237,7 @@ steps: - label: "Trigger Integration tests" if: | (build.pull_request.id != null && !build.pull_request.draft && !(build.pull_request.labels includes "skip-it")) || - env("GITHUB_PR_TRIGGER_COMMENT") ~= /extended/ + env("GITHUB_PR_TRIGGER_COMMENT") =~ /extended/ plugins: - monorepo-diff#v1.0.1: diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD" diff --git a/.buildkite/pull-requests.json b/.buildkite/pull-requests.json index 3da0d4d696c..aa2a117e039 100644 --- a/.buildkite/pull-requests.json +++ b/.buildkite/pull-requests.json @@ -9,8 +9,8 @@ "set_commit_status": true, "build_on_commit": true, "build_on_comment": true, - "trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:build|test)\\W+(?:this|it|extended))|^/test (?:extended)$", - "always_trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:build|test)\\W+(?:this|it|extended))|^/test (?:extended)$", + "trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:build|test)\\W+(?:this|it|extended))|^/test\\W*(?:extended|)", + "always_trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:build|test)\\W+(?:this|it|extended))|^/test\\W*(?:extended|)", "skip_ci_labels": [ "skip-ci" ], "skip_target_branches": [ ], "skip_ci_on_only_changed": [ "^.ci/", "^changelog", "^docs/", "\\.md$", "^docker-compose.yml", "^.pre-commit-config.yaml", "skaffold.yaml", "^Dockerfile.skaffold", "^Dockerfile"], From 14d794cb5943f2b2a53459a96ba0c0f31045aa82 Mon Sep 17 00:00:00 2001 From: Pavel Zorin Date: Tue, 11 Jun 2024 13:39:48 +0200 Subject: [PATCH 04/17] [CI] Monorepo diff plugin for integration tests --- .buildkite/pipeline.yml | 440 ++++++++++++++++++++-------------------- 1 file changed, 220 insertions(+), 220 deletions(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 15e89dcb192..bdc317ce4a8 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -4,237 +4,237 @@ env: VAULT_PATH: "kv/ci-shared/observability-ingest/cloud/gcp" DOCKER_REGISTRY: "docker.elastic.co" steps: - - label: "check-ci" - key: "check-ci" - command: ".buildkite/scripts/steps/check-ci.sh" - agents: - provider: "gcp" - image: "family/core-ubuntu-2204" - retry: - manual: - allowed: true - - group: "Unit tests" - key: "unit-tests" - steps: - - label: "Unit tests - Ubuntu 22.04" - key: "unit-tests-2204" - command: ".buildkite/scripts/steps/unit-tests.sh" - artifact_paths: - - "build/TEST-go-unit.html" - - "build/TEST-go-unit.xml" - - "build/diagnostics/*" - - "coverage.out" - agents: - provider: "gcp" - image: "family/core-ubuntu-2204" - retry: - manual: - allowed: true + # - label: "check-ci" + # key: "check-ci" + # command: ".buildkite/scripts/steps/check-ci.sh" + # agents: + # provider: "gcp" + # image: "family/core-ubuntu-2204" + # retry: + # manual: + # allowed: true + # - group: "Unit tests" + # key: "unit-tests" + # steps: + # - label: "Unit tests - Ubuntu 22.04" + # key: "unit-tests-2204" + # command: ".buildkite/scripts/steps/unit-tests.sh" + # artifact_paths: + # - "build/TEST-go-unit.html" + # - "build/TEST-go-unit.xml" + # - "build/diagnostics/*" + # - "coverage.out" + # 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-go-unit.html" - - "build/TEST-go-unit.xml" - - "build/diagnostics/*" - - "coverage.out" - agents: - provider: "aws" - imagePrefix: "core-ubuntu-2204-aarch64" - diskSizeGb: 200 - instanceType: "m6g.xlarge" - 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-go-unit.html" + # - "build/TEST-go-unit.xml" + # - "build/diagnostics/*" + # - "coverage.out" + # agents: + # provider: "aws" + # imagePrefix: "core-ubuntu-2204-aarch64" + # diskSizeGb: 200 + # instanceType: "m6g.xlarge" + # retry: + # manual: + # allowed: true - - label: "Unit tests - Windows 2022" - key: "unit-tests-win2022" - command: ".\\.buildkite\\scripts\\steps\\unit-tests.ps1" - artifact_paths: - - "build/TEST-go-unit.html" - - "build/TEST-go-unit.xml" - - "build/diagnostics/*" - - "coverage.out" - agents: - provider: "gcp" - image: "family/core-windows-2022" - machine_type: "n2-standard-8" - disk_size: 200 - disk_type: "pd-ssd" - retry: - manual: - allowed: true + # - label: "Unit tests - Windows 2022" + # key: "unit-tests-win2022" + # command: ".\\.buildkite\\scripts\\steps\\unit-tests.ps1" + # artifact_paths: + # - "build/TEST-go-unit.html" + # - "build/TEST-go-unit.xml" + # - "build/diagnostics/*" + # - "coverage.out" + # agents: + # provider: "gcp" + # image: "family/core-windows-2022" + # machine_type: "n2-standard-8" + # disk_size: 200 + # disk_type: "pd-ssd" + # retry: + # manual: + # allowed: true - - label: "Unit tests - Windows 2016" - key: "unit-tests-win2016" - command: ".\\.buildkite\\scripts\\steps\\unit-tests.ps1" - artifact_paths: - - "build/TEST-go-unit.html" - - "build/TEST-go-unit.xml" - - "build/diagnostics/*" - - "coverage.out" - agents: - provider: "gcp" - image: "family/core-windows-2016" - machine_type: "n2-standard-8" - disk_size: 200 - disk_type: "pd-ssd" - retry: - manual: - allowed: true + # - label: "Unit tests - Windows 2016" + # key: "unit-tests-win2016" + # command: ".\\.buildkite\\scripts\\steps\\unit-tests.ps1" + # artifact_paths: + # - "build/TEST-go-unit.html" + # - "build/TEST-go-unit.xml" + # - "build/diagnostics/*" + # - "coverage.out" + # agents: + # provider: "gcp" + # image: "family/core-windows-2016" + # machine_type: "n2-standard-8" + # disk_size: 200 + # disk_type: "pd-ssd" + # retry: + # manual: + # allowed: true - # Runs inly on the main branch - - label: "Unit tests - MacOS 13 ARM" - key: "unit-tests-macos-13-arm" - command: ".buildkite/scripts/steps/unit-tests.sh" - branches: main - artifact_paths: - - "build/TEST-go-unit.html" - - "build/TEST-go-unit.xml" - - "build/diagnostics/*" - - "coverage.out" - agents: - provider: orka - imagePrefix: generic-13-ventura-arm - retry: - manual: - allowed: true + # # Runs inly on the main branch + # - label: "Unit tests - MacOS 13 ARM" + # key: "unit-tests-macos-13-arm" + # command: ".buildkite/scripts/steps/unit-tests.sh" + # branches: main + # artifact_paths: + # - "build/TEST-go-unit.html" + # - "build/TEST-go-unit.xml" + # - "build/diagnostics/*" + # - "coverage.out" + # agents: + # provider: orka + # imagePrefix: generic-13-ventura-arm + # retry: + # manual: + # allowed: true - - label: "Unit tests - MacOS 13" - key: "unit-tests-macos-13" - command: ".buildkite/scripts/steps/unit-tests.sh" - artifact_paths: - - "build/TEST-go-unit.html" - - "build/TEST-go-unit.xml" - - "build/diagnostics/*" - - "coverage.out" - agents: - provider: orka - imagePrefix: generic-13-ventura-x64 - retry: - manual: - allowed: true + # - label: "Unit tests - MacOS 13" + # key: "unit-tests-macos-13" + # command: ".buildkite/scripts/steps/unit-tests.sh" + # artifact_paths: + # - "build/TEST-go-unit.html" + # - "build/TEST-go-unit.xml" + # - "build/diagnostics/*" + # - "coverage.out" + # agents: + # provider: orka + # imagePrefix: generic-13-ventura-x64 + # retry: + # manual: + # allowed: true - - group: "Desktop Windows tests" - key: "extended-windows" - steps: - - label: "Unit tests - Windows 10" - key: "unit-tests-win10" - command: ".\\.buildkite\\scripts\\steps\\unit-tests.ps1" - artifact_paths: - - "build/TEST-go-unit.html" - - "build/TEST-go-unit.xml" - - "build/diagnostics/*" - - "coverage.out" - agents: - provider: "gcp" - # TODO create own image - image: "family/general-windows-10" - machine_type: "n2-standard-8" - disk_type: "pd-ssd" - retry: - manual: - allowed: true - - label: "Unit tests - Windows 11" - key: "unit-tests-win11" - command: ".\\.buildkite\\scripts\\steps\\unit-tests.ps1" - artifact_paths: - - "build/TEST-go-unit.html" - - "build/TEST-go-unit.xml" - - "build/diagnostics/*" - - "coverage.out" - agents: - provider: "gcp" - # TODO create own image - image: "family/general-windows-11" - machine_type: "n2-standard-8" - disk_type: "pd-ssd" - retry: - manual: - allowed: true + # - group: "Desktop Windows tests" + # key: "extended-windows" + # steps: + # - label: "Unit tests - Windows 10" + # key: "unit-tests-win10" + # command: ".\\.buildkite\\scripts\\steps\\unit-tests.ps1" + # artifact_paths: + # - "build/TEST-go-unit.html" + # - "build/TEST-go-unit.xml" + # - "build/diagnostics/*" + # - "coverage.out" + # agents: + # provider: "gcp" + # # TODO create own image + # image: "family/general-windows-10" + # machine_type: "n2-standard-8" + # disk_type: "pd-ssd" + # retry: + # manual: + # allowed: true + # - label: "Unit tests - Windows 11" + # key: "unit-tests-win11" + # command: ".\\.buildkite\\scripts\\steps\\unit-tests.ps1" + # artifact_paths: + # - "build/TEST-go-unit.html" + # - "build/TEST-go-unit.xml" + # - "build/diagnostics/*" + # - "coverage.out" + # agents: + # provider: "gcp" + # # TODO create own image + # image: "family/general-windows-11" + # machine_type: "n2-standard-8" + # disk_type: "pd-ssd" + # retry: + # manual: + # allowed: true - - label: "Merge coverage reports" - key: "merge-coverage" - env: - BUILDKITE_REPO: "" - command: " - .buildkite/scripts/steps/merge.sh - unit-tests-2204 - unit-tests-2204-arm64 - unit-tests-win2016 - unit-tests-win2022 - unit-tests-macos-13 - unit-tests-win10 - unit-tests-win11 - " - artifact_paths: - - "build/TEST-go-unit.cov" - agents: - image: "golang:1.20.10" - depends_on: - - unit-tests - - extended-windows - allow_dependency_failure: true + # - label: "Merge coverage reports" + # key: "merge-coverage" + # env: + # BUILDKITE_REPO: "" + # command: " + # .buildkite/scripts/steps/merge.sh + # unit-tests-2204 + # unit-tests-2204-arm64 + # unit-tests-win2016 + # unit-tests-win2022 + # unit-tests-macos-13 + # unit-tests-win10 + # unit-tests-win11 + # " + # artifact_paths: + # - "build/TEST-go-unit.cov" + # agents: + # image: "golang:1.20.10" + # depends_on: + # - unit-tests + # - extended-windows + # allow_dependency_failure: true - - group: "K8s tests" - key: "k8s-tests" - steps: - - label: "K8s tests: {{matrix.k8s_version}}" - env: - K8S_VERSION: "v{{matrix.k8s_version}}" - KIND_VERSION: "v0.20.0" - command: ".buildkite/scripts/steps/k8s-tests.sh" - agents: - provider: "gcp" - image: "family/core-ubuntu-2204" - matrix: - setup: - k8s_version: - - "1.29.0" - - "1.28.0" - - "1.27.3" - - "1.26.6" - retry: - manual: - allowed: true + # - group: "K8s tests" + # key: "k8s-tests" + # steps: + # - label: "K8s tests: {{matrix.k8s_version}}" + # env: + # K8S_VERSION: "v{{matrix.k8s_version}}" + # KIND_VERSION: "v0.20.0" + # command: ".buildkite/scripts/steps/k8s-tests.sh" + # agents: + # provider: "gcp" + # image: "family/core-ubuntu-2204" + # matrix: + # setup: + # k8s_version: + # - "1.29.0" + # - "1.28.0" + # - "1.27.3" + # - "1.26.6" + # 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 --step merge-coverage build/TEST-go-unit.cov ." - - "/scan-source-code.sh" - depends_on: - - "merge-coverage" - 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 --step merge-coverage build/TEST-go-unit.cov ." + # - "/scan-source-code.sh" + # depends_on: + # - "merge-coverage" + # retry: + # manual: + # allowed: true - # Triggers a dynamic step: Sync K8s - # Runs only on main and if k8s files are changed - - label: "Trigger k8s sync" - branches: main - plugins: - - monebag/monorepo-diff#v2.5.9: - diff: "git diff --name-only HEAD~1" - watch: - - path: - - deploy/kubernetes/* - - version/docs/version.asciidoc - config: - label: "Sync K8s" - command: ".buildkite/scripts/steps/sync-k8s.sh" - agents: - provider: "gcp" - image: "family/core-ubuntu-2204" - env: - - GH_VERSION=2.4.0 + # # Triggers a dynamic step: Sync K8s + # # Runs only on main and if k8s files are changed + # - label: "Trigger k8s sync" + # branches: main + # plugins: + # - monebag/monorepo-diff#v2.5.9: + # diff: "git diff --name-only HEAD~1" + # watch: + # - path: + # - deploy/kubernetes/* + # - version/docs/version.asciidoc + # config: + # label: "Sync K8s" + # command: ".buildkite/scripts/steps/sync-k8s.sh" + # agents: + # provider: "gcp" + # image: "family/core-ubuntu-2204" + # env: + # - GH_VERSION=2.4.0 # Trigger for pull requests - - label: "Trigger Integration tests" + - label: "Trigger Integration tests for Pull request" if: | (build.pull_request.id != null && !build.pull_request.draft && !(build.pull_request.labels includes "skip-it")) || env("GITHUB_PR_TRIGGER_COMMENT") =~ /extended/ @@ -269,7 +269,7 @@ steps: - GITHUB_PR_LABELS=${GITHUB_PR_LABELS} # Trigger for branches - - label: "Triggering Integration tests" + - label: "Triggering Integration tests for branches" if: build.pull_request.id == null trigger: "elastic-agent-extended-testing" build: From 66b482e26d43831db76a8e69f7f336ca511c13a2 Mon Sep 17 00:00:00 2001 From: Pavel Zorin Date: Tue, 11 Jun 2024 14:24:20 +0200 Subject: [PATCH 05/17] Debug --- .buildkite/pipeline.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index bdc317ce4a8..809415ecf93 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -235,8 +235,13 @@ steps: # Trigger for pull requests - label: "Trigger Integration tests for Pull request" + + # if: | + # (build.pull_request.id != null && !build.pull_request.draft && !(build.pull_request.labels includes "skip-it")) || + # env("GITHUB_PR_TRIGGER_COMMENT") =~ /extended/ + if: | - (build.pull_request.id != null && !build.pull_request.draft && !(build.pull_request.labels includes "skip-it")) || + !build.pull_request.draft || env("GITHUB_PR_TRIGGER_COMMENT") =~ /extended/ plugins: - monorepo-diff#v1.0.1: From 2562c1bd79a64eca1f8645486ea99cee0a3db8a1 Mon Sep 17 00:00:00 2001 From: Pavel Zorin Date: Tue, 11 Jun 2024 14:53:22 +0200 Subject: [PATCH 06/17] Debug --- .buildkite/pipeline.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 809415ecf93..9de4ccce37c 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -238,11 +238,11 @@ steps: # if: | # (build.pull_request.id != null && !build.pull_request.draft && !(build.pull_request.labels includes "skip-it")) || - # env("GITHUB_PR_TRIGGER_COMMENT") =~ /extended/ + # build.env("GITHUB_PR_TRIGGER_COMMENT") =~ /extended/ if: | !build.pull_request.draft || - env("GITHUB_PR_TRIGGER_COMMENT") =~ /extended/ + build.env("GITHUB_PR_TRIGGER_COMMENT") =~ /extended/ plugins: - monorepo-diff#v1.0.1: diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD" From 20cc958bce9a8fd03adbc4be67fa4e2957575289 Mon Sep 17 00:00:00 2001 From: Pavel Zorin Date: Tue, 11 Jun 2024 14:55:23 +0200 Subject: [PATCH 07/17] Debug --- .buildkite/pipeline.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 9de4ccce37c..5bc95efc1c9 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -240,9 +240,7 @@ steps: # (build.pull_request.id != null && !build.pull_request.draft && !(build.pull_request.labels includes "skip-it")) || # build.env("GITHUB_PR_TRIGGER_COMMENT") =~ /extended/ - if: | - !build.pull_request.draft || - build.env("GITHUB_PR_TRIGGER_COMMENT") =~ /extended/ + if: "false" plugins: - monorepo-diff#v1.0.1: diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD" From 6018fe3410827f52af3214666b4dccbf47f9af9a Mon Sep 17 00:00:00 2001 From: Pavel Zorin Date: Tue, 11 Jun 2024 14:57:38 +0200 Subject: [PATCH 08/17] Debug --- .buildkite/pipeline.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 5bc95efc1c9..73a99230fdd 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -240,7 +240,8 @@ steps: # (build.pull_request.id != null && !build.pull_request.draft && !(build.pull_request.labels includes "skip-it")) || # build.env("GITHUB_PR_TRIGGER_COMMENT") =~ /extended/ - if: "false" + if: | + !build.pull_request.draft plugins: - monorepo-diff#v1.0.1: diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD" From e1106fb10cc230752af736a23cc0b0d815457dc2 Mon Sep 17 00:00:00 2001 From: Pavel Zorin Date: Tue, 11 Jun 2024 14:59:49 +0200 Subject: [PATCH 09/17] Debug --- .buildkite/pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 73a99230fdd..a3af6c312fb 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -241,7 +241,7 @@ steps: # build.env("GITHUB_PR_TRIGGER_COMMENT") =~ /extended/ if: | - !build.pull_request.draft + build.pull_request.draft == null plugins: - monorepo-diff#v1.0.1: diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD" From c70fc5ddf6867e49dbd66ba7cfbd36d5735c690a Mon Sep 17 00:00:00 2001 From: Pavel Zorin Date: Tue, 11 Jun 2024 15:21:34 +0200 Subject: [PATCH 10/17] Debug --- .buildkite/pipeline.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index a3af6c312fb..e5a349a434a 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -236,12 +236,10 @@ steps: # Trigger for pull requests - label: "Trigger Integration tests for Pull request" - # if: | - # (build.pull_request.id != null && !build.pull_request.draft && !(build.pull_request.labels includes "skip-it")) || - # build.env("GITHUB_PR_TRIGGER_COMMENT") =~ /extended/ - if: | - build.pull_request.draft == null + (build.pull_request.id != null && !(build.pull_request.labels includes "skip-it")) || + build.env("GITHUB_PR_TRIGGER_COMMENT") =~ /extended/ + plugins: - monorepo-diff#v1.0.1: diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD" From 9429085ad6b7af28bda3f23c59fc392cdcf6ebf4 Mon Sep 17 00:00:00 2001 From: Pavel Zorin Date: Tue, 11 Jun 2024 23:56:34 +0200 Subject: [PATCH 11/17] Debug --- .buildkite/pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index e5a349a434a..a952cef2b6e 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -237,7 +237,7 @@ steps: - label: "Trigger Integration tests for Pull request" if: | - (build.pull_request.id != null && !(build.pull_request.labels includes "skip-it")) || + (build.pull_request.id != null && !build.env("GITHUB_PR_LABELS") =~ /skip-it/) || build.env("GITHUB_PR_TRIGGER_COMMENT") =~ /extended/ plugins: From ef4fac34276f7334e1dde58cd319812c096b9dfd Mon Sep 17 00:00:00 2001 From: Pavel Zorin Date: Tue, 11 Jun 2024 23:58:11 +0200 Subject: [PATCH 12/17] Debug --- .buildkite/pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index a952cef2b6e..d5a2db7d77e 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -233,7 +233,7 @@ steps: # env: # - GH_VERSION=2.4.0 - # Trigger for pull requests + # Trigger for pull requests c - label: "Trigger Integration tests for Pull request" if: | From 1e82c40807d9691a3528d8bb5cd490406a1e9be7 Mon Sep 17 00:00:00 2001 From: Pavel Zorin Date: Wed, 12 Jun 2024 14:38:49 +0200 Subject: [PATCH 13/17] Debug --- .buildkite/pipeline.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index d5a2db7d77e..be84e7b4589 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -233,12 +233,12 @@ steps: # env: # - GH_VERSION=2.4.0 - # Trigger for pull requests c + # Trigger for pull requests - label: "Trigger Integration tests for Pull request" if: | (build.pull_request.id != null && !build.env("GITHUB_PR_LABELS") =~ /skip-it/) || - build.env("GITHUB_PR_TRIGGER_COMMENT") =~ /extended/ + build.env("GITHUB_PR_TRIGGER_COMMENT") =~ .*extended.* plugins: - monorepo-diff#v1.0.1: From 3766a68529ba4ea0eff5771d006c14e362721247 Mon Sep 17 00:00:00 2001 From: Pavel Zorin Date: Wed, 12 Jun 2024 14:46:07 +0200 Subject: [PATCH 14/17] Debug --- .buildkite/pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index be84e7b4589..b9272740dad 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -238,7 +238,7 @@ steps: if: | (build.pull_request.id != null && !build.env("GITHUB_PR_LABELS") =~ /skip-it/) || - build.env("GITHUB_PR_TRIGGER_COMMENT") =~ .*extended.* + build.env("GITHUB_PR_TRIGGER_COMMENT") =~ /.*extended.*/ plugins: - monorepo-diff#v1.0.1: From d468c163563c74cafe36c873a634a21a9330be75 Mon Sep 17 00:00:00 2001 From: Pavel Zorin Date: Wed, 12 Jun 2024 14:55:39 +0200 Subject: [PATCH 15/17] Cleanup --- .buildkite/integration.pipeline.yml | 70 ++++++++++++++--------------- 1 file changed, 33 insertions(+), 37 deletions(-) diff --git a/.buildkite/integration.pipeline.yml b/.buildkite/integration.pipeline.yml index 65709bd882d..37b4c2d1d25 100644 --- a/.buildkite/integration.pipeline.yml +++ b/.buildkite/integration.pipeline.yml @@ -7,71 +7,67 @@ env: steps: - label: "Serverless integration test" key: "serverless-integration-tests" - # concurrency_group: elastic-agent-extended-testing/serverless-integration - # concurrency: 8 + concurrency_group: elastic-agent-extended-testing/serverless-integration + concurrency: 8 env: # we run each step in a different data center to spread the load TEST_INTEG_AUTH_GCP_DATACENTER: "us-central1-a" - # command: ".buildkite/scripts/steps/integration_tests.sh serverless integration:single TestLogIngestionFleetManaged" #right now, run a single test in serverless mode as a sort of smoke test, instead of re-running the entire suite - command: "echo 'serverless'" - # artifact_paths: - # - "build/TEST-**" - # - "build/diagnostics/*" - # agents: - # provider: "gcp" - # machineType: "n1-standard-8" + command: ".buildkite/scripts/steps/integration_tests.sh serverless integration:single TestLogIngestionFleetManaged" #right now, run a single test in serverless mode as a sort of smoke test, instead of re-running the entire suite + artifact_paths: + - "build/TEST-**" + - "build/diagnostics/*" + agents: + provider: "gcp" + machineType: "n1-standard-8" notify: - github_commit_status: context: "buildkite/elastic-agent-extended-testing - Serverless integration test" - label: "Extended runtime leak tests" key: "extended-integration-tests" - # concurrency_group: elastic-agent-extended-testing/leak-tests - # concurrency: 8 + concurrency_group: elastic-agent-extended-testing/leak-tests + concurrency: 8 env: TEST_INTEG_AUTH_GCP_DATACENTER: "us-central1-b" - # command: ".buildkite/scripts/steps/integration_tests.sh stateful integration:TestForResourceLeaks" - command: "echo 'leak'" - # artifact_paths: - # - "build/TEST-**" - # - "build/diagnostics/*" - # agents: - # provider: "gcp" - # machineType: "n1-standard-8" + command: ".buildkite/scripts/steps/integration_tests.sh stateful integration:TestForResourceLeaks" + artifact_paths: + - "build/TEST-**" + - "build/diagnostics/*" + agents: + provider: "gcp" + machineType: "n1-standard-8" notify: - github_commit_status: context: "buildkite/elastic-agent-extended-testing - Extended runtime leak tests" - label: "Integration tests" key: "integration-tests" - # concurrency_group: elastic-agent-extended-testing/integration - # concurrency: 8 + concurrency_group: elastic-agent-extended-testing/integration + concurrency: 8 env: TEST_INTEG_AUTH_GCP_DATACENTER: "us-central1-f" - # command: ".buildkite/scripts/steps/integration_tests.sh stateful" - command: "echo 'it'" - # artifact_paths: - # - "build/TEST-**" - # - "build/diagnostics/*" - # agents: - # provider: "gcp" - # machineType: "n1-standard-8" + command: ".buildkite/scripts/steps/integration_tests.sh stateful" + artifact_paths: + - "build/TEST-**" + - "build/diagnostics/*" + agents: + provider: "gcp" + machineType: "n1-standard-8" notify: - github_commit_status: context: "buildkite/elastic-agent-extended-testing - Integration tests" - label: "Serverless Beats Tests" key: "serverless-beats-integration-tests" - # concurrency_group: elastic-agent-extended-testing/beats-integration - # concurrency: 8 + concurrency_group: elastic-agent-extended-testing/beats-integration + concurrency: 8 env: TEST_INTEG_AUTH_GCP_DATACENTER: "us-central1-a" - # command: ".buildkite/scripts/steps/beats_tests.sh" - command: "echo 'serverless beats'" + command: ".buildkite/scripts/steps/beats_tests.sh" # if: "build.env('CRON') == 'yes'" - # agents: - # provider: "gcp" - # machineType: "n1-standard-8" + agents: + provider: "gcp" + machineType: "n1-standard-8" retry: manual: allowed: true From b2ecfca98d26d06f9a95c487d6028710301588a6 Mon Sep 17 00:00:00 2001 From: Pavel Zorin Date: Wed, 12 Jun 2024 15:23:29 +0200 Subject: [PATCH 16/17] Cleanup --- .buildkite/pipeline.yml | 438 ++++++++++++++++++++-------------------- 1 file changed, 219 insertions(+), 219 deletions(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index b9272740dad..c81650a871c 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -4,238 +4,237 @@ env: VAULT_PATH: "kv/ci-shared/observability-ingest/cloud/gcp" DOCKER_REGISTRY: "docker.elastic.co" steps: - # - label: "check-ci" - # key: "check-ci" - # command: ".buildkite/scripts/steps/check-ci.sh" - # agents: - # provider: "gcp" - # image: "family/core-ubuntu-2204" - # retry: - # manual: - # allowed: true - # - group: "Unit tests" - # key: "unit-tests" - # steps: - # - label: "Unit tests - Ubuntu 22.04" - # key: "unit-tests-2204" - # command: ".buildkite/scripts/steps/unit-tests.sh" - # artifact_paths: - # - "build/TEST-go-unit.html" - # - "build/TEST-go-unit.xml" - # - "build/diagnostics/*" - # - "coverage.out" - # agents: - # provider: "gcp" - # image: "family/core-ubuntu-2204" - # retry: - # manual: - # allowed: true + - label: "check-ci" + key: "check-ci" + command: ".buildkite/scripts/steps/check-ci.sh" + agents: + provider: "gcp" + image: "family/core-ubuntu-2204" + retry: + manual: + allowed: true + - group: "Unit tests" + key: "unit-tests" + steps: + - label: "Unit tests - Ubuntu 22.04" + key: "unit-tests-2204" + command: ".buildkite/scripts/steps/unit-tests.sh" + artifact_paths: + - "build/TEST-go-unit.html" + - "build/TEST-go-unit.xml" + - "build/diagnostics/*" + - "coverage.out" + 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-go-unit.html" - # - "build/TEST-go-unit.xml" - # - "build/diagnostics/*" - # - "coverage.out" - # agents: - # provider: "aws" - # imagePrefix: "core-ubuntu-2204-aarch64" - # diskSizeGb: 200 - # instanceType: "m6g.xlarge" - # 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-go-unit.html" + - "build/TEST-go-unit.xml" + - "build/diagnostics/*" + - "coverage.out" + agents: + provider: "aws" + imagePrefix: "core-ubuntu-2204-aarch64" + diskSizeGb: 200 + instanceType: "m6g.xlarge" + retry: + manual: + allowed: true - # - label: "Unit tests - Windows 2022" - # key: "unit-tests-win2022" - # command: ".\\.buildkite\\scripts\\steps\\unit-tests.ps1" - # artifact_paths: - # - "build/TEST-go-unit.html" - # - "build/TEST-go-unit.xml" - # - "build/diagnostics/*" - # - "coverage.out" - # agents: - # provider: "gcp" - # image: "family/core-windows-2022" - # machine_type: "n2-standard-8" - # disk_size: 200 - # disk_type: "pd-ssd" - # retry: - # manual: - # allowed: true + - label: "Unit tests - Windows 2022" + key: "unit-tests-win2022" + command: ".\\.buildkite\\scripts\\steps\\unit-tests.ps1" + artifact_paths: + - "build/TEST-go-unit.html" + - "build/TEST-go-unit.xml" + - "build/diagnostics/*" + - "coverage.out" + agents: + provider: "gcp" + image: "family/core-windows-2022" + machine_type: "n2-standard-8" + disk_size: 200 + disk_type: "pd-ssd" + retry: + manual: + allowed: true - # - label: "Unit tests - Windows 2016" - # key: "unit-tests-win2016" - # command: ".\\.buildkite\\scripts\\steps\\unit-tests.ps1" - # artifact_paths: - # - "build/TEST-go-unit.html" - # - "build/TEST-go-unit.xml" - # - "build/diagnostics/*" - # - "coverage.out" - # agents: - # provider: "gcp" - # image: "family/core-windows-2016" - # machine_type: "n2-standard-8" - # disk_size: 200 - # disk_type: "pd-ssd" - # retry: - # manual: - # allowed: true + - label: "Unit tests - Windows 2016" + key: "unit-tests-win2016" + command: ".\\.buildkite\\scripts\\steps\\unit-tests.ps1" + artifact_paths: + - "build/TEST-go-unit.html" + - "build/TEST-go-unit.xml" + - "build/diagnostics/*" + - "coverage.out" + agents: + provider: "gcp" + image: "family/core-windows-2016" + machine_type: "n2-standard-8" + disk_size: 200 + disk_type: "pd-ssd" + retry: + manual: + allowed: true - # # Runs inly on the main branch - # - label: "Unit tests - MacOS 13 ARM" - # key: "unit-tests-macos-13-arm" - # command: ".buildkite/scripts/steps/unit-tests.sh" - # branches: main - # artifact_paths: - # - "build/TEST-go-unit.html" - # - "build/TEST-go-unit.xml" - # - "build/diagnostics/*" - # - "coverage.out" - # agents: - # provider: orka - # imagePrefix: generic-13-ventura-arm - # retry: - # manual: - # allowed: true + # Runs inly on the main branch + - label: "Unit tests - MacOS 13 ARM" + key: "unit-tests-macos-13-arm" + command: ".buildkite/scripts/steps/unit-tests.sh" + branches: main + artifact_paths: + - "build/TEST-go-unit.html" + - "build/TEST-go-unit.xml" + - "build/diagnostics/*" + - "coverage.out" + agents: + provider: orka + imagePrefix: generic-13-ventura-arm + retry: + manual: + allowed: true - # - label: "Unit tests - MacOS 13" - # key: "unit-tests-macos-13" - # command: ".buildkite/scripts/steps/unit-tests.sh" - # artifact_paths: - # - "build/TEST-go-unit.html" - # - "build/TEST-go-unit.xml" - # - "build/diagnostics/*" - # - "coverage.out" - # agents: - # provider: orka - # imagePrefix: generic-13-ventura-x64 - # retry: - # manual: - # allowed: true + - label: "Unit tests - MacOS 13" + key: "unit-tests-macos-13" + command: ".buildkite/scripts/steps/unit-tests.sh" + artifact_paths: + - "build/TEST-go-unit.html" + - "build/TEST-go-unit.xml" + - "build/diagnostics/*" + - "coverage.out" + agents: + provider: orka + imagePrefix: generic-13-ventura-x64 + retry: + manual: + allowed: true - # - group: "Desktop Windows tests" - # key: "extended-windows" - # steps: - # - label: "Unit tests - Windows 10" - # key: "unit-tests-win10" - # command: ".\\.buildkite\\scripts\\steps\\unit-tests.ps1" - # artifact_paths: - # - "build/TEST-go-unit.html" - # - "build/TEST-go-unit.xml" - # - "build/diagnostics/*" - # - "coverage.out" - # agents: - # provider: "gcp" - # # TODO create own image - # image: "family/general-windows-10" - # machine_type: "n2-standard-8" - # disk_type: "pd-ssd" - # retry: - # manual: - # allowed: true - # - label: "Unit tests - Windows 11" - # key: "unit-tests-win11" - # command: ".\\.buildkite\\scripts\\steps\\unit-tests.ps1" - # artifact_paths: - # - "build/TEST-go-unit.html" - # - "build/TEST-go-unit.xml" - # - "build/diagnostics/*" - # - "coverage.out" - # agents: - # provider: "gcp" - # # TODO create own image - # image: "family/general-windows-11" - # machine_type: "n2-standard-8" - # disk_type: "pd-ssd" - # retry: - # manual: - # allowed: true + - group: "Desktop Windows tests" + key: "extended-windows" + steps: + - label: "Unit tests - Windows 10" + key: "unit-tests-win10" + command: ".\\.buildkite\\scripts\\steps\\unit-tests.ps1" + artifact_paths: + - "build/TEST-go-unit.html" + - "build/TEST-go-unit.xml" + - "build/diagnostics/*" + - "coverage.out" + agents: + provider: "gcp" + # TODO create own image + image: "family/general-windows-10" + machine_type: "n2-standard-8" + disk_type: "pd-ssd" + retry: + manual: + allowed: true + - label: "Unit tests - Windows 11" + key: "unit-tests-win11" + command: ".\\.buildkite\\scripts\\steps\\unit-tests.ps1" + artifact_paths: + - "build/TEST-go-unit.html" + - "build/TEST-go-unit.xml" + - "build/diagnostics/*" + - "coverage.out" + agents: + provider: "gcp" + # TODO create own image + image: "family/general-windows-11" + machine_type: "n2-standard-8" + disk_type: "pd-ssd" + retry: + manual: + allowed: true - # - label: "Merge coverage reports" - # key: "merge-coverage" - # env: - # BUILDKITE_REPO: "" - # command: " - # .buildkite/scripts/steps/merge.sh - # unit-tests-2204 - # unit-tests-2204-arm64 - # unit-tests-win2016 - # unit-tests-win2022 - # unit-tests-macos-13 - # unit-tests-win10 - # unit-tests-win11 - # " - # artifact_paths: - # - "build/TEST-go-unit.cov" - # agents: - # image: "golang:1.20.10" - # depends_on: - # - unit-tests - # - extended-windows - # allow_dependency_failure: true + - label: "Merge coverage reports" + key: "merge-coverage" + env: + BUILDKITE_REPO: "" + command: " + .buildkite/scripts/steps/merge.sh + unit-tests-2204 + unit-tests-2204-arm64 + unit-tests-win2016 + unit-tests-win2022 + unit-tests-macos-13 + unit-tests-win10 + unit-tests-win11 + " + artifact_paths: + - "build/TEST-go-unit.cov" + agents: + image: "golang:1.20.10" + depends_on: + - unit-tests + - extended-windows + allow_dependency_failure: true - # - group: "K8s tests" - # key: "k8s-tests" - # steps: - # - label: "K8s tests: {{matrix.k8s_version}}" - # env: - # K8S_VERSION: "v{{matrix.k8s_version}}" - # KIND_VERSION: "v0.20.0" - # command: ".buildkite/scripts/steps/k8s-tests.sh" - # agents: - # provider: "gcp" - # image: "family/core-ubuntu-2204" - # matrix: - # setup: - # k8s_version: - # - "1.29.0" - # - "1.28.0" - # - "1.27.3" - # - "1.26.6" - # retry: - # manual: - # allowed: true + - group: "K8s tests" + key: "k8s-tests" + steps: + - label: "K8s tests: {{matrix.k8s_version}}" + env: + K8S_VERSION: "v{{matrix.k8s_version}}" + KIND_VERSION: "v0.20.0" + command: ".buildkite/scripts/steps/k8s-tests.sh" + agents: + provider: "gcp" + image: "family/core-ubuntu-2204" + matrix: + setup: + k8s_version: + - "1.29.0" + - "1.28.0" + - "1.27.3" + - "1.26.6" + 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 --step merge-coverage build/TEST-go-unit.cov ." - # - "/scan-source-code.sh" - # depends_on: - # - "merge-coverage" - # 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 --step merge-coverage build/TEST-go-unit.cov ." + - "/scan-source-code.sh" + depends_on: + - "merge-coverage" + retry: + manual: + allowed: true - # # Triggers a dynamic step: Sync K8s - # # Runs only on main and if k8s files are changed - # - label: "Trigger k8s sync" - # branches: main - # plugins: - # - monebag/monorepo-diff#v2.5.9: - # diff: "git diff --name-only HEAD~1" - # watch: - # - path: - # - deploy/kubernetes/* - # - version/docs/version.asciidoc - # config: - # label: "Sync K8s" - # command: ".buildkite/scripts/steps/sync-k8s.sh" - # agents: - # provider: "gcp" - # image: "family/core-ubuntu-2204" - # env: - # - GH_VERSION=2.4.0 + # Triggers a dynamic step: Sync K8s + # Runs only on main and if k8s files are changed + - label: "Trigger k8s sync" + branches: main + plugins: + - monebag/monorepo-diff#v2.5.9: + diff: "git diff --name-only HEAD~1" + watch: + - path: + - deploy/kubernetes/* + - version/docs/version.asciidoc + config: + label: "Sync K8s" + command: ".buildkite/scripts/steps/sync-k8s.sh" + agents: + provider: "gcp" + image: "family/core-ubuntu-2204" + env: + - GH_VERSION=2.4.0 # Trigger for pull requests - label: "Trigger Integration tests for Pull request" - if: | (build.pull_request.id != null && !build.env("GITHUB_PR_LABELS") =~ /skip-it/) || build.env("GITHUB_PR_TRIGGER_COMMENT") =~ /.*extended.*/ @@ -257,6 +256,7 @@ steps: - main.go - .buildkite/integration.pipeline.yml + - .buildkite/pipeline.yml - .buildkite/scripts/ - .buildkite/hooks/ From 2f46af70d25dbd5d2c037c25652c4f25ee1dd5cd Mon Sep 17 00:00:00 2001 From: Pavel Zorin Date: Wed, 12 Jun 2024 17:02:49 +0200 Subject: [PATCH 17/17] added missing watch paths --- .buildkite/pipeline.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index c81650a871c..daeacdebe67 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -248,10 +248,13 @@ steps: - dev-tools/ - pkg/ - testing/ + - version/ + - specs/ - .agent-versions.json - .go-version - .package-version - go.mod + - go.sum - magefile.go - main.go