From 6380ea5556a5f57a2028aa778c645246b5d39ee5 Mon Sep 17 00:00:00 2001 From: Pavel Zorin Date: Fri, 17 May 2024 20:26:37 +0200 Subject: [PATCH] [CI] Separated extended testing pipeline (#4739) * Separated extended testing pipeline * remaned to integration pipeline * Added concurrency group and BEAT_NAME * removed BEAT_NAME var from Serverless Beats tests --- .buildkite/hooks/pre-command | 2 +- .buildkite/hooks/pre-exit | 2 +- .buildkite/integration.pipeline.yml | 73 +++++++++++++++++++++++++++++ .buildkite/pipeline.yml | 41 ---------------- .pre-commit-config.yaml | 7 --- 5 files changed, 75 insertions(+), 50 deletions(-) create mode 100644 .buildkite/integration.pipeline.yml diff --git a/.buildkite/hooks/pre-command b/.buildkite/hooks/pre-command index 0d64284efd2..6153e122293 100755 --- a/.buildkite/hooks/pre-command +++ b/.buildkite/hooks/pre-command @@ -46,7 +46,7 @@ if [[ "$BUILDKITE_PIPELINE_SLUG" == "elastic-agent-package" ]]; then fi fi -if [[ "$BUILDKITE_PIPELINE_SLUG" == "elastic-agent" && "$BUILDKITE_STEP_KEY" == *"integration-tests"* ]]; then +if [[ "$BUILDKITE_PIPELINE_SLUG" == "elastic-agent-extended-testing" && "$BUILDKITE_STEP_KEY" == *"integration-tests"* ]]; then # Set GCP credentials export GOOGLE_APPLICATION_GCP_SECRET=$(retry 5 vault kv get -format=json -field=data ${CI_GCP_OBS_PATH}) echo "${GOOGLE_APPLICATION_GCP_SECRET}" > ./gcp.json diff --git a/.buildkite/hooks/pre-exit b/.buildkite/hooks/pre-exit index 7c7a191f29e..f6fea04d0d2 100755 --- a/.buildkite/hooks/pre-exit +++ b/.buildkite/hooks/pre-exit @@ -2,7 +2,7 @@ set -eo pipefail -if [[ "$BUILDKITE_PIPELINE_SLUG" == "elastic-agent" && "$BUILDKITE_STEP_KEY" == *"integration-tests"* ]]; then +if [[ "$BUILDKITE_PIPELINE_SLUG" == "elastic-agent-extended-testing" && "$BUILDKITE_STEP_KEY" == *"integration-tests"* ]]; then if [[ -z "${WORKSPACE-""}" ]]; then WORKSPACE=$(git rev-parse --show-toplevel) fi diff --git a/.buildkite/integration.pipeline.yml b/.buildkite/integration.pipeline.yml new file mode 100644 index 00000000000..2691ff67737 --- /dev/null +++ b/.buildkite/integration.pipeline.yml @@ -0,0 +1,73 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/buildkite/pipeline-schema/main/schema.json + +env: + DOCKER_REGISTRY: "docker.elastic.co" + VAULT_PATH: "kv/ci-shared/observability-ingest/cloud/gcp" + +steps: + - label: "Serverless integration test" + key: "serverless-integration-tests" + concurrency_group: elastic-agent-extended-testing/serverless-integration + concurrency: 8 + env: + BEAT_NAME: "elastic-agent" + 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: "Serverless integration test" + + - label: "Extended runtime leak tests" + key: "extended-integration-tests" + concurrency_group: elastic-agent-extended-testing/leak-tests + concurrency: 8 + env: + BEAT_NAME: "elastic-agent" + 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: "Extended runtime leak tests" + + - label: "Integration tests" + key: "integration-tests" + concurrency_group: elastic-agent-extended-testing/integration + concurrency: 8 + env: + BEAT_NAME: "elastic-agent" + 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: "Integration tests" + + - label: "Serverless Beats Tests" + key: "serverless-beats-integration-tests" + concurrency_group: elastic-agent-extended-testing/beats-integration + concurrency: 8 + command: ".buildkite/scripts/steps/beats_tests.sh" + # if: "build.env('CRON') == 'yes'" + agents: + provider: "gcp" + machineType: "n1-standard-8" + retry: + manual: + allowed: true + notify: + - github_commit_status: + context: "Serverless Beats Tests" diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 94f03b4f778..6c73bf31c09 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -213,47 +213,6 @@ steps: manual: allowed: true - - label: "Serverless integration test" - key: "serverless-integration-tests" - 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" - - - label: "Extended runtime leak tests" - key: "extended-integration-tests" - command: ".buildkite/scripts/steps/integration_tests.sh stateful integration:TestForResourceLeaks" - artifact_paths: - - "build/TEST-**" - - "build/diagnostics/*" - agents: - provider: "gcp" - machineType: "n1-standard-8" - - - label: "Integration tests" - key: "integration-tests" - command: ".buildkite/scripts/steps/integration_tests.sh stateful" - artifact_paths: - - "build/TEST-**" - - "build/diagnostics/*" - agents: - provider: "gcp" - machineType: "n1-standard-8" - - - label: "Serverless Beats Tests" - key: "serverless-beats-integration-tests" - command: ".buildkite/scripts/steps/beats_tests.sh" - # if: "build.env('CRON') == 'yes'" - agents: - provider: "gcp" - machineType: "n1-standard-8" - retry: - manual: - allowed: true - # Triggers a dynamic step: Sync K8s # Runs only on main and if k8s files are changed - label: "Trigger k8s sync" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index af7954520b9..047700875f2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,10 +3,3 @@ repos: rev: v4.0.1 hooks: - id: check-merge-conflict - -- repo: https://github.com/elastic/apm-pipeline-library.git - rev: current - hooks: - - id: check-jenkins-pipelines - files: ^(.ci/(.*\.groovy|Jenkinsfile)|Jenkinsfile)$ - - id: check-jjbb