From dbd8aef32995d799c45c8d29c8fba3abd3de96ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Thu, 15 Oct 2020 18:18:05 +0200 Subject: [PATCH] fix: use base version for metricbeat (#368) * fix: use base version for PRs * chore: reuse value * fix: do not override environmental metricbeat version --- e2e/Makefile | 2 -- e2e/_suites/fleet/services.go | 2 +- e2e/_suites/fleet/stand-alone.go | 2 +- e2e/_suites/metricbeat/metricbeat_test.go | 8 +++++++- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/e2e/Makefile b/e2e/Makefile index 99864dd679..c80c33a508 100644 --- a/e2e/Makefile +++ b/e2e/Makefile @@ -6,7 +6,6 @@ LOG_INCLUDE_TIMESTAMP?=TRUE LOG_LEVEL?=INFO TIMEOUT_FACTOR?=3 STACK_VERSION?= -METRICBEAT_VERSION?= PICKLES_VERSION?="2.20.1" VERSION_VALUE=`cat ../cli/VERSION.txt` @@ -47,7 +46,6 @@ functional-test: install-godog OP_LOG_LEVEL=${LOG_LEVEL} \ OP_LOG_INCLUDE_TIMESTAMP=${LOG_INCLUDE_TIMESTAMP} \ TIMEOUT_FACTOR=${TIMEOUT_FACTOR} \ - METRICBEAT_VERSION=${METRICBEAT_VERSION} \ STACK_VERSION=${STACK_VERSION} \ DEVELOPER_MODE=${DEVELOPER_MODE} \ godog --format=${FORMAT} ${TAGS_FLAG} "${TAGS}" diff --git a/e2e/_suites/fleet/services.go b/e2e/_suites/fleet/services.go index 0bd851376e..95f582bd8f 100644 --- a/e2e/_suites/fleet/services.go +++ b/e2e/_suites/fleet/services.go @@ -17,7 +17,7 @@ const agentVersionBase = "8.0.0-SNAPSHOT" // agentVersion is the version of the agent to use // It can be overriden by ELASTIC_AGENT_VERSION env var -var agentVersion = "8.0.0-SNAPSHOT" +var agentVersion = agentVersionBase func init() { config.Init() diff --git a/e2e/_suites/fleet/stand-alone.go b/e2e/_suites/fleet/stand-alone.go index f84780681c..046f7efb0d 100644 --- a/e2e/_suites/fleet/stand-alone.go +++ b/e2e/_suites/fleet/stand-alone.go @@ -24,7 +24,7 @@ const standAloneVersionBase = "8.0.0-SNAPSHOT" // standAloneVersion is the version of the agent to use // It can be overriden by ELASTIC_AGENT_VERSION env var -var standAloneVersion = "8.0.0-SNAPSHOT" +var standAloneVersion = standAloneVersionBase func init() { config.Init() diff --git a/e2e/_suites/metricbeat/metricbeat_test.go b/e2e/_suites/metricbeat/metricbeat_test.go index df6596f567..eaec2ec211 100644 --- a/e2e/_suites/metricbeat/metricbeat_test.go +++ b/e2e/_suites/metricbeat/metricbeat_test.go @@ -27,9 +27,11 @@ import ( // It can be overriden by the DEVELOPER_MODE env var var developerMode = false +const metricbeatVersionBase = "8.0.0-SNAPSHOT" + // metricbeatVersion is the version of the metricbeat to use // It can be overriden by METRICBEAT_VERSION env var -var metricbeatVersion = "8.0.0-SNAPSHOT" +var metricbeatVersion = metricbeatVersionBase // timeoutFactor a multiplier for the max timeout when doing backoff retries. // It can be overriden by TIMEOUT_FACTOR env var @@ -241,6 +243,10 @@ func (mts *MetricbeatTestSuite) installedAndConfiguredForVariantModule(serviceVa } func (mts *MetricbeatTestSuite) installedUsingConfiguration(configuration string) error { + if strings.HasPrefix(metricbeatVersion, "pr-") { + metricbeatVersion = metricbeatVersionBase + } + // at this point we have everything to define the index name mts.Version = metricbeatVersion mts.setIndexName()