-
Notifications
You must be signed in to change notification settings - Fork 26
chore(tests): centralize integration and bdd suites #3064
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
strantalis
wants to merge
10
commits into
opentdf:main
Choose a base branch
from
strantalis:feat/centralized-tests
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
99efff9
chore(tests): centralize integration and bdd suites
strantalis 2c9d6b7
chore(tests): address review feedback
strantalis e78df8c
chore(ci): update tests module paths
strantalis 777d0af
chore(ci): allow tests scope
strantalis 37c1965
chore(tests): avoid magic number in postgres timeout
strantalis 749b2b0
chore(deps): bump lib/fixtures service version
strantalis 50d0c4e
chore(deps): tidy service go.mod
strantalis cdbf39c
chore(ci): fix tests integration path
strantalis 37ec262
chore(docs): move testing checklist into adr
strantalis 8ea01e2
chore(ci): skip service integration lint
strantalis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -58,6 +58,7 @@ jobs: | |
| ci | ||
| deps | ||
| docs | ||
| tests | ||
| sdk | ||
| policy | ||
| ers | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -207,3 +207,6 @@ formatters: | |
| - third_party$ | ||
| - builtin$ | ||
| - examples$ | ||
| run: | ||
| skip-dirs: | ||
| - ^integration$ | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| # Centralize Containerized and BDD Tests Under tests/ | ||
|
|
||
| ## Status | ||
| Accepted | ||
|
|
||
| ## Context | ||
| We want to remove the `testcontainers` dependency from the `sdk` and `service` modules while keeping integration and BDD coverage. The existing layout splits BDD tests under `tests-bdd/` and containerized integration tests inside `sdk/` and `service/`, which ties those modules to `testcontainers` and increases dependency weight. | ||
|
|
||
| ## Decision | ||
| - Create a single root `tests/` Go module that contains all BDD and containerized integration tests. | ||
| - Move SDK OAuth, Service integration, and ERS integration tests into `tests/`. | ||
| - Keep `lib/fixtures` versioned (for now) and move service fixture helpers into it for tests and quickstart workflows. | ||
| - Use `go.work` for local module resolution across `sdk`, `service`, `protocol/go`, and `lib/fixtures`. | ||
|
|
||
| ## Consequences | ||
| - `sdk` and `service` drop `testcontainers` from their `go.mod` files. | ||
| - Integration and BDD tests are run via `cd tests && go test ./...`. | ||
| - `lib/fixtures` now depends on `service` and `protocol/go`, which increases coupling and should be monitored for release friction. | ||
| - CI and documentation must point to the new `tests/` location. | ||
|
|
||
| ## Migration Checklist (Completed) | ||
|
|
||
| ### 1) BDD migration (tests-bdd -> tests) | ||
| - [x] Move `tests-bdd/` to `tests/` | ||
| - [x] Update module path, imports, and docs | ||
| - [x] Update Dockerfile and root references | ||
|
|
||
| ### 2) SDK OAuth integration tests | ||
| - [x] Move OAuth tests under `tests/sdk/auth/oauth` | ||
| - [x] Move testdata and update package imports | ||
| - [x] Ensure Keycloak container setup works | ||
|
|
||
| ### 3) Service integration tests | ||
| - [x] Move `service/integration` tests under `tests/service/integration` | ||
| - [x] Replace fixture loading with `lib/fixtures` | ||
| - [x] Use shared container helpers | ||
|
|
||
| ### 4) ERS integration tests | ||
| - [x] Move ERS integration tests under `tests/service/entityresolution/integration` | ||
| - [x] Update internal package imports | ||
| - [x] Update docs and docker-compose data mounts | ||
|
|
||
| ### 5) Fixtures consolidation | ||
| - [x] Move `service/internal/fixtures` into `lib/fixtures` | ||
| - [x] Embed `policy_fixtures.yaml` and update loaders | ||
| - [x] Update `service/cmd/provisionFixtures.go` | ||
|
|
||
| ### 6) Cleanup and wiring | ||
| - [x] Remove `testcontainers` from `sdk` and `service` go.mod | ||
| - [x] Update `go.work` to include `tests/` | ||
| - [x] Add `make test-integration` and document usage | ||
| - [x] Run `go mod tidy` and formatting |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,5 +9,5 @@ use ( | |
| ./protocol/go | ||
| ./sdk | ||
| ./service | ||
| ./tests-bdd | ||
| ./tests | ||
| ) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| # Internal Module | ||
|
|
||
| These modules are used by other http://github.com/opentdf/ projects, and | ||
| are not intended for use elsewhere. | ||
| This module provides fixtures used by tests and quickstart workflows across OpenTDF repositories. | ||
| It is versioned and can be consumed like other internal libs. | ||
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.