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

Commit

Permalink
Metricbeat goal (#705) backport for 7.11.x (#715)
Browse files Browse the repository at this point in the history
* Metricbeat goal (#717 
* Update .ci/scripts/metricbeat-test.sh
  • Loading branch information
v1v authored Feb 9, 2021
1 parent f7794e0 commit 3c7e93f
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 11 deletions.
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:-'7.11.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:-'7.11.0-SNAPSHOT'}
METRICBEAT_VERSION=${2:-'7.11.0-SNAPSHOT'}
SUITE='metricbeat'

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

0 comments on commit 3c7e93f

Please sign in to comment.