core: use case doctrine test#109
Merged
Merged
Conversation
0375683 to
758dde3
Compare
4335c98 to
3de86c0
Compare
758dde3 to
df03e34
Compare
3de86c0 to
721a0c2
Compare
df03e34 to
0d402f5
Compare
absoludity
commented
Mar 16, 2026
| @@ -0,0 +1,7 @@ | |||
| """Doctrine tests for julee's shared domain. | |||
Collaborator
Author
There was a problem hiding this comment.
I don't understand the "shared domain" - shared as in it's used by other applications? That terminology seems to have been used (along with a "shared directory" where the tests would go, but they're all in src/julee/core as if that assumption changed?
Comment on lines
+14
to
+19
| from julee.core.infrastructure.repositories.file.solution_config import ( | ||
| FileSolutionConfigRepository, | ||
| ) | ||
| from julee.core.infrastructure.repositories.introspection.bounded_context import ( | ||
| FilesystemBoundedContextRepository, | ||
| ) |
Collaborator
Author
There was a problem hiding this comment.
Note the difference between these imports ... one from file the other not. That's what I referred to in a previous PR.
|
|
||
|
|
||
| @pytest.fixture(scope="session") | ||
| def repo() -> FilesystemBoundedContextRepository: |
Collaborator
Author
There was a problem hiding this comment.
Why not have the return type as the protocol here - does it need to be implementation specific ^^
This was referenced Mar 17, 2026
721a0c2 to
49dd8a9
Compare
0d402f5 to
8aa5bc0
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Follows #108. CI passes here because it doesn't yet run the doctrine tests - I'll follow-up with a PR that adds them and fixes the failures in the current code for use-cases, before adding the other doctrine tests. Running manually, it fails with:
which answers a question I had about the seemingly superfluous request/response classes (created to ensure the name matches the use case).
ADR 002 establishes that doctrine tests are the authoritative expression of
architectural rules — the docstring states the rule, the assertion enforces
it. This PR delivers the first of those tests, covering use cases.
The test scans the entire codebase at runtime and verifies that every class
ending in `UseCase` has a docstring, an `execute()` method, and matching
`Request`/`Response` classes in the same bounded context. Running
`pytest src/julee/core/doctrine/` against any Julee solution will surface
violations immediately.
The 3 failing tests on this branch are real violations in existing code, not
test bugs. They are the point — this is the doctrine working as intended.
Fixing those violations is follow-on work, separate from landing the
enforcement mechanism.
The `JULEE_TARGET` env var lets the same test suite run against any
external Julee solution, not just the framework itself.
Part of a stack