Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pin agent version for integration tests #6682

Merged
merged 6 commits into from
Feb 3, 2025
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
pkoutsovasilis marked this conversation as resolved.
Show resolved Hide resolved
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
Loading