Skip to content
This repository has been archived by the owner on Sep 17, 2024. It is now read-only.

Metricbeat goal (#705) backport for 6.8.x #717

Merged
merged 1 commit into from
Feb 10, 2021
Merged
Show file tree
Hide file tree
Changes from all 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
5 changes: 0 additions & 5 deletions .ci/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -325,11 +325,6 @@ def generateFunctionalTestStep(Map args = [:]){
if(isInstalled(tool: 'docker', flag: '--version')) {
dockerLogin(secret: "${DOCKER_ELASTIC_SECRET}", registry: "${DOCKER_REGISTRY}")
}
retry(3){
dir("${BASE_DIR}"){
sh script: """.ci/scripts/install-test-dependencies.sh "${suite}" """, label: "Install test dependencies for ${suite}:${tags}"
}
}
filebeat(output: "docker_logs_${suite}_${tags}.log", workdir: "${env.WORKSPACE}"){
dir("${BASE_DIR}"){
sh script: """.ci/scripts/functional-test.sh "${suite}" "${tags}" "${stackVersion}" "${METRICBEAT_VERSION}" """, label: "Run functional tests for ${suite}:${tags}"
Expand Down
5 changes: 0 additions & 5 deletions .ci/functionalTests.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,6 @@ pipeline {
steps {
deleteDir()
unstash 'source'
retry(3){
dir("${BASE_DIR}"){
sh script: """.ci/scripts/install-test-dependencies.sh "${GO_VERSION}" """, label: "Install test dependencies for ${params.FEATURE}"
}
}
dir(BASE_DIR){
sh script: """.ci/scripts/functional-test.sh "${GO_VERSION}" "${params.FEATURE}" """, label: 'Run functional tests'
}
Expand Down
3 changes: 3 additions & 0 deletions .ci/scripts/functional-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ METRICBEAT_VERSION=${4:-'8.0.0-SNAPSHOT'}
TARGET_OS=${GOOS:-linux}
TARGET_ARCH=${GOARCH:-amd64}

## Install the required dependencies for the given SUITE
.ci/scripts/install-test-dependencies.sh "${SUITE}"

rm -rf outputs || true
mkdir -p outputs

Expand Down
10 changes: 9 additions & 1 deletion .ci/scripts/install-test-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,15 @@ SUITE=${1:?SUITE is not set}
# execute specific test dependencies if it exists
if [ -f .ci/scripts/install-${SUITE}-test-dependencies.sh ]
then
source .ci/scripts/install-${SUITE}-test-dependencies.sh
## Install the required dependencies with some retry
CI_UTILS=/usr/local/bin/bash_standard_lib.sh
if [ -e "${CI_UTILS}" ] ; then
# shellcheck disable=SC1090
source "${CI_UTILS}"
retry 3 source .ci/scripts/install-${SUITE}-test-dependencies.sh
else
source .ci/scripts/install-${SUITE}-test-dependencies.sh
fi
else
echo "Not installing test dependencies for ${SUITE}"
fi
20 changes: 20 additions & 0 deletions .ci/scripts/metricbeat-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env bash

## Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
## or more contributor license agreements. Licensed under the Elastic License;
## you may not use this file except in compliance with the Elastic License.

set -euxo pipefail
#
# Run the functional tests for metricbeat using the functional-test wrapper
#
# Parameters:
# - STACK_VERSION - that's the version of the stack to be tested. Default '8.0.0-SNAPSHOT'.
# - METRICBEAT_VERSION - that's the version of the metricbeat to be tested. Default '8.0.0-SNAPSHOT'.
#

STACK_VERSION=${1:-'8.0.0-SNAPSHOT'}
METRICBEAT_VERSION=${2:-'8.0.0-SNAPSHOT'}
Comment on lines +16 to +17
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's keep 8.0.0. There is a PR #584 that must be merged with 6.8.x after this one, updating the version

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, BTW!

SUITE='metricbeat'

.ci/scripts/functional-test.sh "${SUITE}" "" "${STACK_VERSION}" "${METRICBEAT_VERSION}"