From 5fd04001d85be038e08697c1020cff496be3bf15 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 20 Jun 2020 13:22:47 -0400 Subject: [PATCH] feat: split out test files and execute them manually This breaks the old grouping mechanism, but honestly that was a weird way of doing it. --- .circleci/config.yml | 37 ++++++++++++++- tests/unit/50_init_1.bats | 24 ---------- tests/unit/50_init_2.bats | 24 ---------- tests/unit/50_init_3.bats | 24 ---------- .../unit/{40_app-json.bats => app-json.bats} | 0 tests/unit/{60_apps.bats => apps.bats} | 0 .../{20_build-env.bats => build-env.bats} | 0 .../{30_buildpacks.bats => buildpacks.bats} | 0 tests/unit/{10_certs.bats => certs.bats} | 0 tests/unit/{10_checks.bats => checks.bats} | 0 tests/unit/{30_client.bats => client.bats} | 0 ...fig-oddities.bats => config-oddities.bats} | 0 tests/unit/{20_config.bats => config.bats} | 0 tests/unit/{90_core_1.bats => core_1.bats} | 0 tests/unit/{90_core_2.bats => core_2.bats} | 0 ...ocker-options.bats => docker-options.bats} | 0 tests/unit/{20_domains.bats => domains.bats} | 0 tests/unit/{30_events.bats => events.bats} | 0 tests/unit/{120_git.bats => git.bats} | 0 tests/unit/init.bats | 46 +++++++++++++++++++ tests/unit/{20_network.bats => network.bats} | 0 ...ginx-vhosts_1.bats => nginx-vhosts_1.bats} | 0 ...ginx-vhosts_2.bats => nginx-vhosts_2.bats} | 0 ...ginx-vhosts_3.bats => nginx-vhosts_3.bats} | 0 tests/unit/{40_plugin.bats => plugin.bats} | 0 tests/unit/{40_proxy.bats => proxy.bats} | 0 ..._ps-dockerfile.bats => ps-dockerfile.bats} | 0 .../{80_ps-general.bats => ps-general.bats} | 0 ...80_ps-herokuish.bats => ps-herokuish.bats} | 0 tests/unit/{10_repo.bats => repo.bats} | 0 tests/unit/{40_report.bats => report.bats} | 0 .../unit/{100_resource.bats => resource.bats} | 0 ...local.bats => scheduler-docker-local.bats} | 0 .../unit/{30_ssh_keys.bats => ssh_keys.bats} | 0 tests/unit/{20_storage.bats => storage.bats} | 0 tests/unit/{40_tags.bats => tags.bats} | 0 tests/unit/{10_tar.bats => tar.bats} | 0 tests/unit/{40_trace.bats => trace.bats} | 0 tests/unit/{10_version.bats => version.bats} | 0 39 files changed, 82 insertions(+), 73 deletions(-) delete mode 100644 tests/unit/50_init_1.bats delete mode 100644 tests/unit/50_init_2.bats delete mode 100644 tests/unit/50_init_3.bats rename tests/unit/{40_app-json.bats => app-json.bats} (100%) rename tests/unit/{60_apps.bats => apps.bats} (100%) rename tests/unit/{20_build-env.bats => build-env.bats} (100%) rename tests/unit/{30_buildpacks.bats => buildpacks.bats} (100%) rename tests/unit/{10_certs.bats => certs.bats} (100%) rename tests/unit/{10_checks.bats => checks.bats} (100%) rename tests/unit/{30_client.bats => client.bats} (100%) rename tests/unit/{30_config-oddities.bats => config-oddities.bats} (100%) rename tests/unit/{20_config.bats => config.bats} (100%) rename tests/unit/{90_core_1.bats => core_1.bats} (100%) rename tests/unit/{90_core_2.bats => core_2.bats} (100%) rename tests/unit/{20_docker-options.bats => docker-options.bats} (100%) rename tests/unit/{20_domains.bats => domains.bats} (100%) rename tests/unit/{30_events.bats => events.bats} (100%) rename tests/unit/{120_git.bats => git.bats} (100%) create mode 100644 tests/unit/init.bats rename tests/unit/{20_network.bats => network.bats} (100%) rename tests/unit/{70_nginx-vhosts_1.bats => nginx-vhosts_1.bats} (100%) rename tests/unit/{110_nginx-vhosts_2.bats => nginx-vhosts_2.bats} (100%) rename tests/unit/{70_nginx-vhosts_3.bats => nginx-vhosts_3.bats} (100%) rename tests/unit/{40_plugin.bats => plugin.bats} (100%) rename tests/unit/{40_proxy.bats => proxy.bats} (100%) rename tests/unit/{80_ps-dockerfile.bats => ps-dockerfile.bats} (100%) rename tests/unit/{80_ps-general.bats => ps-general.bats} (100%) rename tests/unit/{80_ps-herokuish.bats => ps-herokuish.bats} (100%) rename tests/unit/{10_repo.bats => repo.bats} (100%) rename tests/unit/{40_report.bats => report.bats} (100%) rename tests/unit/{100_resource.bats => resource.bats} (100%) rename tests/unit/{30_scheduler-docker-local.bats => scheduler-docker-local.bats} (100%) rename tests/unit/{30_ssh_keys.bats => ssh_keys.bats} (100%) rename tests/unit/{20_storage.bats => storage.bats} (100%) rename tests/unit/{40_tags.bats => tags.bats} (100%) rename tests/unit/{10_tar.bats => tar.bats} (100%) rename tests/unit/{40_trace.bats => trace.bats} (100%) rename tests/unit/{10_version.bats => version.bats} (100%) diff --git a/.circleci/config.yml b/.circleci/config.yml index 60611f6e9..957ee6b9b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -126,6 +126,41 @@ workflows: - unit-tests: matrix: parameters: - index: [10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120] + index: + - app-json + - apps + - build-env + - buildpacks + - certs + - checks + - client + - config-oddities + - config + - core_1 + - core_2 + - docker-options + - domains + - events + - git + - init + - network + - nginx-vhosts_1 + - nginx-vhosts_2 + - nginx-vhosts_3 + - plugin + - proxy + - ps-dockerfile + - ps-general + - ps-herokuish + - repo + - report + - resource + - scheduler-docker-local + - ssh_keys + - storage + - tags + - tar + - trace + - version requires: - build diff --git a/tests/unit/50_init_1.bats b/tests/unit/50_init_1.bats deleted file mode 100644 index 98581d63b..000000000 --- a/tests/unit/50_init_1.bats +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env bats - -load test_helper - -setup() { - global_setup - create_app -} - -teardown() { - destroy_app - global_teardown -} - -@test "(init) buildpack" { - source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" - local APP="zombies-buildpack" - deploy_app "$APP" - local CIDS=$(get_app_container_ids "$APP") - - run "$DOCKER_BIN" container top "$CIDS" - echo "output: $output" - assert_output_contains "" "0" -} diff --git a/tests/unit/50_init_2.bats b/tests/unit/50_init_2.bats deleted file mode 100644 index c0b5d459a..000000000 --- a/tests/unit/50_init_2.bats +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env bats - -load test_helper - -setup() { - global_setup - create_app -} - -teardown() { - destroy_app - global_teardown -} - -@test "(init) dockerfile no tini" { - source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" - local APP="zombies-dockerfile-no-tini" - deploy_app "$APP" - local CIDS=$(get_app_container_ids "$APP") - - run "$DOCKER_BIN" container top "$CIDS" - echo "output: $output" - assert_output_contains "" "0" -} diff --git a/tests/unit/50_init_3.bats b/tests/unit/50_init_3.bats deleted file mode 100644 index 77c354b1b..000000000 --- a/tests/unit/50_init_3.bats +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env bats - -load test_helper - -setup() { - global_setup - create_app -} - -teardown() { - destroy_app - global_teardown -} - -@test "(init) dockerfile with tini" { - source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" - local APP="zombies-dockerfile-tini" - deploy_app "$APP" - local CIDS=$(get_app_container_ids "$APP") - - run "$DOCKER_BIN" container top "$CIDS" - echo "output: $output" - assert_output_contains "" "0" -} diff --git a/tests/unit/40_app-json.bats b/tests/unit/app-json.bats similarity index 100% rename from tests/unit/40_app-json.bats rename to tests/unit/app-json.bats diff --git a/tests/unit/60_apps.bats b/tests/unit/apps.bats similarity index 100% rename from tests/unit/60_apps.bats rename to tests/unit/apps.bats diff --git a/tests/unit/20_build-env.bats b/tests/unit/build-env.bats similarity index 100% rename from tests/unit/20_build-env.bats rename to tests/unit/build-env.bats diff --git a/tests/unit/30_buildpacks.bats b/tests/unit/buildpacks.bats similarity index 100% rename from tests/unit/30_buildpacks.bats rename to tests/unit/buildpacks.bats diff --git a/tests/unit/10_certs.bats b/tests/unit/certs.bats similarity index 100% rename from tests/unit/10_certs.bats rename to tests/unit/certs.bats diff --git a/tests/unit/10_checks.bats b/tests/unit/checks.bats similarity index 100% rename from tests/unit/10_checks.bats rename to tests/unit/checks.bats diff --git a/tests/unit/30_client.bats b/tests/unit/client.bats similarity index 100% rename from tests/unit/30_client.bats rename to tests/unit/client.bats diff --git a/tests/unit/30_config-oddities.bats b/tests/unit/config-oddities.bats similarity index 100% rename from tests/unit/30_config-oddities.bats rename to tests/unit/config-oddities.bats diff --git a/tests/unit/20_config.bats b/tests/unit/config.bats similarity index 100% rename from tests/unit/20_config.bats rename to tests/unit/config.bats diff --git a/tests/unit/90_core_1.bats b/tests/unit/core_1.bats similarity index 100% rename from tests/unit/90_core_1.bats rename to tests/unit/core_1.bats diff --git a/tests/unit/90_core_2.bats b/tests/unit/core_2.bats similarity index 100% rename from tests/unit/90_core_2.bats rename to tests/unit/core_2.bats diff --git a/tests/unit/20_docker-options.bats b/tests/unit/docker-options.bats similarity index 100% rename from tests/unit/20_docker-options.bats rename to tests/unit/docker-options.bats diff --git a/tests/unit/20_domains.bats b/tests/unit/domains.bats similarity index 100% rename from tests/unit/20_domains.bats rename to tests/unit/domains.bats diff --git a/tests/unit/30_events.bats b/tests/unit/events.bats similarity index 100% rename from tests/unit/30_events.bats rename to tests/unit/events.bats diff --git a/tests/unit/120_git.bats b/tests/unit/git.bats similarity index 100% rename from tests/unit/120_git.bats rename to tests/unit/git.bats diff --git a/tests/unit/init.bats b/tests/unit/init.bats new file mode 100644 index 000000000..80b1bbf33 --- /dev/null +++ b/tests/unit/init.bats @@ -0,0 +1,46 @@ +#!/usr/bin/env bats + +load test_helper + +setup() { + global_setup + create_app +} + +teardown() { + destroy_app + global_teardown +} + +@test "(init) buildpack" { + source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" + local APP="zombies-buildpack" + deploy_app "$APP" + local CIDS=$(get_app_container_ids "$APP") + + run "$DOCKER_BIN" container top "$CIDS" + echo "output: $output" + assert_output_contains "" "0" +} + +@test "(init) dockerfile no tini" { + source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" + local APP="zombies-dockerfile-no-tini" + deploy_app "$APP" + local CIDS=$(get_app_container_ids "$APP") + + run "$DOCKER_BIN" container top "$CIDS" + echo "output: $output" + assert_output_contains "" "0" +} + +@test "(init) dockerfile with tini" { + source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" + local APP="zombies-dockerfile-tini" + deploy_app "$APP" + local CIDS=$(get_app_container_ids "$APP") + + run "$DOCKER_BIN" container top "$CIDS" + echo "output: $output" + assert_output_contains "" "0" +} diff --git a/tests/unit/20_network.bats b/tests/unit/network.bats similarity index 100% rename from tests/unit/20_network.bats rename to tests/unit/network.bats diff --git a/tests/unit/70_nginx-vhosts_1.bats b/tests/unit/nginx-vhosts_1.bats similarity index 100% rename from tests/unit/70_nginx-vhosts_1.bats rename to tests/unit/nginx-vhosts_1.bats diff --git a/tests/unit/110_nginx-vhosts_2.bats b/tests/unit/nginx-vhosts_2.bats similarity index 100% rename from tests/unit/110_nginx-vhosts_2.bats rename to tests/unit/nginx-vhosts_2.bats diff --git a/tests/unit/70_nginx-vhosts_3.bats b/tests/unit/nginx-vhosts_3.bats similarity index 100% rename from tests/unit/70_nginx-vhosts_3.bats rename to tests/unit/nginx-vhosts_3.bats diff --git a/tests/unit/40_plugin.bats b/tests/unit/plugin.bats similarity index 100% rename from tests/unit/40_plugin.bats rename to tests/unit/plugin.bats diff --git a/tests/unit/40_proxy.bats b/tests/unit/proxy.bats similarity index 100% rename from tests/unit/40_proxy.bats rename to tests/unit/proxy.bats diff --git a/tests/unit/80_ps-dockerfile.bats b/tests/unit/ps-dockerfile.bats similarity index 100% rename from tests/unit/80_ps-dockerfile.bats rename to tests/unit/ps-dockerfile.bats diff --git a/tests/unit/80_ps-general.bats b/tests/unit/ps-general.bats similarity index 100% rename from tests/unit/80_ps-general.bats rename to tests/unit/ps-general.bats diff --git a/tests/unit/80_ps-herokuish.bats b/tests/unit/ps-herokuish.bats similarity index 100% rename from tests/unit/80_ps-herokuish.bats rename to tests/unit/ps-herokuish.bats diff --git a/tests/unit/10_repo.bats b/tests/unit/repo.bats similarity index 100% rename from tests/unit/10_repo.bats rename to tests/unit/repo.bats diff --git a/tests/unit/40_report.bats b/tests/unit/report.bats similarity index 100% rename from tests/unit/40_report.bats rename to tests/unit/report.bats diff --git a/tests/unit/100_resource.bats b/tests/unit/resource.bats similarity index 100% rename from tests/unit/100_resource.bats rename to tests/unit/resource.bats diff --git a/tests/unit/30_scheduler-docker-local.bats b/tests/unit/scheduler-docker-local.bats similarity index 100% rename from tests/unit/30_scheduler-docker-local.bats rename to tests/unit/scheduler-docker-local.bats diff --git a/tests/unit/30_ssh_keys.bats b/tests/unit/ssh_keys.bats similarity index 100% rename from tests/unit/30_ssh_keys.bats rename to tests/unit/ssh_keys.bats diff --git a/tests/unit/20_storage.bats b/tests/unit/storage.bats similarity index 100% rename from tests/unit/20_storage.bats rename to tests/unit/storage.bats diff --git a/tests/unit/40_tags.bats b/tests/unit/tags.bats similarity index 100% rename from tests/unit/40_tags.bats rename to tests/unit/tags.bats diff --git a/tests/unit/10_tar.bats b/tests/unit/tar.bats similarity index 100% rename from tests/unit/10_tar.bats rename to tests/unit/tar.bats diff --git a/tests/unit/40_trace.bats b/tests/unit/trace.bats similarity index 100% rename from tests/unit/40_trace.bats rename to tests/unit/trace.bats diff --git a/tests/unit/10_version.bats b/tests/unit/version.bats similarity index 100% rename from tests/unit/10_version.bats rename to tests/unit/version.bats