more test efficiencies and cleanup

This commit is contained in:
Michael Hobbs
2015-04-24 14:11:45 -07:00
parent a529f6fce8
commit 0c715d4b39
12 changed files with 29 additions and 111 deletions

View File

@@ -5,19 +5,9 @@ dependencies:
cache_directories:
- "~/docker"
override:
# need to add the dokku user to the docker group
- sudo -E CI=true make -e sshcommand
- sudo usermod -G docker dokku
- sudo -E CI=true DOCKER_VERSION=1.5.0 make -e install: { timeout: 300 }
- make -e ci-dependencies
#### circle does some weird *expletive* with regards to root and gh auth (needed for gitsubmodules test)
- sudo rsync -a ~ubuntu/.ssh/ ~root/.ssh/
- sudo chown -R root:root ~root/.ssh/
- sudo sed -e 's:/home/ubuntu:/root:g' ~root/.ssh/config
####
- sudo -E make -e setup-deploy-tests
- ./tests/ci/parallel_runner.sh setup: { timeout: 300 }
post:
- sudo -E make -e lint
test:
override:
- ./tests/ci/parallel_runner.sh: { parallel: true, timeout: 1800 }
- ./tests/ci/parallel_runner.sh testing: { parallel: true, timeout: 1800 }

View File

@@ -129,7 +129,6 @@ deploy-test-static:
deploy-tests:
@echo running deploy tests...
# @$(QUIET) bats tests/deploy
@$(QUIET) $(MAKE) deploy-test-config
@$(QUIET) $(MAKE) deploy-test-clojure
@$(QUIET) $(MAKE) deploy-test-dockerfile

View File

@@ -1,25 +1,46 @@
#!/usr/bin/env bash
MODE="$1"; MODE=${MODE:="testing"}
setup_circle() {
MAKE_ENV="CI=true DOCKER_VERSION=1.5.0"
[[ "$1" == "buildstack" ]] && MAKE_ENV+=" BUILD_STACK=true "
echo "setting up with MAKE_ENV: $MAKE_ENV"
sudo -E CI=true make -e sshcommand
# need to add the dokku user to the docker group
sudo usermod -G docker dokku
#### circle does some weird *expletive* with regards to root and gh auth (needed for gitsubmodules test)
sudo rsync -a ~ubuntu/.ssh/ ~root/.ssh/
sudo chown -R root:root ~root/.ssh/
sudo sed --in-place 's:/home/ubuntu:/root:g' ~root/.ssh/config
####
sudo -E $MAKE_ENV make -e install
sudo -E make -e setup-deploy-tests
make -e ci-dependencies
}
case "$CIRCLE_NODE_INDEX" in
0)
echo "=====> make unit-tests (1/2)"
echo "=====> make unit-tests (1/2) on CIRCLE_NODE_INDEX: $CIRCLE_NODE_INDEX"
[[ "$MODE" == "setup" ]] && setup_circle && exit 0
sudo -E UNIT_TEST_BATCH=1 make -e unit-tests
;;
1)
echo "=====> make unit-tests (2/2)"
echo "=====> make unit-tests (2/2) on CIRCLE_NODE_INDEX: $CIRCLE_NODE_INDEX"
[[ "$MODE" == "setup" ]] && setup_circle && exit 0
sudo -E UNIT_TEST_BATCH=2 make -e unit-tests
;;
2)
echo "=====> make deploy-tests (buildstep release)"
echo "=====> make deploy-tests (buildstep release) on CIRCLE_NODE_INDEX: $CIRCLE_NODE_INDEX"
[[ "$MODE" == "setup" ]] && setup_circle && exit 0
sudo -E make -e deploy-tests
;;
3)
echo "=====> make deploy-tests (buildstep master)"
docker rmi -f progrium/buildstep && \
sudo -E BUILD_STACK=true make -e stack && \
echo "=====> make deploy-tests (buildstep master) on CIRCLE_NODE_INDEX: $CIRCLE_NODE_INDEX"
[[ "$MODE" == "setup" ]] && setup_circle buildstack && exit 0
sudo -E make -e deploy-tests
;;
esac

View File

@@ -1,10 +0,0 @@
#!/usr/bin/env bats
load ../unit/test_helper
@test "deploy config app" {
run bash -c "cd tests && ./test_deploy ./apps/config dokku.me"
echo "output: "$output
echo "status: "$status
assert_success
}

View File

@@ -1,10 +0,0 @@
#!/usr/bin/env bats
load ../unit/test_helper
@test "deploy gitsubmodules app" {
run bash -c "cd tests && ./test_deploy ./apps/gitsubmodules dokku.me"
echo "output: "$output
echo "status: "$status
assert_success
}

View File

@@ -1,10 +0,0 @@
#!/usr/bin/env bats
load ../unit/test_helper
@test "deploy go app" {
run bash -c "cd tests && ./test_deploy ./apps/go dokku.me"
echo "output: "$output
echo "status: "$status
assert_success
}

View File

@@ -1,10 +0,0 @@
#!/usr/bin/env bats
load ../unit/test_helper
@test "deploy java app" {
run bash -c "cd tests && ./test_deploy ./apps/java dokku.me"
echo "output: "$output
echo "status: "$status
assert_success
}

View File

@@ -1,10 +0,0 @@
#!/usr/bin/env bats
load ../unit/test_helper
@test "deploy multi app" {
run bash -c "cd tests && ./test_deploy ./apps/multi dokku.me"
echo "output: "$output
echo "status: "$status
assert_success
}

View File

@@ -1,10 +0,0 @@
#!/usr/bin/env bats
load ../unit/test_helper
@test "deploy nodejs-express app" {
run bash -c "cd tests && ./test_deploy ./apps/nodejs-express dokku.me"
echo "output: "$output
echo "status: "$status
assert_success
}

View File

@@ -1,11 +0,0 @@
#!/usr/bin/env bats
load ../unit/test_helper
@test "deploy php app" {
skip "fails. ref: https://github.com/progrium/buildstep/issues/126"
run bash -c "cd tests && ./test_deploy ./apps/php dokku.me"
echo "output: "$output
echo "status: "$status
assert_success
}

View File

@@ -1,10 +0,0 @@
#!/usr/bin/env bats
load ../unit/test_helper
@test "deploy python-flask app" {
run bash -c "cd tests && ./test_deploy ./apps/python-flask dokku.me"
echo "output: "$output
echo "status: "$status
assert_success
}

View File

@@ -1,11 +0,0 @@
#!/usr/bin/env bats
load ../unit/test_helper
@test "deploy static app" {
skip "fails on apt-get update..."
run bash -c "cd tests && ./test_deploy ./apps/static dokku.me"
echo "output: "$output
echo "status: "$status
assert_success
}