Skip to content

Commit

Permalink
Go-based changeset definition for MODULE (#40238) (#40946)
Browse files Browse the repository at this point in the history
Added MODULE env var definition within mage
  • Loading branch information
mergify[bot] authored Sep 23, 2024
1 parent 7b6cfad commit ae12f4a
Show file tree
Hide file tree
Showing 12 changed files with 221 additions and 127 deletions.
17 changes: 2 additions & 15 deletions .buildkite/heartbeat/heartbeat-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,17 +135,9 @@ steps:
- github_commit_status:
context: "heartbeat: Win 2022 Unit Tests"

# Heartbeat has no modules
- label: ":ubuntu: Heartbeat: Go Integration Tests"
command: |
set -euo pipefail
echo "~~~ Installing @elastic/synthetics"
npm install -g @elastic/synthetics
# defines the MODULE env var based on what's changed in a PR
source .buildkite/scripts/changesets.sh
defineModuleFromTheChangeSet heartbeat
echo "~~~ Running tests"
cd heartbeat
mage goIntegTest
retry:
Expand All @@ -162,14 +154,9 @@ steps:
- github_commit_status:
context: "heartbeat: Go Integration Tests"

# Heartbeat has no modules yet
- label: ":ubuntu: Heartbeat: Python Integration Tests"
command: |
set -euo pipefail
# defines the MODULE env var based on what's changed in a PR
source .buildkite/scripts/changesets.sh
defineModuleFromTheChangeSet heartbeat
echo "~~~ Running tests"
cd heartbeat
mage pythonIntegTest
retry:
Expand Down
2 changes: 1 addition & 1 deletion .buildkite/libbeat/pipeline.libbeat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ steps:
- "libbeat/build/*.json"
notify:
- github_commit_status:
context: "libbeat: Ununtu x86_64 Unit Tests"
context: "libbeat: Ubuntu x86_64 Unit Tests"

- label: ":ubuntu: Libbeat: Go Integration Tests"
key: "mandatory-int-test"
Expand Down
17 changes: 6 additions & 11 deletions .buildkite/metricbeat/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ env:
K8S_VERSION: "v1.29.0"
ASDF_KIND_VERSION: "0.20.0"

# Module Tests
BEAT_PATH: "metricbeat"

# Other deps
ASDF_MAGE_VERSION: 1.15.0

Expand Down Expand Up @@ -80,14 +83,10 @@ steps:
- github_commit_status:
context: "metricbeat: Ubuntu x86_64 Unit Tests"

- label: ":ubuntu: Metricbeat: Go Integration Tests"
- label: ":ubuntu: Metricbeat: Go Integration Tests (Module)"
key: "mandatory-int-test"
command: |
set -euo pipefail
# defines the MODULE env var based on what's changed in a PR
source .buildkite/scripts/changesets.sh
defineModuleFromTheChangeSet metricbeat
echo "~~~ Running tests"
export KUBECONFIG="$$PWD/kubecfg"
cd metricbeat
Expand All @@ -104,16 +103,12 @@ steps:
- "metricbeat/build/*.json"
notify:
- github_commit_status:
context: "metricbeat: Go Integration Tests"
context: "metricbeat: Go Integration Tests (Module)"

- label: ":ubuntu: Metricbeat: Python Integration Tests"
- label: ":ubuntu: Metricbeat: Python Integration Tests (Module)"
key: "mandatory-python-int-test"
command: |
set -euo pipefail
# defines the MODULE env var based on what's changed in a PR
source .buildkite/scripts/changesets.sh
defineModuleFromTheChangeSet metricbeat
echo "~~~ Running tests"
export KUBECONFIG="$$PWD/kubecfg"
cd metricbeat
Expand Down
64 changes: 0 additions & 64 deletions .buildkite/scripts/changesets.psm1

This file was deleted.

12 changes: 5 additions & 7 deletions .buildkite/x-pack/pipeline.xpack.auditbeat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ env:
RACE_DETECTOR: "true"
TEST_COVERAGE: "true"

# Module tests
BEAT_PATH: "x-pack/auditbeat"

steps:
- group: "Check/Update"
key: "x-pack-auditbeat-check-update"
Expand Down Expand Up @@ -59,14 +62,9 @@ steps:
key: "x-pack-auditbeat-mandatory-tests"

steps:
- label: ":ubuntu: x-pack/auditbeat: Build Tests"
- label: ":ubuntu: x-pack/auditbeat: Build Tests (Module)"
key: "mandatory-linux-unit-test"
command: |
set -euo pipefail
# defines the MODULE env var based on what's changed in a PR
source .buildkite/scripts/changesets.sh
defineModuleFromTheChangeSet x-pack/auditbeat
echo "~~~ Running tests"
cd x-pack/auditbeat
mage update build test
retry:
Expand All @@ -81,7 +79,7 @@ steps:
- "x-pack/auditbeat/build/*.json"
notify:
- github_commit_status:
context: "x-pack/auditbeat: Build Tests"
context: "x-pack/auditbeat: Build Tests (Module)"

- label: ":rhel: x-pack/auditbeat: RHEL9 Unit Tests"
key: "mandatory-rhel9-unit-test"
Expand Down
6 changes: 1 addition & 5 deletions .buildkite/x-pack/pipeline.xpack.dockerlogbeat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,10 @@ steps:
- github_commit_status:
context: "x-pack/dockerlogbeat: Ubuntu x86_64 Unit Tests"

# x-pack/dockerlogbeat has no modules yet
- label: ":ubuntu: x-pack/dockerlogbeat: Go Integration Tests"
key: "mandatory-int-test"
command: |
set -euo pipefail
# defines the MODULE env var based on what's changed in a PR
source .buildkite/scripts/changesets.sh
defineModuleFromTheChangeSet x-pack/dockerlogbeat
echo "~~~ Running tests"
cd x-pack/dockerlogbeat
mage goIntegTest
retry:
Expand Down
27 changes: 11 additions & 16 deletions .buildkite/x-pack/pipeline.xpack.metricbeat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ env:
RACE_DETECTOR: "true"
TEST_COVERAGE: "true"

# Module tests
BEAT_PATH: "x-pack/metricbeat"

steps:
- group: "Check/Update"
key: "x-pack-metricbeat-check-update"
Expand Down Expand Up @@ -76,17 +79,13 @@ steps:
- github_commit_status:
context: "x-pack/metricbeat: Ubuntu x86_64 Unit Tests"

- label: ":ubuntu: x-pack/metricbeat: Go (MODULE) Integration Tests"
- label: ":ubuntu: x-pack/metricbeat: Go Integration Tests (Module)"
key: "mandatory-int-test"
env:
TEST_TAGS: "oracle"
command: |
set -euo pipefail
# defines the MODULE env var based on what's changed in a PR
source .buildkite/scripts/changesets.sh
defineModuleFromTheChangeSet x-pack/metricbeat
echo "~~~ Running tests"
cd x-pack/metricbeat && mage goIntegTest
cd x-pack/metricbeat
mage goIntegTest
retry:
automatic:
- limit: 3
Expand All @@ -99,19 +98,15 @@ steps:
- "x-pack/metricbeat/build/*.json"
notify:
- github_commit_status:
context: "x-pack/metricbeat: Go (MODULE) Integration Tests"
context: "x-pack/metricbeat: Go Integration Tests (Module)"

- label: ":ubuntu: x-pack/metricbeat: Python (MODULE) Integration Tests"
- label: ":ubuntu: x-pack/metricbeat: Python Integration Tests (Module)"
key: "mandatory-python-int-test"
env:
TEST_TAGS: "oracle"
command: |
set -euo pipefail
# defines the MODULE env var based on what's changed in a PR
source .buildkite/scripts/changesets.sh
defineModuleFromTheChangeSet x-pack/metricbeat
echo "~~~ Running tests"
cd x-pack/metricbeat && mage pythonIntegTest
cd x-pack/metricbeat
mage pythonIntegTest
retry:
automatic:
- limit: 3
Expand All @@ -124,7 +119,7 @@ steps:
- "x-pack/metricbeat/build/*.json"
notify:
- github_commit_status:
context: "x-pack/metricbeat: Python (MODULE) Integration Tests"
context: "x-pack/metricbeat: Python Integration Tests (Module)"

- label: ":windows: x-pack/metricbeat: Win 2016 Unit Tests"
command: |
Expand Down
9 changes: 3 additions & 6 deletions .buildkite/x-pack/pipeline.xpack.winlogbeat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,9 @@ steps:
key: "x-pack-winlogbeat-mandatory-tests"

steps:
- label: ":windows: x-pack/winlogbeat Win 2019 Unit (MODULE) Tests"
key: "mandatory-win-2019-module-unit-tests"
- label: ":windows: x-pack/winlogbeat Win 2019 Unit Tests"
key: "mandatory-win-2019-unit-tests"
command: |
Import-Module ./.buildkite/scripts/changesets.psm1
defineModuleFromTheChangeSet 'x-pack/winlogbeat'
Write-Output "~~~ Running tests"
Set-Location -Path x-pack/winlogbeat
mage build unitTest
retry:
Expand All @@ -72,7 +69,7 @@ steps:
- "x-pack/winlogbeat/build/*.json"
notify:
- github_commit_status:
context: "x-pack/winlogbeat Win 2019 Unit (MODULE) Tests"
context: "x-pack/winlogbeat Win 2019 Unit Tests"

- label: ":windows: x-pack/winlogbeat: Win 2016 Unit Tests"
command: |
Expand Down
Loading

0 comments on commit ae12f4a

Please sign in to comment.