Skip to content

Commit 099a5c9

Browse files
authored
Update .travis.yml to account for 9.x / main (#1220)
Tests were failing in this plugin, this commit fixes that by: * Allowing for 9.next to not exist but still mark the build as green * Fixing a test related to metrics of a partially failed bulk by writing to a random index instead of the logs- stream (which has failure store enabled by default) * Adding main to secure integration testing.
1 parent 8eac7ce commit 099a5c9

File tree

3 files changed

+16
-13
lines changed

3 files changed

+16
-13
lines changed

.ci/docker-setup.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ pull_docker_snapshot() {
1212
if docker pull "$docker_image" ; then
1313
echo "docker pull successful"
1414
else
15-
case "$ELASTIC_STACK_VERSION_ARG" in
16-
"8.previous"|"8.current"|"8.next")
17-
exit 1
15+
case $stack_version_alias in
16+
"8.previous"|"8.current"|"9.previous"|"9.current"|"9.next")
17+
exit 99
1818
;;
1919
*)
2020
exit 2
@@ -27,7 +27,7 @@ VERSION_URL="https://raw.githubusercontent.com/elastic/logstash/main/ci/logstash
2727

2828
if [ -z "${ELASTIC_STACK_VERSION}" ]; then
2929
echo "Please set the ELASTIC_STACK_VERSION environment variable"
30-
echo "For example: export ELASTIC_STACK_VERSION=7.x"
30+
echo "For example: export ELASTIC_STACK_VERSION=9.x"
3131
exit 1
3232
fi
3333

@@ -50,10 +50,10 @@ if [[ "$ELASTIC_STACK_RETRIEVED_VERSION" != "null" ]]; then
5050
ELASTIC_STACK_RETRIEVED_VERSION="${ELASTIC_STACK_RETRIEVED_VERSION#\"}"
5151
echo "Translated $ELASTIC_STACK_VERSION to ${ELASTIC_STACK_RETRIEVED_VERSION}"
5252
export ELASTIC_STACK_VERSION=$ELASTIC_STACK_RETRIEVED_VERSION
53-
elif [[ "$ELASTIC_STACK_VERSION" == "8.next" ]]; then
54-
# we know "8.next" only exists between FF and GA of a minor
55-
# exit 1 so the build is skipped
56-
exit 1
53+
elif [[ "$ELASTIC_STACK_VERSION" == "9.next" ]]; then
54+
# we know "9.next" only exists between FF and GA of a minor
55+
# exit 99 so the build is skipped
56+
exit 99
5757
fi
5858

5959
case "${DISTRIBUTION}" in

.travis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ jobs:
1111
- env: INTEGRATION=true SNAPSHOT=true LOG_LEVEL=info ELASTIC_STACK_VERSION=7.current
1212
- env: INTEGRATION=true SNAPSHOT=true LOG_LEVEL=info ELASTIC_STACK_VERSION=8.previous
1313
- env: INTEGRATION=true SNAPSHOT=true LOG_LEVEL=info ELASTIC_STACK_VERSION=8.current
14-
- env: INTEGRATION=true SNAPSHOT=true LOG_LEVEL=info ELASTIC_STACK_VERSION=8.next
15-
- env: INTEGRATION=true SNAPSHOT=true LOG_LEVEL=info ELASTIC_STACK_VERSION=9.next
14+
- env: INTEGRATION=true SNAPSHOT=true LOG_LEVEL=info ELASTIC_STACK_VERSION=9.current
1615
- env: INTEGRATION=true SNAPSHOT=true LOG_LEVEL=info ELASTIC_STACK_VERSION=main
1716
- stage: "Secure Integration Tests"
1817
env: SECURE_INTEGRATION=true INTEGRATION=true LOG_LEVEL=info ELASTIC_STACK_VERSION=7.current
@@ -22,5 +21,6 @@ jobs:
2221
- env: SECURE_INTEGRATION=true INTEGRATION=true LOG_LEVEL=info ELASTIC_STACK_VERSION=9.current
2322
- env: SECURE_INTEGRATION=true INTEGRATION=true LOG_LEVEL=info ELASTIC_STACK_VERSION=9.current ES_SSL_KEY_INVALID=true
2423
- env: SECURE_INTEGRATION=true INTEGRATION=true LOG_LEVEL=info ELASTIC_STACK_VERSION=9.current ES_SSL_SUPPORTED_PROTOCOLS=TLSv1.3
25-
- env: SECURE_INTEGRATION=true INTEGRATION=true LOG_LEVEL=info SNAPSHOT=true ELASTIC_STACK_VERSION=8.next
26-
- env: SECURE_INTEGRATION=true INTEGRATION=true LOG_LEVEL=info SNAPSHOT=true ELASTIC_STACK_VERSION=9.next
24+
- env: SECURE_INTEGRATION=true INTEGRATION=true LOG_LEVEL=info SNAPSHOT=true ELASTIC_STACK_VERSION=8.current
25+
- env: SECURE_INTEGRATION=true INTEGRATION=true LOG_LEVEL=info SNAPSHOT=true ELASTIC_STACK_VERSION=9.current
26+
- env: SECURE_INTEGRATION=true INTEGRATION=true LOG_LEVEL=info SNAPSHOT=true ELASTIC_STACK_VERSION=main

spec/integration/outputs/metrics_spec.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55
require "logstash/outputs/elasticsearch"
66
settings = {
77
"manage_template" => false,
8-
"hosts" => "#{get_host_port()}"
8+
"hosts" => "#{get_host_port()}",
9+
# write data to a random non templated index to ensure the bulk partially fails
10+
# don't use streams like "logs-*" as those have failure stores enabled, causing the bulk to succeed instead
11+
"index" => "custom_index_#{rand(10000)}"
912
}
1013
plugin = LogStash::Outputs::ElasticSearch.new(settings)
1114
end

0 commit comments

Comments
 (0)