From 0041102e29ac4eab324b7434136bedf4f38dfe92 Mon Sep 17 00:00:00 2001 From: Matt Keeler Date: Thu, 5 Mar 2020 16:01:10 -0500 Subject: [PATCH] Change where the envoy snapshots get put when a test fails (#7298) This will allow us to capture them in CI --- .../primary/verify.bats | 2 +- test/integration/connect/envoy/helpers.bash | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/test/integration/connect/envoy/case-cfg-resolver-dc-failover-gateways-remote/primary/verify.bats b/test/integration/connect/envoy/case-cfg-resolver-dc-failover-gateways-remote/primary/verify.bats index 151230a571..e1e386703b 100644 --- a/test/integration/connect/envoy/case-cfg-resolver-dc-failover-gateways-remote/primary/verify.bats +++ b/test/integration/connect/envoy/case-cfg-resolver-dc-failover-gateways-remote/primary/verify.bats @@ -74,6 +74,6 @@ load helpers assert_expected_fortio_name s2-secondary } -@test "s1 upstream made 1 connection" { +@test "s1 upstream made 1 connection again" { assert_envoy_metric_at_least 127.0.0.1:19000 "cluster.s2.default.primary.*cx_total" 1 } diff --git a/test/integration/connect/envoy/helpers.bash b/test/integration/connect/envoy/helpers.bash index 4ce0a117f4..ea2a542166 100755 --- a/test/integration/connect/envoy/helpers.bash +++ b/test/integration/connect/envoy/helpers.bash @@ -179,11 +179,12 @@ function snapshot_envoy_admin { local HOSTPORT=$1 local ENVOY_NAME=$2 local DC=${3:-primary} - - - docker_wget "$DC" "http://${HOSTPORT}/config_dump" -q -O - > "./workdir/${DC}/envoy/${ENVOY_NAME}-config_dump.json" - docker_wget "$DC" "http://${HOSTPORT}/clusters?format=json" -q -O - > "./workdir/${DC}/envoy/${ENVOY_NAME}-clusters.json" - docker_wget "$DC" "http://${HOSTPORT}/stats" -q -O - > "./workdir/${DC}/envoy/${ENVOY_NAME}-stats.txt" + local OUTDIR="${LOG_DIR}/envoy-snapshots/${DC}/${ENVOY_NAME}" + + mkdir -p "${OUTDIR}" + docker_wget "$DC" "http://${HOSTPORT}/config_dump" -q -O - > "${OUTDIR}/config_dump.json" + docker_wget "$DC" "http://${HOSTPORT}/clusters?format=json" -q -O - > "${OUTDIR}/clusters.json" + docker_wget "$DC" "http://${HOSTPORT}/stats" -q -O - > "${OUTDIR}/stats.txt" } function reset_envoy_metrics {