Skip to content

Commit

Permalink
ci: Fix Metricbeat test
Browse files Browse the repository at this point in the history
The naming scheme of containers created by Compose has changed in V2.

Ref. docker/compose#8655
  • Loading branch information
antoineco committed Oct 6, 2021
1 parent bd700f8 commit 1a2dbcf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/scripts/run-tests-metricbeat.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ poll_ready "$cid_mb" "http://${ip_mb}:5066/?pretty"
# agent.type:"metricbeat"
# AND event.module:"docker"
# AND event.dataset:"docker.container"
# AND container.name:"docker-elk_elasticsearch_1"
# AND container.name:"docker-elk-elasticsearch-1"
#
log 'Searching a document generated by Metricbeat'

Expand All @@ -34,7 +34,7 @@ declare -i count

# retry for max 60s (30*2s)
for _ in $(seq 1 30); do
response="$(curl "http://${ip_es}:9200/metricbeat-*/_search?q=agent.type:%22metricbeat%22%20AND%20event.module:%22docker%22%20AND%20event.dataset:%22docker.container%22%20AND%20container.name:%22docker-elk_elasticsearch_1%22&pretty" -s -u elastic:testpasswd)"
response="$(curl "http://${ip_es}:9200/metricbeat-*/_search?q=agent.type:%22metricbeat%22%20AND%20event.module:%22docker%22%20AND%20event.dataset:%22docker.container%22%20AND%20container.name:%22docker-elk-elasticsearch-1%22&pretty" -s -u elastic:testpasswd)"

set +u # prevent "unbound variable" if assigned value is not an integer
count="$(jq -rn --argjson data "${response}" '$data.hits.total.value')"
Expand Down

0 comments on commit 1a2dbcf

Please sign in to comment.