From 3df3e897b2dd116cab92474b386b8cfd64b79e37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paolo=20Chil=C3=A0?= Date: Mon, 3 Feb 2025 13:24:00 +0100 Subject: [PATCH] Pin agent version for integration tests (#6682) * pin agent version for integration tests * Force ESS stack to 9.1.0 for Integration Tests --- .buildkite/scripts/buildkite-integration-tests.sh | 7 +++++-- .buildkite/scripts/integration-tests.ps1 | 8 ++++++-- .buildkite/scripts/steps/integration-package.sh | 4 ++-- .buildkite/scripts/steps/integration_tests.sh | 3 ++- .buildkite/scripts/steps/k8s-extended-tests.sh | 2 +- .package-version | 2 +- testing/integration/upgrade_broken_package_test.go | 1 + 7 files changed, 18 insertions(+), 9 deletions(-) diff --git a/.buildkite/scripts/buildkite-integration-tests.sh b/.buildkite/scripts/buildkite-integration-tests.sh index bc509eef2b0..3642ee06b36 100755 --- a/.buildkite/scripts/buildkite-integration-tests.sh +++ b/.buildkite/scripts/buildkite-integration-tests.sh @@ -31,8 +31,11 @@ go install gotest.tools/gotestsum gotestsum --version # Parsing version.go. Will be simplified here: https://github.com/elastic/ingest-dev/issues/4925 -AGENT_VERSION=$(grep "const defaultBeatVersion =" version/version.go | cut -d\" -f2) -AGENT_VERSION="${AGENT_VERSION}-SNAPSHOT" +#AGENT_VERSION=$(grep "const defaultBeatVersion =" version/version.go | cut -d\" -f2) +#AGENT_VERSION="${AGENT_VERSION}-SNAPSHOT" + +# Remove agent pinning once 9.0.0 is released +AGENT_VERSION=9.0.0-SNAPSHOT export AGENT_VERSION echo "~~~ Agent version: ${AGENT_VERSION}" diff --git a/.buildkite/scripts/integration-tests.ps1 b/.buildkite/scripts/integration-tests.ps1 index 929b638a48d..f72354ccace 100755 --- a/.buildkite/scripts/integration-tests.ps1 +++ b/.buildkite/scripts/integration-tests.ps1 @@ -19,8 +19,12 @@ if ($PACKAGE_VERSION) { } $env:TEST_BINARY_NAME = "elastic-agent" # Parsing version.go. Will be simplified here: https://github.com/elastic/ingest-dev/issues/4925 -$AGENT_VERSION = (Get-Content version/version.go | Select-String -Pattern 'const defaultBeatVersion =' | ForEach-Object { $_ -replace '.*?"(.*?)".*', '$1' }) -$env:AGENT_VERSION = $AGENT_VERSION + "-SNAPSHOT" +# $AGENT_VERSION = (Get-Content version/version.go | Select-String -Pattern 'const defaultBeatVersion =' | ForEach-Object { $_ -replace '.*?"(.*?)".*', '$1' }) +# $env:AGENT_VERSION = $AGENT_VERSION + "-SNAPSHOT" + +# Remove agent pinning once 9.0.0 is released +$env:AGENT_VERSION = "9.0.0-SNAPSHOT" + echo "~~~ Agent version: $env:AGENT_VERSION" $env:SNAPSHOT = $true diff --git a/.buildkite/scripts/steps/integration-package.sh b/.buildkite/scripts/steps/integration-package.sh index 623a67573bc..0ba7323946b 100755 --- a/.buildkite/scripts/steps/integration-package.sh +++ b/.buildkite/scripts/steps/integration-package.sh @@ -2,5 +2,5 @@ set -euo pipefail source .buildkite/scripts/common.sh - -PACKAGES=tar.gz,zip,rpm,deb PLATFORMS=linux/amd64,linux/arm64,windows/amd64 SNAPSHOT=true EXTERNAL=true mage package +# Remove AGENT_PACKAGE_VERSION pinning as soon as 9.0.0 is released +AGENT_PACKAGE_VERSION=9.0.0 PACKAGES=tar.gz,zip,rpm,deb PLATFORMS=linux/amd64,linux/arm64,windows/amd64 SNAPSHOT=true EXTERNAL=true mage package diff --git a/.buildkite/scripts/steps/integration_tests.sh b/.buildkite/scripts/steps/integration_tests.sh index 834da1cd4c6..f779f7b214a 100755 --- a/.buildkite/scripts/steps/integration_tests.sh +++ b/.buildkite/scripts/steps/integration_tests.sh @@ -19,7 +19,8 @@ fi # Run integration tests set +e -AGENT_STACK_VERSION="${STACK_VERSION}" TEST_INTEG_CLEAN_ON_EXIT=true STACK_PROVISIONER="$STACK_PROVISIONER" SNAPSHOT=true mage $MAGE_TARGET $MAGE_SUBTARGET +# Remove AGENT_VERSION pinning as soon as the 9.0.0 is released +AGENT_VERSION=9.0.0-SNAPSHOT AGENT_STACK_VERSION="${STACK_VERSION}" TEST_INTEG_CLEAN_ON_EXIT=true STACK_PROVISIONER="$STACK_PROVISIONER" SNAPSHOT=true mage $MAGE_TARGET $MAGE_SUBTARGET TESTS_EXIT_STATUS=$? set -e diff --git a/.buildkite/scripts/steps/k8s-extended-tests.sh b/.buildkite/scripts/steps/k8s-extended-tests.sh index 8eba5ea667f..3d523afd0c4 100755 --- a/.buildkite/scripts/steps/k8s-extended-tests.sh +++ b/.buildkite/scripts/steps/k8s-extended-tests.sh @@ -26,7 +26,7 @@ else fi SNAPSHOT=true EXTERNAL=true PACKAGES=docker mage -v package -TEST_INTEG_CLEAN_ON_EXIT=true INSTANCE_PROVISIONER=kind STACK_PROVISIONER=stateful SNAPSHOT=true mage integration:kubernetesMatrix +AGENT_STACK_VERSION=9.0.0-SNAPSHOT TEST_INTEG_CLEAN_ON_EXIT=true INSTANCE_PROVISIONER=kind STACK_PROVISIONER=stateful SNAPSHOT=true mage integration:kubernetesMatrix TESTS_EXIT_STATUS=$? set -e diff --git a/.package-version b/.package-version index c9277c5a601..e977f5eae6f 100644 --- a/.package-version +++ b/.package-version @@ -1 +1 @@ -9.0.0 \ No newline at end of file +9.1.0 \ No newline at end of file diff --git a/testing/integration/upgrade_broken_package_test.go b/testing/integration/upgrade_broken_package_test.go index 5ece19ddbd8..ac50b180bbd 100644 --- a/testing/integration/upgrade_broken_package_test.go +++ b/testing/integration/upgrade_broken_package_test.go @@ -31,6 +31,7 @@ func TestUpgradeBrokenPackageVersion(t *testing.T) { Local: false, // requires Agent installation Sudo: true, // requires Agent installation }) + t.Skip("Skip this test until elastic agent version pinning is removed from Integration test runs on CI") ctx, cancel := testcontext.WithDeadline(t, context.Background(), time.Now().Add(10*time.Minute)) defer cancel()