Skip to content

Commit 5a82530

Browse files
[8.17] (backport #7931) [ci] migrate extended runtime leak tests to buildkite (#8307)
* ci: migrate extended runtime leak tests to buildkite (#7931) (cherry picked from commit f108618) # Conflicts: # .buildkite/scripts/buildkite-integration-tests.sh # .buildkite/scripts/integration-tests.ps1 * fix: resolve conflicts * fix: remove --junitfile-hide-skipped-tests from gotestsum --------- Co-authored-by: Panos Koutsovasilis <[email protected]>
1 parent 0ad3788 commit 5a82530

File tree

5 files changed

+80
-28
lines changed

5 files changed

+80
-28
lines changed

.buildkite/bk.integration.pipeline.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,65 @@ steps:
2828
image: "docker.elastic.co/ci-agent-images/platform-ingest/buildkite-agent-beats-ci-with-hooks:0.5"
2929
useCustomGlobalHooks: true
3030

31+
- group: "Extended runtime leak tests"
32+
key: extended-integration-tests
33+
depends_on:
34+
- integration-ess
35+
steps:
36+
- label: "Windows:2022:amd64:sudo"
37+
depends_on:
38+
- packaging-windows
39+
env:
40+
TEST_LONG_RUNNING: "true"
41+
command: |
42+
buildkite-agent artifact download build/distributions/** . --step 'packaging-windows'
43+
.buildkite/scripts/integration-tests.ps1 fleet true TestLongRunningAgentForLeaks
44+
artifact_paths:
45+
- build/**
46+
- build/diagnostics/**
47+
agents:
48+
provider: "gcp"
49+
machineType: "n1-standard-8"
50+
image: "${IMAGE_WIN_2022}"
51+
retry:
52+
automatic:
53+
limit: 1
54+
- label: "Windows:2025:amd64:sudo"
55+
depends_on:
56+
- packaging-windows
57+
env:
58+
TEST_LONG_RUNNING: "true"
59+
command: |
60+
buildkite-agent artifact download build/distributions/** . --step 'packaging-windows'
61+
.buildkite/scripts/integration-tests.ps1 fleet true TestLongRunningAgentForLeaks
62+
artifact_paths:
63+
- build/**
64+
- build/diagnostics/**
65+
retry:
66+
automatic:
67+
limit: 1
68+
agents:
69+
provider: "gcp"
70+
machineType: "n1-standard-8"
71+
image: "${IMAGE_WIN_2025}"
72+
- label: "Ubuntu:2404:amd64:sudo"
73+
depends_on: packaging-ubuntu-x86-64
74+
env:
75+
TEST_LONG_RUNNING: "true"
76+
command: |
77+
buildkite-agent artifact download build/distributions/** . --step 'packaging-ubuntu-x86-64'
78+
.buildkite/scripts/steps/integration_tests_tf.sh fleet true TestLongRunningAgentForLeaks
79+
artifact_paths:
80+
- build/**
81+
- build/diagnostics/**
82+
retry:
83+
automatic:
84+
limit: 1
85+
agents:
86+
provider: "gcp"
87+
machineType: "n1-standard-8"
88+
image: "${IMAGE_UBUNTU_2404_X86_64}"
89+
3190
- group: "Stateful: Windows"
3291
key: integration-tests-win
3392
depends_on:
@@ -352,6 +411,7 @@ steps:
352411
- integration-tests-win
353412
- integration-tests-rhel8
354413
- integration-tests-kubernetes
414+
- extended-integration-tests
355415
allow_dependency_failure: true
356416
command: |
357417
buildkite-agent artifact download "test_infra/ess/**" . --step "integration-ess"

.buildkite/integration.pipeline.yml

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -110,30 +110,6 @@ steps:
110110
- github_commit_status:
111111
context: "buildkite/elastic-agent-extended-testing - Serverless integration test"
112112

113-
- label: "Extended runtime leak tests"
114-
key: "extended-integration-tests"
115-
depends_on:
116-
- int-packaging
117-
concurrency_group: elastic-agent-extended-testing/leak-tests
118-
concurrency: 8
119-
env:
120-
TEST_INTEG_AUTH_GCP_DATACENTER: "us-central1-b"
121-
command: |
122-
buildkite-agent artifact download "build/distributions/**" . $BUILDKITE_BUILD_ID
123-
.buildkite/scripts/steps/integration_tests.sh stateful integration:TestForResourceLeaks
124-
artifact_paths:
125-
- "build/TEST-**"
126-
- "build/diagnostics/*"
127-
agents:
128-
provider: "gcp"
129-
machineType: "n2-standard-8"
130-
retry:
131-
automatic:
132-
limit: 1
133-
notify:
134-
- github_commit_status:
135-
context: "buildkite/elastic-agent-extended-testing - Extended runtime leak tests"
136-
137113
- label: "Triggering Integration tests"
138114
depends_on:
139115
- int-packaging

.buildkite/scripts/buildkite-integration-tests.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
GROUP_NAME=$1
55
TEST_SUDO=$2
6+
TEST_NAME_PATTERN=${3:-""}
67

78
if [ -z "$GROUP_NAME" ]; then
89
echo "Error: Specify the group name: sudo-integration-tests.sh [group_name]" >&2
@@ -46,9 +47,15 @@ outputXML="build/${fully_qualified_group_name}.integration.xml"
4647
outputJSON="build/${fully_qualified_group_name}.integration.out.json"
4748

4849
echo "~~~ Integration tests: ${GROUP_NAME}"
50+
GOTEST_ARGS=(-tags integration -test.shuffle on -test.timeout 2h0m0s)
51+
if [ -n "$TEST_NAME_PATTERN" ]; then
52+
GOTEST_ARGS+=(-run="${TEST_NAME_PATTERN}")
53+
fi
54+
GOTEST_ARGS+=("github.com/elastic/elastic-agent/testing/integration" -v -args "-integration.groups=${GROUP_NAME}" "-integration.sudo=${TEST_SUDO}")
4955

5056
set +e
51-
TEST_BINARY_NAME="elastic-agent" AGENT_VERSION="${AGENT_VERSION}" SNAPSHOT=true gotestsum --no-color -f standard-quiet --junitfile "${outputXML}" --jsonfile "${outputJSON}" -- -tags integration -test.shuffle on -test.timeout 2h0m0s github.com/elastic/elastic-agent/testing/integration -v -args -integration.groups="${GROUP_NAME}" -integration.sudo="${TEST_SUDO}"
57+
TEST_BINARY_NAME="elastic-agent" AGENT_VERSION="${AGENT_VERSION}" SNAPSHOT=true \
58+
gotestsum --no-color -f standard-quiet --junitfile "${outputXML}" --jsonfile "${outputJSON}" -- "${GOTEST_ARGS[@]}"
5259
TESTS_EXIT_STATUS=$?
5360
set -e
5461

.buildkite/scripts/integration-tests.ps1

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
param (
22
[string]$GROUP_NAME,
3-
[string]$TEST_SUDO
3+
[string]$TEST_SUDO,
4+
[string]$TEST_NAME_PATTERN = ""
45
)
56

67
echo "~~~ Preparing environment"
@@ -42,8 +43,13 @@ $TestsExitCode = 0
4243
try {
4344
Get-Ess-Stack -StackVersion $PACKAGE_VERSION
4445
Write-Output "~~~ Running integration test group: $GROUP_NAME as user: $env:USERNAME"
45-
& gotestsum --no-color -f standard-quiet --junitfile "${outputXML}" --jsonfile "${outputJSON}" -- -tags=integration -shuffle=on -timeout=2h0m0s "github.com/elastic/elastic-agent/testing/integration" -v -args "-integration.groups=$GROUP_NAME" "-integration.sudo=$TEST_SUDO"
46-
$TestsExitCode = $LASTEXITCODE
46+
$gotestArgs = @("-tags=integration", "-shuffle=on", "-timeout=2h0m0s")
47+
if ($TEST_NAME_PATTERN -ne "") {
48+
$gotestArgs += "-run=${TEST_NAME_PATTERN}"
49+
}
50+
$gotestArgs += @("github.com/elastic/elastic-agent/testing/integration", "-v", "-args", "-integration.groups=$GROUP_NAME", "-integration.sudo=$TEST_SUDO")
51+
& gotestsum --no-color -f standard-quiet --junitfile "${outputXML}" --jsonfile "${outputJSON}" -- @gotestArgs
52+
$TestsExitCode = $LASTEXITCODE
4753
} finally {
4854
ess_down
4955

.buildkite/scripts/steps/integration_tests_tf.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ asdf install
1111

1212
GROUP_NAME=$1
1313
TEST_SUDO=$2
14+
# NOTE: This argument is not used in this script, but is declared to show that it can be set
15+
# and passed down to downstream scripts where it may be used.
16+
TEST_NAME_PATTERN=${3:-""}
1417
if [ -z "$GROUP_NAME" ]; then
1518
echo "Error: Specify the group name: integration_tests_tf.sh [group_name]" >&2
1619
exit 1

0 commit comments

Comments
 (0)