From c28c14a5f4ad2a1912534e246421efb97fee8fa2 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. Signed-off-by: Gyu-Ho Lee --- .gitignore | 1 + test | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 210be6fe9..b3c2d0154 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +/agent-* /coverage /gopath /gopath.proto diff --git a/test b/test index e2c6e5ecf..ffc9f32b3 100755 --- a/test +++ b/test @@ -93,6 +93,9 @@ function integration_pass { } 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 & @@ -121,7 +124,6 @@ function functional_pass { echo "Waiting for processes to exit" 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}