Skip to content

Commit

Permalink
added servrless tests step
Browse files Browse the repository at this point in the history
  • Loading branch information
oakrizan committed Oct 21, 2024
1 parent 5de2287 commit f4fd92a
Showing 1 changed file with 78 additions and 40 deletions.
118 changes: 78 additions & 40 deletions .buildkite/x-pack/pipeline.xpack.agentbeat.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,32 @@
env:
ASDF_MAGE_VERSION: 1.15.0
GCP_HI_PERF_MACHINE_TYPE: "c2d-highcpu-16"
GCP_STANDARD_MACHINE_TYPE: "n1-standard-8"
IMAGE_UBUNTU_X86_64: "family/platform-ingest-beats-ubuntu-2204"

IMAGE_BEATS_WITH_HOOKS_LATEST: "docker.elastic.co/ci-agent-images/platform-ingest/buildkite-agent-beats-ci-with-hooks:latest"

steps:
- group: "Check/Update"
key: "x-pack-agentbeat-check-update"

steps:
- label: "agentbeat: Run pre-commit"
command: "pre-commit run --all-files"
agents:
image: "${IMAGE_BEATS_WITH_HOOKS_LATEST}"
memory: "2Gi"
useCustomGlobalHooks: true
notify:
- github_commit_status:
context: "agentbeat: pre-commit"

- wait: ~
# with PRs, we want to run mandatory tests only if check/update step succeed
# for other cases, e.g. merge commits, we want to run mundatory test (and publish) independently of other tests
# this allows building DRA artifacts even if there is flakiness in check/update step
if: build.env("BUILDKITE_PULL_REQUEST") != "false"
depends_on: "x-pack-agentbeat-check-update"
# - group: "Check/Update"
# key: "x-pack-agentbeat-check-update"
#
# steps:
# - label: "agentbeat: Run pre-commit"
# command: "pre-commit run --all-files"
# agents:
# image: "${IMAGE_BEATS_WITH_HOOKS_LATEST}"
# memory: "2Gi"
# useCustomGlobalHooks: true
# notify:
# - github_commit_status:
# context: "agentbeat: pre-commit"
#
# - wait: ~
# # with PRs, we want to run mandatory tests only if check/update step succeed
# # for other cases, e.g. merge commits, we want to run mundatory test (and publish) independently of other tests
# # this allows building DRA artifacts even if there is flakiness in check/update step
# if: build.env("BUILDKITE_PULL_REQUEST") != "false"
# depends_on: "x-pack-agentbeat-check-update"

- group: "Agentbeat tests"
key: "agentbeat-mandatory-tests"
Expand All @@ -35,7 +36,11 @@ steps:
key: "agentbeat-package-linux"
env:
PLATFORMS: "+all linux/amd64 linux/arm64 windows/amd64 darwin/amd64 darwin/arm64"
AGENT_PACKAGE_VERSION: 8.16.0
PACKAGES: tar.gz,zip,rpm,deb
SNAPSHOT: true
EXTERNAL: true
DEV: true
command: |
set -euo pipefail
cd x-pack/agentbeat
Expand All @@ -58,28 +63,61 @@ steps:
- github_commit_status:
context: "agentbeat: Packaging"

- label: ":linux: Agentbeat/Integration tests Linux"
key: "agentbeat-it-linux"
# - label: ":linux: Agentbeat/Integration tests Linux"
# key: "agentbeat-it-linux"
# depends_on:
# - agentbeat-package-linux
# env:
# ASDF_NODEJS_VERSION: 18.17.1
# PLATFORMS: "+all linux/amd64 linux/arm64 windows/amd64 darwin/amd64 darwin/arm64"
# SNAPSHOT: true
# command: |
# set -euo pipefail
# echo "~~~ Downloading artifacts"
# buildkite-agent artifact download x-pack/agentbeat/build/distributions/** . --step 'agentbeat-package-linux'
# ls -lah x-pack/agentbeat/build/distributions/
# echo "~~~ Installing @elastic/synthetics with npm"
# npm install -g @elastic/synthetics
# echo "~~~ Running tests"
# cd x-pack/agentbeat
# mage goIntegTest
# artifact_paths:
# - x-pack/agentbeat/build/distributions/**/*
# - "x-pack/agentbeat/build/*.xml"
# - "x-pack/agentbeat/build/*.json"
# plugins:
# - test-collector#v1.10.2:
# files: "x-pack/agentbeat/build/TEST-*.xml"
# format: "junit"
# branches: "main"
# debug: true
# retry:
# automatic:
# - limit: 1
# timeout_in_minutes: 60
# agents:
# provider: "gcp"
# image: "${IMAGE_UBUNTU_X86_64}"
# machineType: "${GCP_HI_PERF_MACHINE_TYPE}"
# disk_size: 100
# disk_type: "pd-ssd"
# notify:
# - github_commit_status:
# context: "agentbeat: Integration tests"
#
- label: ":ubuntu: Agentbeat/Serverless tests"
key: "agentbeat-serverless-linux"
depends_on:
- agentbeat-package-linux
concurrency_group: elastic-agent-extended-testing/serverless-integration
concurrency: 8
env:
ASDF_NODEJS_VERSION: 18.17.1
PLATFORMS: "+all linux/amd64 linux/arm64 windows/amd64 darwin/amd64 darwin/arm64"
SNAPSHOT: true
command: |
set -euo pipefail
echo "~~~ Downloading artifacts"
buildkite-agent artifact download x-pack/agentbeat/build/distributions/** . --step 'agentbeat-package-linux'
ls -lah x-pack/agentbeat/build/distributions/
echo "~~~ Installing @elastic/synthetics with npm"
npm install -g @elastic/synthetics
echo "~~~ Running tests"
cd x-pack/agentbeat
mage goIntegTest
TEST_INTEG_AUTH_GCP_DATACENTER: "us-central1-a"
command: echo test

artifact_paths:
- x-pack/agentbeat/build/distributions/**/*
- "x-pack/agentbeat/build/*.xml"
- "x-pack/agentbeat/build/*.json"
- x-pack/agentbeat/build/TEST-**
- x-pack/agentbeat/build/diagnostics/*
plugins:
- test-collector#v1.10.2:
files: "x-pack/agentbeat/build/TEST-*.xml"
Expand All @@ -93,9 +131,9 @@ steps:
agents:
provider: "gcp"
image: "${IMAGE_UBUNTU_X86_64}"
machineType: "${GCP_HI_PERF_MACHINE_TYPE}"
machineType: "${GCP_STANDARD_MACHINE_TYPE}"
disk_size: 100
disk_type: "pd-ssd"
notify:
- github_commit_status:
context: "agentbeat: Integration tests"
context: "agentbeat: Serverless tests"

0 comments on commit f4fd92a

Please sign in to comment.