maven_test.sh: Clean up the workspace after each test method.
This removes accidentally kept state between two test methods.
Also add a missing call to "setup_zoo" to two test methods that were relying on accidentally kept state. ;)
@@ -26,6 +26,11 @@ source "${CURRENT_DIR}/../integration_test_setup.sh" \
source "${CURRENT_DIR}/remote_helpers.sh" \
|| { echo "remote_helpers.sh not found!" >&2; exit 1; }
+function tear_down() {
+ shutdown_server
+ cleanup_workspace
+}
+
function setup_zoo() {
mkdir -p zoo
cat > zoo/BUILD <<EOF
@@ -48,10 +53,6 @@ public class BallPit {
EOF
}
-function tear_down() {
- shutdown_server
-}
-
function test_maven_jar() {
setup_zoo
serve_artifact com.example.carnivore carnivore 1.23
@@ -91,6 +92,7 @@ EOF
# Same as test_maven_jar, except omit sha1 implying "we don't care".
function test_maven_jar_no_sha1() {
+ setup_zoo
serve_artifact com.example.carnivore carnivore 1.23
cat > WORKSPACE <<EOF
@@ -108,6 +110,7 @@ EOF
# makes sure both jar and srcjar are downloaded
function test_maven_jar_downloads() {
+ setup_zoo
serve_artifact com.example.carnivore carnivore 1.23
cat > WORKSPACE <<EOF
