Skip to content

Commit

Permalink
[CI] Agentbeat integration testing (#40380)
Browse files Browse the repository at this point in the history
* [CI] Agentbeat integration testing

* Split packaging and integration test

* Fix artifacts path

* Added NodeJS version

* docker compose replace --no-ansi with --ansi never

* Mistype

* Removed metricbeat from agentbeat's GoIntegTest
  • Loading branch information
pazone authored Aug 13, 2024
1 parent 08342bb commit 7c82c86
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 2 deletions.
36 changes: 36 additions & 0 deletions .buildkite/x-pack/pipeline.xpack.agentbeat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,39 @@ steps:
notify:
- github_commit_status:
context: "agentbeat: Packaging"

- 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"
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"
2 changes: 1 addition & 1 deletion libbeat/tests/compose/wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ func (d *wrapperDriver) Close() error {

func (d *wrapperDriver) cmd(ctx context.Context, command string, arg ...string) *exec.Cmd {
args := make([]string, 0, 4+len(d.Files)+len(arg)) // preallocate as much as possible
args = append(args, "--no-ansi", "--project-name", d.Name)
args = append(args, "--ansi", "never", "--project-name", d.Name)
for _, f := range d.Files {
args = append(args, "--file", f)
}
Expand Down
2 changes: 1 addition & 1 deletion x-pack/agentbeat/magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ func GoIntegTest(ctx context.Context) error {
mg.Deps(BuildSystemTestBinary)
args := devtools.DefaultGoTestIntegrationFromHostArgs()
args.Tags = append(args.Tags, "agentbeat")
args.Packages = append(args.Packages, "../auditbeat/...", "../filebeat/...", "../heartbeat/...", "../metricbeat/...", "../osquerybeat/...", "../packetbeat/...")
args.Packages = append(args.Packages, "../auditbeat/...", "../filebeat/...", "../heartbeat/...", "../osquerybeat/...", "../packetbeat/...")
return devtools.GoIntegTestFromHost(ctx, args)
}

Expand Down

0 comments on commit 7c82c86

Please sign in to comment.