From c600fc36ca735f9ba67001f73918eda88cd28f02 Mon Sep 17 00:00:00 2001 From: Chad Metcalf Date: Sat, 8 Aug 2020 14:16:20 -0700 Subject: [PATCH] Use assert_success from the bats-assert library. [ "$status" -eq 0 ] just bails out and its up to you to figure out why. $output has the stdout/stderr so we could just print that. I think its worth vendoring the libraries and just using those functions. Signed-off-by: Chad Metcalf --- angular/test.bats | 13 +++++++------ apache-php/test.bats | 13 +++++++------ aspnet-mssql/test.bats | 13 +++++++------ django/test.bats | 13 +++++++------ elasticsearch-logstash-kibana/test.bats | 13 +++++++------ flask/test.bats | 13 +++++++------ gitea-postgres/test.bats | 13 +++++++------ lib/test.bats.example | 13 +++++++------ nextcloud-postgres/test.bats | 13 +++++++------ nextcloud-redis-mariadb/test.bats | 13 +++++++------ nginx-flask-mongo/test.bats | 13 +++++++------ nginx-flask-mysql/test.bats | 13 +++++++------ nginx-golang-mysql/test.bats | 13 +++++++------ nginx-golang-postgres/test.bats | 13 +++++++------ nginx-golang/test.bats | 13 +++++++------ prometheus-grafana/test.bats | 13 +++++++------ react-express-mongodb/test.bats | 13 +++++++------ react-express-mysql/test.bats | 13 +++++++------ react-java-mysql/test.bats | 13 +++++++------ react-rust-postgres/test.bats | 13 +++++++------ sparkjava-mysql/test.bats | 13 +++++++------ sparkjava/test.bats | 13 +++++++------ spring-postgres/test.bats | 13 +++++++------ traefik-golang/test.bats | 13 +++++++------ vuejs/test.bats | 13 +++++++------ wordpress-mysql/test.bats | 13 +++++++------ 26 files changed, 182 insertions(+), 156 deletions(-) diff --git a/angular/test.bats b/angular/test.bats index 04970f8..e8409dc 100644 --- a/angular/test.bats +++ b/angular/test.bats @@ -1,6 +1,8 @@ #!/usr/bin/env bats load '../lib/test_helper.bash' +load '../lib/bats-support/load.bash' +load '../lib/bats-assert/load.bash' cd ${BATS_TEST_DIRNAME} @@ -15,18 +17,17 @@ function teardown_file() { @test "$(basename ${BATS_TEST_DIRNAME}): pull check" { run docker-compose pull - [ "${status}" -eq 0 ] + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): build check" { run docker-compose build - [ "${status}" -eq 0 ] + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): up check" { run docker-compose up -d - [ "${status}" -eq 0 ] - + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): ports check" { @@ -49,10 +50,10 @@ function teardown_file() { if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then run nc -z -v localhost "${port}" - [ "${status}" -eq 0 ] + assert_success elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then run nc -z -v -u localhost "${port}" - [ "${status}" -eq 0 ] + assert_success fi done diff --git a/apache-php/test.bats b/apache-php/test.bats index 04970f8..e8409dc 100644 --- a/apache-php/test.bats +++ b/apache-php/test.bats @@ -1,6 +1,8 @@ #!/usr/bin/env bats load '../lib/test_helper.bash' +load '../lib/bats-support/load.bash' +load '../lib/bats-assert/load.bash' cd ${BATS_TEST_DIRNAME} @@ -15,18 +17,17 @@ function teardown_file() { @test "$(basename ${BATS_TEST_DIRNAME}): pull check" { run docker-compose pull - [ "${status}" -eq 0 ] + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): build check" { run docker-compose build - [ "${status}" -eq 0 ] + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): up check" { run docker-compose up -d - [ "${status}" -eq 0 ] - + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): ports check" { @@ -49,10 +50,10 @@ function teardown_file() { if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then run nc -z -v localhost "${port}" - [ "${status}" -eq 0 ] + assert_success elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then run nc -z -v -u localhost "${port}" - [ "${status}" -eq 0 ] + assert_success fi done diff --git a/aspnet-mssql/test.bats b/aspnet-mssql/test.bats index 04970f8..e8409dc 100644 --- a/aspnet-mssql/test.bats +++ b/aspnet-mssql/test.bats @@ -1,6 +1,8 @@ #!/usr/bin/env bats load '../lib/test_helper.bash' +load '../lib/bats-support/load.bash' +load '../lib/bats-assert/load.bash' cd ${BATS_TEST_DIRNAME} @@ -15,18 +17,17 @@ function teardown_file() { @test "$(basename ${BATS_TEST_DIRNAME}): pull check" { run docker-compose pull - [ "${status}" -eq 0 ] + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): build check" { run docker-compose build - [ "${status}" -eq 0 ] + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): up check" { run docker-compose up -d - [ "${status}" -eq 0 ] - + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): ports check" { @@ -49,10 +50,10 @@ function teardown_file() { if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then run nc -z -v localhost "${port}" - [ "${status}" -eq 0 ] + assert_success elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then run nc -z -v -u localhost "${port}" - [ "${status}" -eq 0 ] + assert_success fi done diff --git a/django/test.bats b/django/test.bats index 04970f8..e8409dc 100644 --- a/django/test.bats +++ b/django/test.bats @@ -1,6 +1,8 @@ #!/usr/bin/env bats load '../lib/test_helper.bash' +load '../lib/bats-support/load.bash' +load '../lib/bats-assert/load.bash' cd ${BATS_TEST_DIRNAME} @@ -15,18 +17,17 @@ function teardown_file() { @test "$(basename ${BATS_TEST_DIRNAME}): pull check" { run docker-compose pull - [ "${status}" -eq 0 ] + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): build check" { run docker-compose build - [ "${status}" -eq 0 ] + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): up check" { run docker-compose up -d - [ "${status}" -eq 0 ] - + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): ports check" { @@ -49,10 +50,10 @@ function teardown_file() { if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then run nc -z -v localhost "${port}" - [ "${status}" -eq 0 ] + assert_success elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then run nc -z -v -u localhost "${port}" - [ "${status}" -eq 0 ] + assert_success fi done diff --git a/elasticsearch-logstash-kibana/test.bats b/elasticsearch-logstash-kibana/test.bats index 04970f8..e8409dc 100644 --- a/elasticsearch-logstash-kibana/test.bats +++ b/elasticsearch-logstash-kibana/test.bats @@ -1,6 +1,8 @@ #!/usr/bin/env bats load '../lib/test_helper.bash' +load '../lib/bats-support/load.bash' +load '../lib/bats-assert/load.bash' cd ${BATS_TEST_DIRNAME} @@ -15,18 +17,17 @@ function teardown_file() { @test "$(basename ${BATS_TEST_DIRNAME}): pull check" { run docker-compose pull - [ "${status}" -eq 0 ] + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): build check" { run docker-compose build - [ "${status}" -eq 0 ] + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): up check" { run docker-compose up -d - [ "${status}" -eq 0 ] - + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): ports check" { @@ -49,10 +50,10 @@ function teardown_file() { if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then run nc -z -v localhost "${port}" - [ "${status}" -eq 0 ] + assert_success elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then run nc -z -v -u localhost "${port}" - [ "${status}" -eq 0 ] + assert_success fi done diff --git a/flask/test.bats b/flask/test.bats index 04970f8..e8409dc 100644 --- a/flask/test.bats +++ b/flask/test.bats @@ -1,6 +1,8 @@ #!/usr/bin/env bats load '../lib/test_helper.bash' +load '../lib/bats-support/load.bash' +load '../lib/bats-assert/load.bash' cd ${BATS_TEST_DIRNAME} @@ -15,18 +17,17 @@ function teardown_file() { @test "$(basename ${BATS_TEST_DIRNAME}): pull check" { run docker-compose pull - [ "${status}" -eq 0 ] + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): build check" { run docker-compose build - [ "${status}" -eq 0 ] + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): up check" { run docker-compose up -d - [ "${status}" -eq 0 ] - + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): ports check" { @@ -49,10 +50,10 @@ function teardown_file() { if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then run nc -z -v localhost "${port}" - [ "${status}" -eq 0 ] + assert_success elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then run nc -z -v -u localhost "${port}" - [ "${status}" -eq 0 ] + assert_success fi done diff --git a/gitea-postgres/test.bats b/gitea-postgres/test.bats index 04970f8..e8409dc 100644 --- a/gitea-postgres/test.bats +++ b/gitea-postgres/test.bats @@ -1,6 +1,8 @@ #!/usr/bin/env bats load '../lib/test_helper.bash' +load '../lib/bats-support/load.bash' +load '../lib/bats-assert/load.bash' cd ${BATS_TEST_DIRNAME} @@ -15,18 +17,17 @@ function teardown_file() { @test "$(basename ${BATS_TEST_DIRNAME}): pull check" { run docker-compose pull - [ "${status}" -eq 0 ] + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): build check" { run docker-compose build - [ "${status}" -eq 0 ] + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): up check" { run docker-compose up -d - [ "${status}" -eq 0 ] - + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): ports check" { @@ -49,10 +50,10 @@ function teardown_file() { if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then run nc -z -v localhost "${port}" - [ "${status}" -eq 0 ] + assert_success elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then run nc -z -v -u localhost "${port}" - [ "${status}" -eq 0 ] + assert_success fi done diff --git a/lib/test.bats.example b/lib/test.bats.example index 04970f8..e8409dc 100644 --- a/lib/test.bats.example +++ b/lib/test.bats.example @@ -1,6 +1,8 @@ #!/usr/bin/env bats load '../lib/test_helper.bash' +load '../lib/bats-support/load.bash' +load '../lib/bats-assert/load.bash' cd ${BATS_TEST_DIRNAME} @@ -15,18 +17,17 @@ function teardown_file() { @test "$(basename ${BATS_TEST_DIRNAME}): pull check" { run docker-compose pull - [ "${status}" -eq 0 ] + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): build check" { run docker-compose build - [ "${status}" -eq 0 ] + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): up check" { run docker-compose up -d - [ "${status}" -eq 0 ] - + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): ports check" { @@ -49,10 +50,10 @@ function teardown_file() { if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then run nc -z -v localhost "${port}" - [ "${status}" -eq 0 ] + assert_success elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then run nc -z -v -u localhost "${port}" - [ "${status}" -eq 0 ] + assert_success fi done diff --git a/nextcloud-postgres/test.bats b/nextcloud-postgres/test.bats index 04970f8..e8409dc 100644 --- a/nextcloud-postgres/test.bats +++ b/nextcloud-postgres/test.bats @@ -1,6 +1,8 @@ #!/usr/bin/env bats load '../lib/test_helper.bash' +load '../lib/bats-support/load.bash' +load '../lib/bats-assert/load.bash' cd ${BATS_TEST_DIRNAME} @@ -15,18 +17,17 @@ function teardown_file() { @test "$(basename ${BATS_TEST_DIRNAME}): pull check" { run docker-compose pull - [ "${status}" -eq 0 ] + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): build check" { run docker-compose build - [ "${status}" -eq 0 ] + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): up check" { run docker-compose up -d - [ "${status}" -eq 0 ] - + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): ports check" { @@ -49,10 +50,10 @@ function teardown_file() { if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then run nc -z -v localhost "${port}" - [ "${status}" -eq 0 ] + assert_success elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then run nc -z -v -u localhost "${port}" - [ "${status}" -eq 0 ] + assert_success fi done diff --git a/nextcloud-redis-mariadb/test.bats b/nextcloud-redis-mariadb/test.bats index 04970f8..e8409dc 100644 --- a/nextcloud-redis-mariadb/test.bats +++ b/nextcloud-redis-mariadb/test.bats @@ -1,6 +1,8 @@ #!/usr/bin/env bats load '../lib/test_helper.bash' +load '../lib/bats-support/load.bash' +load '../lib/bats-assert/load.bash' cd ${BATS_TEST_DIRNAME} @@ -15,18 +17,17 @@ function teardown_file() { @test "$(basename ${BATS_TEST_DIRNAME}): pull check" { run docker-compose pull - [ "${status}" -eq 0 ] + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): build check" { run docker-compose build - [ "${status}" -eq 0 ] + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): up check" { run docker-compose up -d - [ "${status}" -eq 0 ] - + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): ports check" { @@ -49,10 +50,10 @@ function teardown_file() { if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then run nc -z -v localhost "${port}" - [ "${status}" -eq 0 ] + assert_success elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then run nc -z -v -u localhost "${port}" - [ "${status}" -eq 0 ] + assert_success fi done diff --git a/nginx-flask-mongo/test.bats b/nginx-flask-mongo/test.bats index 04970f8..e8409dc 100644 --- a/nginx-flask-mongo/test.bats +++ b/nginx-flask-mongo/test.bats @@ -1,6 +1,8 @@ #!/usr/bin/env bats load '../lib/test_helper.bash' +load '../lib/bats-support/load.bash' +load '../lib/bats-assert/load.bash' cd ${BATS_TEST_DIRNAME} @@ -15,18 +17,17 @@ function teardown_file() { @test "$(basename ${BATS_TEST_DIRNAME}): pull check" { run docker-compose pull - [ "${status}" -eq 0 ] + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): build check" { run docker-compose build - [ "${status}" -eq 0 ] + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): up check" { run docker-compose up -d - [ "${status}" -eq 0 ] - + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): ports check" { @@ -49,10 +50,10 @@ function teardown_file() { if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then run nc -z -v localhost "${port}" - [ "${status}" -eq 0 ] + assert_success elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then run nc -z -v -u localhost "${port}" - [ "${status}" -eq 0 ] + assert_success fi done diff --git a/nginx-flask-mysql/test.bats b/nginx-flask-mysql/test.bats index 04970f8..e8409dc 100644 --- a/nginx-flask-mysql/test.bats +++ b/nginx-flask-mysql/test.bats @@ -1,6 +1,8 @@ #!/usr/bin/env bats load '../lib/test_helper.bash' +load '../lib/bats-support/load.bash' +load '../lib/bats-assert/load.bash' cd ${BATS_TEST_DIRNAME} @@ -15,18 +17,17 @@ function teardown_file() { @test "$(basename ${BATS_TEST_DIRNAME}): pull check" { run docker-compose pull - [ "${status}" -eq 0 ] + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): build check" { run docker-compose build - [ "${status}" -eq 0 ] + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): up check" { run docker-compose up -d - [ "${status}" -eq 0 ] - + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): ports check" { @@ -49,10 +50,10 @@ function teardown_file() { if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then run nc -z -v localhost "${port}" - [ "${status}" -eq 0 ] + assert_success elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then run nc -z -v -u localhost "${port}" - [ "${status}" -eq 0 ] + assert_success fi done diff --git a/nginx-golang-mysql/test.bats b/nginx-golang-mysql/test.bats index 04970f8..e8409dc 100644 --- a/nginx-golang-mysql/test.bats +++ b/nginx-golang-mysql/test.bats @@ -1,6 +1,8 @@ #!/usr/bin/env bats load '../lib/test_helper.bash' +load '../lib/bats-support/load.bash' +load '../lib/bats-assert/load.bash' cd ${BATS_TEST_DIRNAME} @@ -15,18 +17,17 @@ function teardown_file() { @test "$(basename ${BATS_TEST_DIRNAME}): pull check" { run docker-compose pull - [ "${status}" -eq 0 ] + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): build check" { run docker-compose build - [ "${status}" -eq 0 ] + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): up check" { run docker-compose up -d - [ "${status}" -eq 0 ] - + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): ports check" { @@ -49,10 +50,10 @@ function teardown_file() { if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then run nc -z -v localhost "${port}" - [ "${status}" -eq 0 ] + assert_success elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then run nc -z -v -u localhost "${port}" - [ "${status}" -eq 0 ] + assert_success fi done diff --git a/nginx-golang-postgres/test.bats b/nginx-golang-postgres/test.bats index 04970f8..e8409dc 100644 --- a/nginx-golang-postgres/test.bats +++ b/nginx-golang-postgres/test.bats @@ -1,6 +1,8 @@ #!/usr/bin/env bats load '../lib/test_helper.bash' +load '../lib/bats-support/load.bash' +load '../lib/bats-assert/load.bash' cd ${BATS_TEST_DIRNAME} @@ -15,18 +17,17 @@ function teardown_file() { @test "$(basename ${BATS_TEST_DIRNAME}): pull check" { run docker-compose pull - [ "${status}" -eq 0 ] + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): build check" { run docker-compose build - [ "${status}" -eq 0 ] + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): up check" { run docker-compose up -d - [ "${status}" -eq 0 ] - + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): ports check" { @@ -49,10 +50,10 @@ function teardown_file() { if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then run nc -z -v localhost "${port}" - [ "${status}" -eq 0 ] + assert_success elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then run nc -z -v -u localhost "${port}" - [ "${status}" -eq 0 ] + assert_success fi done diff --git a/nginx-golang/test.bats b/nginx-golang/test.bats index 04970f8..e8409dc 100644 --- a/nginx-golang/test.bats +++ b/nginx-golang/test.bats @@ -1,6 +1,8 @@ #!/usr/bin/env bats load '../lib/test_helper.bash' +load '../lib/bats-support/load.bash' +load '../lib/bats-assert/load.bash' cd ${BATS_TEST_DIRNAME} @@ -15,18 +17,17 @@ function teardown_file() { @test "$(basename ${BATS_TEST_DIRNAME}): pull check" { run docker-compose pull - [ "${status}" -eq 0 ] + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): build check" { run docker-compose build - [ "${status}" -eq 0 ] + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): up check" { run docker-compose up -d - [ "${status}" -eq 0 ] - + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): ports check" { @@ -49,10 +50,10 @@ function teardown_file() { if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then run nc -z -v localhost "${port}" - [ "${status}" -eq 0 ] + assert_success elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then run nc -z -v -u localhost "${port}" - [ "${status}" -eq 0 ] + assert_success fi done diff --git a/prometheus-grafana/test.bats b/prometheus-grafana/test.bats index 04970f8..e8409dc 100644 --- a/prometheus-grafana/test.bats +++ b/prometheus-grafana/test.bats @@ -1,6 +1,8 @@ #!/usr/bin/env bats load '../lib/test_helper.bash' +load '../lib/bats-support/load.bash' +load '../lib/bats-assert/load.bash' cd ${BATS_TEST_DIRNAME} @@ -15,18 +17,17 @@ function teardown_file() { @test "$(basename ${BATS_TEST_DIRNAME}): pull check" { run docker-compose pull - [ "${status}" -eq 0 ] + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): build check" { run docker-compose build - [ "${status}" -eq 0 ] + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): up check" { run docker-compose up -d - [ "${status}" -eq 0 ] - + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): ports check" { @@ -49,10 +50,10 @@ function teardown_file() { if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then run nc -z -v localhost "${port}" - [ "${status}" -eq 0 ] + assert_success elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then run nc -z -v -u localhost "${port}" - [ "${status}" -eq 0 ] + assert_success fi done diff --git a/react-express-mongodb/test.bats b/react-express-mongodb/test.bats index 04970f8..e8409dc 100644 --- a/react-express-mongodb/test.bats +++ b/react-express-mongodb/test.bats @@ -1,6 +1,8 @@ #!/usr/bin/env bats load '../lib/test_helper.bash' +load '../lib/bats-support/load.bash' +load '../lib/bats-assert/load.bash' cd ${BATS_TEST_DIRNAME} @@ -15,18 +17,17 @@ function teardown_file() { @test "$(basename ${BATS_TEST_DIRNAME}): pull check" { run docker-compose pull - [ "${status}" -eq 0 ] + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): build check" { run docker-compose build - [ "${status}" -eq 0 ] + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): up check" { run docker-compose up -d - [ "${status}" -eq 0 ] - + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): ports check" { @@ -49,10 +50,10 @@ function teardown_file() { if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then run nc -z -v localhost "${port}" - [ "${status}" -eq 0 ] + assert_success elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then run nc -z -v -u localhost "${port}" - [ "${status}" -eq 0 ] + assert_success fi done diff --git a/react-express-mysql/test.bats b/react-express-mysql/test.bats index 04970f8..e8409dc 100644 --- a/react-express-mysql/test.bats +++ b/react-express-mysql/test.bats @@ -1,6 +1,8 @@ #!/usr/bin/env bats load '../lib/test_helper.bash' +load '../lib/bats-support/load.bash' +load '../lib/bats-assert/load.bash' cd ${BATS_TEST_DIRNAME} @@ -15,18 +17,17 @@ function teardown_file() { @test "$(basename ${BATS_TEST_DIRNAME}): pull check" { run docker-compose pull - [ "${status}" -eq 0 ] + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): build check" { run docker-compose build - [ "${status}" -eq 0 ] + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): up check" { run docker-compose up -d - [ "${status}" -eq 0 ] - + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): ports check" { @@ -49,10 +50,10 @@ function teardown_file() { if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then run nc -z -v localhost "${port}" - [ "${status}" -eq 0 ] + assert_success elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then run nc -z -v -u localhost "${port}" - [ "${status}" -eq 0 ] + assert_success fi done diff --git a/react-java-mysql/test.bats b/react-java-mysql/test.bats index 04970f8..e8409dc 100644 --- a/react-java-mysql/test.bats +++ b/react-java-mysql/test.bats @@ -1,6 +1,8 @@ #!/usr/bin/env bats load '../lib/test_helper.bash' +load '../lib/bats-support/load.bash' +load '../lib/bats-assert/load.bash' cd ${BATS_TEST_DIRNAME} @@ -15,18 +17,17 @@ function teardown_file() { @test "$(basename ${BATS_TEST_DIRNAME}): pull check" { run docker-compose pull - [ "${status}" -eq 0 ] + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): build check" { run docker-compose build - [ "${status}" -eq 0 ] + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): up check" { run docker-compose up -d - [ "${status}" -eq 0 ] - + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): ports check" { @@ -49,10 +50,10 @@ function teardown_file() { if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then run nc -z -v localhost "${port}" - [ "${status}" -eq 0 ] + assert_success elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then run nc -z -v -u localhost "${port}" - [ "${status}" -eq 0 ] + assert_success fi done diff --git a/react-rust-postgres/test.bats b/react-rust-postgres/test.bats index 04970f8..e8409dc 100644 --- a/react-rust-postgres/test.bats +++ b/react-rust-postgres/test.bats @@ -1,6 +1,8 @@ #!/usr/bin/env bats load '../lib/test_helper.bash' +load '../lib/bats-support/load.bash' +load '../lib/bats-assert/load.bash' cd ${BATS_TEST_DIRNAME} @@ -15,18 +17,17 @@ function teardown_file() { @test "$(basename ${BATS_TEST_DIRNAME}): pull check" { run docker-compose pull - [ "${status}" -eq 0 ] + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): build check" { run docker-compose build - [ "${status}" -eq 0 ] + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): up check" { run docker-compose up -d - [ "${status}" -eq 0 ] - + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): ports check" { @@ -49,10 +50,10 @@ function teardown_file() { if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then run nc -z -v localhost "${port}" - [ "${status}" -eq 0 ] + assert_success elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then run nc -z -v -u localhost "${port}" - [ "${status}" -eq 0 ] + assert_success fi done diff --git a/sparkjava-mysql/test.bats b/sparkjava-mysql/test.bats index 04970f8..e8409dc 100644 --- a/sparkjava-mysql/test.bats +++ b/sparkjava-mysql/test.bats @@ -1,6 +1,8 @@ #!/usr/bin/env bats load '../lib/test_helper.bash' +load '../lib/bats-support/load.bash' +load '../lib/bats-assert/load.bash' cd ${BATS_TEST_DIRNAME} @@ -15,18 +17,17 @@ function teardown_file() { @test "$(basename ${BATS_TEST_DIRNAME}): pull check" { run docker-compose pull - [ "${status}" -eq 0 ] + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): build check" { run docker-compose build - [ "${status}" -eq 0 ] + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): up check" { run docker-compose up -d - [ "${status}" -eq 0 ] - + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): ports check" { @@ -49,10 +50,10 @@ function teardown_file() { if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then run nc -z -v localhost "${port}" - [ "${status}" -eq 0 ] + assert_success elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then run nc -z -v -u localhost "${port}" - [ "${status}" -eq 0 ] + assert_success fi done diff --git a/sparkjava/test.bats b/sparkjava/test.bats index 04970f8..e8409dc 100644 --- a/sparkjava/test.bats +++ b/sparkjava/test.bats @@ -1,6 +1,8 @@ #!/usr/bin/env bats load '../lib/test_helper.bash' +load '../lib/bats-support/load.bash' +load '../lib/bats-assert/load.bash' cd ${BATS_TEST_DIRNAME} @@ -15,18 +17,17 @@ function teardown_file() { @test "$(basename ${BATS_TEST_DIRNAME}): pull check" { run docker-compose pull - [ "${status}" -eq 0 ] + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): build check" { run docker-compose build - [ "${status}" -eq 0 ] + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): up check" { run docker-compose up -d - [ "${status}" -eq 0 ] - + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): ports check" { @@ -49,10 +50,10 @@ function teardown_file() { if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then run nc -z -v localhost "${port}" - [ "${status}" -eq 0 ] + assert_success elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then run nc -z -v -u localhost "${port}" - [ "${status}" -eq 0 ] + assert_success fi done diff --git a/spring-postgres/test.bats b/spring-postgres/test.bats index 04970f8..e8409dc 100644 --- a/spring-postgres/test.bats +++ b/spring-postgres/test.bats @@ -1,6 +1,8 @@ #!/usr/bin/env bats load '../lib/test_helper.bash' +load '../lib/bats-support/load.bash' +load '../lib/bats-assert/load.bash' cd ${BATS_TEST_DIRNAME} @@ -15,18 +17,17 @@ function teardown_file() { @test "$(basename ${BATS_TEST_DIRNAME}): pull check" { run docker-compose pull - [ "${status}" -eq 0 ] + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): build check" { run docker-compose build - [ "${status}" -eq 0 ] + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): up check" { run docker-compose up -d - [ "${status}" -eq 0 ] - + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): ports check" { @@ -49,10 +50,10 @@ function teardown_file() { if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then run nc -z -v localhost "${port}" - [ "${status}" -eq 0 ] + assert_success elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then run nc -z -v -u localhost "${port}" - [ "${status}" -eq 0 ] + assert_success fi done diff --git a/traefik-golang/test.bats b/traefik-golang/test.bats index 04970f8..e8409dc 100644 --- a/traefik-golang/test.bats +++ b/traefik-golang/test.bats @@ -1,6 +1,8 @@ #!/usr/bin/env bats load '../lib/test_helper.bash' +load '../lib/bats-support/load.bash' +load '../lib/bats-assert/load.bash' cd ${BATS_TEST_DIRNAME} @@ -15,18 +17,17 @@ function teardown_file() { @test "$(basename ${BATS_TEST_DIRNAME}): pull check" { run docker-compose pull - [ "${status}" -eq 0 ] + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): build check" { run docker-compose build - [ "${status}" -eq 0 ] + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): up check" { run docker-compose up -d - [ "${status}" -eq 0 ] - + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): ports check" { @@ -49,10 +50,10 @@ function teardown_file() { if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then run nc -z -v localhost "${port}" - [ "${status}" -eq 0 ] + assert_success elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then run nc -z -v -u localhost "${port}" - [ "${status}" -eq 0 ] + assert_success fi done diff --git a/vuejs/test.bats b/vuejs/test.bats index 04970f8..e8409dc 100644 --- a/vuejs/test.bats +++ b/vuejs/test.bats @@ -1,6 +1,8 @@ #!/usr/bin/env bats load '../lib/test_helper.bash' +load '../lib/bats-support/load.bash' +load '../lib/bats-assert/load.bash' cd ${BATS_TEST_DIRNAME} @@ -15,18 +17,17 @@ function teardown_file() { @test "$(basename ${BATS_TEST_DIRNAME}): pull check" { run docker-compose pull - [ "${status}" -eq 0 ] + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): build check" { run docker-compose build - [ "${status}" -eq 0 ] + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): up check" { run docker-compose up -d - [ "${status}" -eq 0 ] - + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): ports check" { @@ -49,10 +50,10 @@ function teardown_file() { if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then run nc -z -v localhost "${port}" - [ "${status}" -eq 0 ] + assert_success elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then run nc -z -v -u localhost "${port}" - [ "${status}" -eq 0 ] + assert_success fi done diff --git a/wordpress-mysql/test.bats b/wordpress-mysql/test.bats index 04970f8..e8409dc 100644 --- a/wordpress-mysql/test.bats +++ b/wordpress-mysql/test.bats @@ -1,6 +1,8 @@ #!/usr/bin/env bats load '../lib/test_helper.bash' +load '../lib/bats-support/load.bash' +load '../lib/bats-assert/load.bash' cd ${BATS_TEST_DIRNAME} @@ -15,18 +17,17 @@ function teardown_file() { @test "$(basename ${BATS_TEST_DIRNAME}): pull check" { run docker-compose pull - [ "${status}" -eq 0 ] + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): build check" { run docker-compose build - [ "${status}" -eq 0 ] + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): up check" { run docker-compose up -d - [ "${status}" -eq 0 ] - + assert_success } @test "$(basename ${BATS_TEST_DIRNAME}): ports check" { @@ -49,10 +50,10 @@ function teardown_file() { if [[ ${protocol} == "tcp" ]] && [[ ! -z ${port} ]]; then run nc -z -v localhost "${port}" - [ "${status}" -eq 0 ] + assert_success elif [[ "${protocol}" = "udp" ]] && [[ ! -z ${port} ]]; then run nc -z -v -u localhost "${port}" - [ "${status}" -eq 0 ] + assert_success fi done