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

Metricbeat goal #705

Merged
merged 4 commits into from
Feb 8, 2021
Merged
Changes from 2 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
30 changes: 30 additions & 0 deletions .ci/scripts/metricbeat-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env bash
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you prefer a script (mainly used by the CI) or a Make goal in the e2e directory, so that developers can run them locally? There are already a few examples for fleet in that Makefile.

Copy link
Member Author

Choose a reason for hiding this comment

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

Will the retry in the CI something that could be also included in the make goal? See https://github.com/elastic/e2e-testing/pull/705/files#diff-12ed1626622bd381afb059882db321d0014a9e9e394c4ca6ff4731887d912076R20-R28

No strong opinion whether to use a sh or a make goal as long as it's just a simple call that the consumer of this project needs to care about

Copy link
Contributor

Choose a reason for hiding this comment

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

Mmm that's right: I did not look at the retry command. Well, if it's simple as it is, then I'm OK with it.

BTW, this script is needed because we need to install the dependencies, and it's done in the Jenkinsfile, right? Wdyt about simplifying the Jenkinsfile to execute the same as in the consumer, with one script? It will simplify the Jenkinsfile (less calls) and the future script will be self-contained, following same strategy as the script in this PR.

Copy link
Member Author

Choose a reason for hiding this comment

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

BTW, this script is needed because we need to install the dependencies, and it's done in the Jenkinsfile, right?

Yes

Wdyt about simplifying the Jenkinsfile to execute the same as in the consumer, with one script?

I was tempted to do so, but it might require further surgery, let me give a go

Copy link
Contributor

Choose a reason for hiding this comment

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

Let me know if we can collaborate there

Copy link
Member Author

Choose a reason for hiding this comment

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

Done, I restructure the scripts so this is now a dummy one to call the functional-test.sh with some parameters, we could even potentially remove it, though I like the idea of using this contract


## 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'}
SUITE='metricbeat'

## 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 .ci/scripts/install-test-dependencies.sh "${SUITE}"
else
.ci/scripts/install-test-dependencies.sh "${SUITE}"
fi

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