From 1b7836009f17cc451ba3e2e36d1726117443ca7b Mon Sep 17 00:00:00 2001 From: cellarspoon Date: Fri, 31 Dec 2021 17:18:50 +0100 Subject: [PATCH] test: spec out check tests [ci skip] --- cli/app/check_test.go | 15 +++++++++++++++ pkg/integration/integration.go | 12 ++++++++++++ tests/integration/app-check/testapp/testapp.env | 3 +++ tests/integration/app-check/testapp2/testapp2.env | 4 ++++ .../integration/app-check/testrecipe/.env.sample | 2 ++ .../integration/app-check/testrecipe2/.env.sample | 3 +++ 6 files changed, 39 insertions(+) create mode 100644 cli/app/check_test.go create mode 100644 pkg/integration/integration.go create mode 100644 tests/integration/app-check/testapp/testapp.env create mode 100644 tests/integration/app-check/testapp2/testapp2.env create mode 100644 tests/integration/app-check/testrecipe/.env.sample create mode 100644 tests/integration/app-check/testrecipe2/.env.sample diff --git a/cli/app/check_test.go b/cli/app/check_test.go new file mode 100644 index 00000000..cfa0e102 --- /dev/null +++ b/cli/app/check_test.go @@ -0,0 +1,15 @@ +package app + +import "testing" + +func TestCheck(t *testing.T) { + // copy testrecipe into ~/.abra/apps/... + // copy testapp into ~/.abra/servers/testserver + // run app check test recipe and it should pass +} + +func TestCheckBadEnv(t *testing.T) { + // copy testrecipe, testrecipe2 into ~/.abra/apps/... + // copy testapp, test2 into ~/.abra/servers/testserver + // run app check test recipe and it should fail +} diff --git a/pkg/integration/integration.go b/pkg/integration/integration.go new file mode 100644 index 00000000..bdb0a531 --- /dev/null +++ b/pkg/integration/integration.go @@ -0,0 +1,12 @@ +package integration + +import ( + "os" + "testing" +) + +func skipIfNotIntegration(t *testing.T) { + if os.Getenv("ABRA_INTEGRATION") == "" { + t.Skip("missing 'ABRA_INTEGRATION', not running integration tests") + } +} diff --git a/tests/integration/app-check/testapp/testapp.env b/tests/integration/app-check/testapp/testapp.env new file mode 100644 index 00000000..1ec5393c --- /dev/null +++ b/tests/integration/app-check/testapp/testapp.env @@ -0,0 +1,3 @@ +TYPE=testrecipe +DOMAIN=foo.com +MANDATORY_ENV_VAR=bar diff --git a/tests/integration/app-check/testapp2/testapp2.env b/tests/integration/app-check/testapp2/testapp2.env new file mode 100644 index 00000000..446690dc --- /dev/null +++ b/tests/integration/app-check/testapp2/testapp2.env @@ -0,0 +1,4 @@ +TYPE=testrecipe2 +DOMAIN=foo.com +MANDATORY_ENV_VAR=bar +# missing MANDATORY_ENV_VAR2 diff --git a/tests/integration/app-check/testrecipe/.env.sample b/tests/integration/app-check/testrecipe/.env.sample new file mode 100644 index 00000000..1acb87eb --- /dev/null +++ b/tests/integration/app-check/testrecipe/.env.sample @@ -0,0 +1,2 @@ +TYPE=testrecipe +MANDATORY_ENV_VAR=bar diff --git a/tests/integration/app-check/testrecipe2/.env.sample b/tests/integration/app-check/testrecipe2/.env.sample new file mode 100644 index 00000000..09179f21 --- /dev/null +++ b/tests/integration/app-check/testrecipe2/.env.sample @@ -0,0 +1,3 @@ +TYPE=testrecipe2 +MANDATORY_ENV_VAR1=bar +MANDATORY_ENV_VAR2=bar