diff --git a/.buildkite/pipeline.package-core.yml b/.buildkite/pipeline.artifacts.yml similarity index 100% rename from .buildkite/pipeline.package-core.yml rename to .buildkite/pipeline.artifacts.yml diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index aa1319a6cce..7b0d6eec683 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -1,12 +1,8 @@ # yaml-language-server: $schema=https://raw.githubusercontent.com/buildkite/pipeline-schema/main/schema.json - -env: - VAULT_PATH: "kv/ci-shared/observability-ingest/cloud/gcp" - DOCKER_REGISTRY: "docker.elastic.co" steps: - label: "Integration tests" key: "integration-tests" - command: ".buildkite/scripts/integration_tests.sh" + command: ".buildkite/scripts/steps/tests/integration.sh" branches: "main" artifact_paths: - "build/TEST-**" diff --git a/.buildkite/pull-requests.json b/.buildkite/pull-requests.json index 1dda16adce6..a5d1f07a732 100644 --- a/.buildkite/pull-requests.json +++ b/.buildkite/pull-requests.json @@ -31,22 +31,6 @@ "skip_target_branches": [ ], "skip_ci_on_only_changed": [ ], "always_require_ci_on_changed": [ ] - }, - { - "enabled": true, - "pipelineSlug": "package-core", - "allow_org_users": true, - "allowed_repo_permissions": ["admin", "write"], - "allowed_list": [], - "set_commit_status": false, - "build_on_commit": false, - "build_on_comment": true, - "trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:packageCore)\\W+(?:this|it))|^/packageCore$", - "always_trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:packageCore)\\W+(?:this|it))|^/packageCore$", - "skip_ci_labels": [ ], - "skip_target_branches": [ ], - "skip_ci_on_only_changed": [ ], - "always_require_ci_on_changed": [ ] } ] } diff --git a/.buildkite/scripts/common/download_artifact.sh b/.buildkite/scripts/common/download_artifact.sh deleted file mode 100755 index 09f2d9e978a..00000000000 --- a/.buildkite/scripts/common/download_artifact.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env bash - -set -euo pipefail - -source "$(dirname "$0")/util.sh" -download_artifact "$@" diff --git a/.buildkite/scripts/common/env.sh b/.buildkite/scripts/common/env.sh index 5141253efa1..e4f7896d4cf 100755 --- a/.buildkite/scripts/common/env.sh +++ b/.buildkite/scripts/common/env.sh @@ -14,3 +14,4 @@ fi export GO_VERSION export BEAT_VERSION=$(grep -oe "\d.\d.\d[-\w\d]*" ${WORKSPACE}/version/version.go) export ELASTIC_AGENT_BASE_BRANCH=main +export VAULT_PATH="kv/ci-shared/observability-ingest/cloud/gcp" diff --git a/.buildkite/scripts/integration_tests.sh b/.buildkite/scripts/integration_tests.sh deleted file mode 100755 index 3c6432b93b0..00000000000 --- a/.buildkite/scripts/integration_tests.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env bash -set -euxo pipefail - -# Install Go TODO: mode to makefile -if ! command -v go &>/dev/null; then - echo "Go is not installed. Installing Go..." - export GO_VERSION=`cat .go-version` - curl -O https://dl.google.com/go/go$GO_VERSION.linux-amd64.tar.gz - sudo tar -xf go$GO_VERSION.linux-amd64.tar.gz -C /usr/local - echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.bashrc - source ~/.bashrc - mkdir $HOME/go - mkdir $HOME/go/bin - export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin - echo "Go has been installed." -else - echo "Go is already installed." -fi - -# Install mage -make mage - -# PACKAGE -DEV=true EXTERNAL=true SNAPSHOT=true PLATFORMS=linux/amd64,linux/arm64 PACKAGES=tar.gz mage package - -# Run integration tests -set +e -SNAPSHOT=true mage integration:test -TESTS_EXIT_STATUS=$? -set -e - -# HTML report -go install github.com/alexec/junit2html@latest -junit2html < build/TEST-go-integration.xml > build/TEST-report.html - -exit $TESTS_EXIT_STATUS diff --git a/.buildkite/scripts/steps/tests/env.sh b/.buildkite/scripts/steps/tests/env.sh new file mode 100755 index 00000000000..699a14c6359 --- /dev/null +++ b/.buildkite/scripts/steps/tests/env.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +set -euo pipefail + +export DEV=true +export EXTERNAL=true +export SNAPSHOT=true +export PLATFORMS=linux/amd64,linux/arm64 +export PACKAGES=tar.gz diff --git a/.buildkite/scripts/steps/tests/integration.sh b/.buildkite/scripts/steps/tests/integration.sh new file mode 100755 index 00000000000..0937557006d --- /dev/null +++ b/.buildkite/scripts/steps/tests/integration.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash +set -euxo pipefail + +.buildkite/scripts/bootstrap.sh + +source .buildkite/scripts/steps/tests/env.sh + +# Install mage +make mage + +# PACKAGE +mage package + +# Run integration tests +set +e +mage integration:test +TESTS_EXIT_STATUS=$? +set -e + +# HTML report +go install github.com/alexec/junit2html@latest +junit2html < build/TEST-go-integration.xml > build/TEST-report.html + +exit $TESTS_EXIT_STATUS