From 1bca2e969f68ef5c2321c1a9b5c81e6a523d31d5 Mon Sep 17 00:00:00 2001 From: Joe Betz Date: Tue, 14 Nov 2017 12:17:15 -0800 Subject: [PATCH] test: Clean agent directories on disk before functional test runs, not after This is primarily so CI tooling can capture the agent logs after the functional tester runs. --- .gitignore | 1 + test | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index eb29013bc..1a68387a7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +/agent-* /coverage /covdir /gopath diff --git a/test b/test index cec89e6d7..7b89a6029 100755 --- a/test +++ b/test @@ -109,6 +109,9 @@ function integration_extra { } function functional_pass { + # Clean up any data and logs from previous runs + rm -rf ./agent-* + for a in 1 2 3; do mkdir -p ./agent-$a ./bin/etcd-agent -etcd-path ./bin/etcd -etcd-log-dir "./agent-$a" -port ":${a}9027" -use-root=false & @@ -138,7 +141,6 @@ function functional_pass { agent_pids=($agent_pids) kill -s TERM "${agent_pids[@]}" for a in "${agent_pids[@]}"; do wait "$a" || true; done - rm -rf ./agent-* if [[ "${ETCD_TESTER_EXIT_CODE}" -ne "0" ]]; then echo "--- FAIL: exit code" ${ETCD_TESTER_EXIT_CODE}