tests: switch to bats-core
This switches from the older, unmaintained version of bats to one that _is_ maintained. In particular, this fork of the community version - bats-core/bats-core - adds junit timing support, which can be used to track down slow tests. Once the bats-core/bats-core repository merges junit support, we will switch back to upstream. Note that tests on OS X will still run using a version that _does not_ have junit timing support.
This commit is contained in:
8
tests.mk
8
tests.mk
@@ -58,15 +58,15 @@ ifeq ($(shell grep dokku.me /home/dokku/VHOST 2>/dev/null),)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
bats:
|
bats:
|
||||||
ifneq ($(shell bats --version > /dev/null 2>&1 ; echo $$?),0)
|
|
||||||
ifeq ($(SYSTEM),Darwin)
|
ifeq ($(SYSTEM),Darwin)
|
||||||
brew install bats
|
ifneq ($(shell bats --version > /dev/null 2>&1 ; echo $$?),0)
|
||||||
|
brew install bats-core
|
||||||
|
endif
|
||||||
else
|
else
|
||||||
git clone https://github.com/sstephenson/bats.git /tmp/bats
|
git clone https://github.com/josegonzalez/bats-core.git /tmp/bats
|
||||||
cd /tmp/bats && sudo ./install.sh /usr/local
|
cd /tmp/bats && sudo ./install.sh /usr/local
|
||||||
rm -rf /tmp/bats
|
rm -rf /tmp/bats
|
||||||
endif
|
endif
|
||||||
endif
|
|
||||||
|
|
||||||
lint:
|
lint:
|
||||||
# these are disabled due to their expansive existence in the codebase. we should clean it up though
|
# these are disabled due to their expansive existence in the codebase. we should clean it up though
|
||||||
|
|||||||
@@ -41,14 +41,14 @@ teardown() {
|
|||||||
assert_success
|
assert_success
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "(certs) certs:add < tar" {
|
@test "(certs) certs:add tar:in" {
|
||||||
run /bin/bash -c "dokku certs:add $TEST_APP < $BATS_TEST_DIRNAME/server_ssl.tar"
|
run /bin/bash -c "dokku certs:add $TEST_APP < $BATS_TEST_DIRNAME/server_ssl.tar"
|
||||||
echo "output: $output"
|
echo "output: $output"
|
||||||
echo "status: $status"
|
echo "status: $status"
|
||||||
assert_success
|
assert_success
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "(certs) certs:add < tar should ignore OSX hidden files" {
|
@test "(certs) certs:add tar:in should ignore OSX hidden files" {
|
||||||
run /bin/bash -c "dokku certs:add $TEST_APP < $BATS_TEST_DIRNAME/osx_ssl_tarred.tar"
|
run /bin/bash -c "dokku certs:add $TEST_APP < $BATS_TEST_DIRNAME/osx_ssl_tarred.tar"
|
||||||
echo "output: $output"
|
echo "output: $output"
|
||||||
echo "status: $status"
|
echo "status: $status"
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ teardown() {
|
|||||||
global_teardown
|
global_teardown
|
||||||
}
|
}
|
||||||
|
|
||||||
# @test "(ps) dockerfile" {
|
# @test "(ps) dockerfile base" {
|
||||||
# # CI support: 'Ah. I just spoke with our Docker expert --
|
# # CI support: 'Ah. I just spoke with our Docker expert --
|
||||||
# # looks like docker exec is built to work with docker-under-libcontainer,
|
# # looks like docker exec is built to work with docker-under-libcontainer,
|
||||||
# # but we're using docker-under-lxc. I don't have an estimated time for the fix, sorry
|
# # but we're using docker-under-lxc. I don't have an estimated time for the fix, sorry
|
||||||
|
|||||||
@@ -13,12 +13,17 @@ teardown() {
|
|||||||
global_teardown
|
global_teardown
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "(ps) herokuish" {
|
# @test "(ps) herokuish base" {
|
||||||
run /bin/bash -c "dokku ps $TEST_APP | grep -q \"node web.js\""
|
# # CI support: 'Ah. I just spoke with our Docker expert --
|
||||||
echo "output: $output"
|
# # looks like docker exec is built to work with docker-under-libcontainer,
|
||||||
echo "status: $status"
|
# # but we're using docker-under-lxc. I don't have an estimated time for the fix, sorry
|
||||||
assert_success
|
# skip "circleci does not support docker exec at the moment."
|
||||||
}
|
# deploy_app
|
||||||
|
# run /bin/bash -c "dokku ps $TEST_APP | grep -q \"node web.js\""
|
||||||
|
# echo "output: $output"
|
||||||
|
# echo "status: $status"
|
||||||
|
# assert_success
|
||||||
|
# }
|
||||||
|
|
||||||
@test "(ps) herokuish" {
|
@test "(ps) herokuish" {
|
||||||
deploy_app
|
deploy_app
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ assert_error_log() {
|
|||||||
assert_error_log ${TEST_APP}
|
assert_error_log ${TEST_APP}
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "(nginx-vhosts) nginx:build-config (with SSL & unrelated domain)" {
|
@test "(nginx-vhosts) nginx:build-config (with SSL and unrelated domain)" {
|
||||||
setup_test_tls
|
setup_test_tls
|
||||||
add_domain "node-js-app.dokku.me"
|
add_domain "node-js-app.dokku.me"
|
||||||
add_domain "test.dokku.me"
|
add_domain "test.dokku.me"
|
||||||
@@ -62,7 +62,7 @@ assert_error_log() {
|
|||||||
assert_ssl_domain "wildcard2.dokku.me"
|
assert_ssl_domain "wildcard2.dokku.me"
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "(nginx-vhosts) nginx:build-config (wildcard SSL & unrelated domain)" {
|
@test "(nginx-vhosts) nginx:build-config (wildcard SSL and unrelated domain)" {
|
||||||
destroy_app
|
destroy_app
|
||||||
TEST_APP="${TEST_APP}.example.com"
|
TEST_APP="${TEST_APP}.example.com"
|
||||||
setup_test_tls wildcard
|
setup_test_tls wildcard
|
||||||
@@ -82,7 +82,7 @@ assert_error_log() {
|
|||||||
assert_ssl_domain "www.test.app.dokku.me"
|
assert_ssl_domain "www.test.app.dokku.me"
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "(nginx-vhosts) nginx:build-config (wildcard SSL & custom nginx template)" {
|
@test "(nginx-vhosts) nginx:build-config (wildcard SSL and custom nginx template)" {
|
||||||
setup_test_tls wildcard
|
setup_test_tls wildcard
|
||||||
add_domain "wildcard1.dokku.me"
|
add_domain "wildcard1.dokku.me"
|
||||||
add_domain "wildcard2.dokku.me"
|
add_domain "wildcard2.dokku.me"
|
||||||
|
|||||||
Reference in New Issue
Block a user