Skip to content

Commit

Permalink
Pin agent version for integration tests (#6682)
Browse files Browse the repository at this point in the history
* pin agent version for integration tests
* Force ESS stack to 9.1.0 for Integration Tests
  • Loading branch information
pchila authored Feb 3, 2025
1 parent 87360e6 commit 3df3e89
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 9 deletions.
7 changes: 5 additions & 2 deletions .buildkite/scripts/buildkite-integration-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"

Expand Down
8 changes: 6 additions & 2 deletions .buildkite/scripts/integration-tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions .buildkite/scripts/steps/integration-package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 2 additions & 1 deletion .buildkite/scripts/steps/integration_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion .buildkite/scripts/steps/k8s-extended-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion .package-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9.0.0
9.1.0
1 change: 1 addition & 0 deletions testing/integration/upgrade_broken_package_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 3df3e89

Please sign in to comment.