From 044a386c704d7391c1341e92dd6afa5130a2ce87 Mon Sep 17 00:00:00 2001 From: Pavel Zorin Date: Mon, 13 May 2024 14:59:17 +0200 Subject: [PATCH] Separated extended testing pipeline --- .buildkite/extended.testing.pipeline.yml | 58 ++++++++++++++++++++++++ .buildkite/hooks/pre-command | 2 +- .buildkite/hooks/pre-exit | 2 +- .buildkite/pipeline.yml | 41 ----------------- .buildkite/pull-requests.json | 18 +++++++- .pre-commit-config.yaml | 7 --- 6 files changed, 77 insertions(+), 51 deletions(-) create mode 100644 .buildkite/extended.testing.pipeline.yml diff --git a/.buildkite/extended.testing.pipeline.yml b/.buildkite/extended.testing.pipeline.yml new file mode 100644 index 00000000000..ce7577c5d43 --- /dev/null +++ b/.buildkite/extended.testing.pipeline.yml @@ -0,0 +1,58 @@ +# 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" + 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" + 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" + 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" + 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/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/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/.buildkite/pull-requests.json b/.buildkite/pull-requests.json index 6b6ef40b827..001d7cd1709 100644 --- a/.buildkite/pull-requests.json +++ b/.buildkite/pull-requests.json @@ -13,7 +13,23 @@ "always_trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:build|test)\\W+(?:this|it))|^/test$", "skip_ci_labels": [ ], "skip_target_branches": [ ], - "skip_ci_on_only_changed": [ ], + "skip_ci_on_only_changed": [ "changelog", "docs", "README.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-extended-testing", + "allow_org_users": true, + "allowed_repo_permissions": ["admin", "write"], + "allowed_list": ["dependabot[bot]", "mergify[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_target_branches": [ ], + "skip_ci_on_only_changed": [ "changelog", "docs", "README.md", "sonar-project.properties", "docker-compose.yml", ".pre-commit-config.yaml", "skaffold.yaml", "Dockerfile.skaffold", "Dockerfile"], "always_require_ci_on_changed": [ ] }, { 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