From 01fba34a7475332ca092f39b8d7a822f8c43fc8b Mon Sep 17 00:00:00 2001 From: jakedoublev Date: Fri, 6 Sep 2024 10:40:17 -0700 Subject: [PATCH] set up e2e tests to support the reusable action repo structure --- .github/workflows/ci.yaml | 2 +- Makefile | 2 +- README.md | 4 ++-- .github/workflows/end-to-end.yaml => e2e/action.yaml | 10 +++++----- {tests => e2e}/attributes.bats | 0 {tests => e2e}/encrypt-decrypt.bats | 0 {tests => e2e}/kas-grants.bats | 0 {tests => e2e}/kas-registry.bats | 0 {tests => e2e}/namespaces.bats | 0 {tests => e2e}/profile.bats | 0 {tests => e2e}/resize_terminal.sh | 0 {tests => e2e}/resource-mapping.bats | 0 {tests => e2e}/setup_suite.bash | 0 {tests => e2e}/subject-condition-sets.bats | 0 {tests => e2e}/subject-mapping.bats | 0 15 files changed, 9 insertions(+), 9 deletions(-) rename .github/workflows/end-to-end.yaml => e2e/action.yaml (96%) rename {tests => e2e}/attributes.bats (100%) rename {tests => e2e}/encrypt-decrypt.bats (100%) rename {tests => e2e}/kas-grants.bats (100%) rename {tests => e2e}/kas-registry.bats (100%) rename {tests => e2e}/namespaces.bats (100%) rename {tests => e2e}/profile.bats (100%) rename {tests => e2e}/resize_terminal.sh (100%) rename {tests => e2e}/resource-mapping.bats (100%) rename {tests => e2e}/setup_suite.bash (100%) rename {tests => e2e}/subject-condition-sets.bats (100%) rename {tests => e2e}/subject-mapping.bats (100%) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 827d6247..da51ff1f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -53,7 +53,7 @@ jobs: name: e2e tests runs-on: ubuntu-latest steps: - - uses: opentdf/otdfctl/.github/workflows/end-to-end.yaml@feat/e2e-ci + - uses: ./e2e@feat/e2e-ci with: platform-is-running: false platform-ref: 'main' diff --git a/Makefile b/Makefile index 0d0252db..d7a511a7 100644 --- a/Makefile +++ b/Makefile @@ -87,7 +87,7 @@ build-test: .PHONY: test-bats test-bats: build-test - ./tests/resize_terminal.sh && bats ./tests + ./e2e/resize_terminal.sh && bats ./tests # Target for cleaning up the target directory .PHONY: clean diff --git a/README.md b/README.md index d1953739..da96c384 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,7 @@ prerequisites are met: - The platform is running and provisioned with basic keycloak clients/users - See the [platform README](https://github.com/opentdf/platform) for instructions -To run the tests you can either run `make test-bats` or execute specific test suites with `bats tests/.bats`. +To run the tests you can either run `make test-bats` or execute specific test suites with `bats e2e/.bats`. #### Terminal Size @@ -85,5 +85,5 @@ Terminal size when testing: 1. set to standard defaults if running `make test-bats` 2. can be set manually by mouse in terminal where tests are triggered -3. can be set by argument `./tests/resize_terminal.sh < rows height > < columns width >` +3. can be set by argument `./e2e/resize_terminal.sh < rows height > < columns width >` 4. can be set by environment variable, i.e. `export TEST_TERMINAL_WIDTH="200"` (200 is columns width) diff --git a/.github/workflows/end-to-end.yaml b/e2e/action.yaml similarity index 96% rename from .github/workflows/end-to-end.yaml rename to e2e/action.yaml index 6015827d..3a4d49ec 100644 --- a/.github/workflows/end-to-end.yaml +++ b/e2e/action.yaml @@ -125,8 +125,8 @@ jobs: run: cp otdfctl-example.yaml otdfctl.yaml - name: Setup Bats and bats libs uses: bats-core/bats-action@2.0.0 - - run: tests/encrypt-decrypt.bats - - run: tests/kas-grants.bats - - run: tests/profile.bats - - run: tests/kas-registry.bats - - run: tests/namespaces.bats + - run: e2e/encrypt-decrypt.bats + - run: e2e/kas-grants.bats + - run: e2e/profile.bats + - run: e2e/kas-registry.bats + - run: e2e/namespaces.bats diff --git a/tests/attributes.bats b/e2e/attributes.bats similarity index 100% rename from tests/attributes.bats rename to e2e/attributes.bats diff --git a/tests/encrypt-decrypt.bats b/e2e/encrypt-decrypt.bats similarity index 100% rename from tests/encrypt-decrypt.bats rename to e2e/encrypt-decrypt.bats diff --git a/tests/kas-grants.bats b/e2e/kas-grants.bats similarity index 100% rename from tests/kas-grants.bats rename to e2e/kas-grants.bats diff --git a/tests/kas-registry.bats b/e2e/kas-registry.bats similarity index 100% rename from tests/kas-registry.bats rename to e2e/kas-registry.bats diff --git a/tests/namespaces.bats b/e2e/namespaces.bats similarity index 100% rename from tests/namespaces.bats rename to e2e/namespaces.bats diff --git a/tests/profile.bats b/e2e/profile.bats similarity index 100% rename from tests/profile.bats rename to e2e/profile.bats diff --git a/tests/resize_terminal.sh b/e2e/resize_terminal.sh similarity index 100% rename from tests/resize_terminal.sh rename to e2e/resize_terminal.sh diff --git a/tests/resource-mapping.bats b/e2e/resource-mapping.bats similarity index 100% rename from tests/resource-mapping.bats rename to e2e/resource-mapping.bats diff --git a/tests/setup_suite.bash b/e2e/setup_suite.bash similarity index 100% rename from tests/setup_suite.bash rename to e2e/setup_suite.bash diff --git a/tests/subject-condition-sets.bats b/e2e/subject-condition-sets.bats similarity index 100% rename from tests/subject-condition-sets.bats rename to e2e/subject-condition-sets.bats diff --git a/tests/subject-mapping.bats b/e2e/subject-mapping.bats similarity index 100% rename from tests/subject-mapping.bats rename to e2e/subject-mapping.bats