Merge pull request #3360 from dokku/upgrade-bats

Switch to bats-core
This commit is contained in:
Jose Diaz-Gonzalez
2018-12-29 07:21:51 -05:00
committed by GitHub
5 changed files with 21 additions and 16 deletions

View File

@@ -58,15 +58,15 @@ ifeq ($(shell grep dokku.me /home/dokku/VHOST 2>/dev/null),)
endif
bats:
ifneq ($(shell bats --version > /dev/null 2>&1 ; echo $$?),0)
ifeq ($(SYSTEM),Darwin)
brew install bats
ifneq ($(shell bats --version > /dev/null 2>&1 ; echo $$?),0)
brew install bats-core
endif
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
rm -rf /tmp/bats
endif
endif
lint:
# these are disabled due to their expansive existence in the codebase. we should clean it up though

View File

@@ -41,14 +41,14 @@ teardown() {
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"
echo "output: $output"
echo "status: $status"
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"
echo "output: $output"
echo "status: $status"

View File

@@ -12,7 +12,7 @@ teardown() {
global_teardown
}
# @test "(ps) dockerfile" {
# @test "(ps) dockerfile base" {
# # CI support: 'Ah. I just spoke with our Docker expert --
# # 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

View File

@@ -13,12 +13,17 @@ teardown() {
global_teardown
}
@test "(ps) herokuish" {
run /bin/bash -c "dokku ps $TEST_APP | grep -q \"node web.js\""
echo "output: $output"
echo "status: $status"
assert_success
}
# @test "(ps) herokuish base" {
# # CI support: 'Ah. I just spoke with our Docker expert --
# # 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
# 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" {
deploy_app

View File

@@ -43,7 +43,7 @@ assert_error_log() {
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
add_domain "node-js-app.dokku.me"
add_domain "test.dokku.me"
@@ -62,7 +62,7 @@ assert_error_log() {
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
TEST_APP="${TEST_APP}.example.com"
setup_test_tls wildcard
@@ -82,7 +82,7 @@ assert_error_log() {
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
add_domain "wildcard1.dokku.me"
add_domain "wildcard2.dokku.me"