Arch unit test additions #290
Open
jasonmorais wants to merge 6 commits into
Open
Conversation
Contributor
Reviewer's GuideIntroduces reusable ArchUnit-style architecture fitness tests for Cellix APIs, UI apps, and Serenity suites, wires them into API/UI/verification packages via Vitest arch configs and test files, and hardens worktree-aware test infrastructure (timeouts, env wiring) and Serenity step abstractions while tightening TS/build setup and dependency overrides. Sequence diagram for new Serenity staff landing route handlingsequenceDiagram
actor StaffUser
participant StaffLandingSteps
participant SerenityActor as Actor
participant SerenityNotes as notes
StaffUser->>StaffLandingSteps: When enters staff operations workspace
StaffLandingSteps->>SerenityActor: attemptsTo(OpenStaffLanding(route))
SerenityActor->>SerenityNotes: set('targetRoute', route)
StaffUser->>StaffLandingSteps: Then should be directed to expectedRoute
StaffLandingSteps->>SerenityActor: answer(StaffTargetRoute())
SerenityActor->>SerenityNotes: get('targetRoute')
SerenityActor-->>StaffLandingSteps: targetRoute
StaffLandingSteps-->>StaffUser: compare targetRoute with expectedRoute
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The new architecture checkers (
checkApiComposition,checkUiAppComposition,checkSerenitySuiteConventions) rely heavily on brittle string/regex matching; consider pushing some of these checks through a TypeScript/AST-based helper or more tolerant patterns so minor formatting/import changes in consumer code don’t cause spurious violations. - In
checkSerenitySuiteConventions, the per-context and per-step-file checks are performed sequentially with multipleawaitcalls; if these suites will scan many contexts/files, consider batching the file reads (e.g., withPromise.all) to keep the architecture test runtime reasonable.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The new architecture checkers (`checkApiComposition`, `checkUiAppComposition`, `checkSerenitySuiteConventions`) rely heavily on brittle string/regex matching; consider pushing some of these checks through a TypeScript/AST-based helper or more tolerant patterns so minor formatting/import changes in consumer code don’t cause spurious violations.
- In `checkSerenitySuiteConventions`, the per-context and per-step-file checks are performed sequentially with multiple `await` calls; if these suites will scan many contexts/files, consider batching the file reads (e.g., with `Promise.all`) to keep the architecture test runtime reasonable.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Contributor
Author
|
@sourcery-ai review |
Contributor
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The Serenity suite convention checker relies on literal string matches like
registerLifecycleHooks()inworld.ts, which seems at odds with your own contract tests where lifecycle hooks are defined incucumber-lifecycle-hooks.ts; consider tightening this to check for the lifecycle import/usage in the lifecycle file rather than enforcing a call inworld.ts. - The UI app composition checks enforce a specific
if/throwroot guard via AST (containsIfThrow), which may be too rigid for apps that guard the mount point differently (e.g., assertions or helper functions); you might want to broaden this check to validate presence of a null-check and error handling without requiring an exactif+throwshape.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The Serenity suite convention checker relies on literal string matches like `registerLifecycleHooks()` in `world.ts`, which seems at odds with your own contract tests where lifecycle hooks are defined in `cucumber-lifecycle-hooks.ts`; consider tightening this to check for the lifecycle import/usage in the lifecycle file rather than enforcing a call in `world.ts`.
- The UI app composition checks enforce a specific `if`/`throw` root guard via AST (`containsIfThrow`), which may be too rigid for apps that guard the mount point differently (e.g., assertions or helper functions); you might want to broaden this check to validate presence of a null-check and error handling without requiring an exact `if` + `throw` shape.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
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.
Summary by Sourcery
Introduce reusable architecture fitness tests for Cellix API, UI, and Serenity-based verification suites and wire them into key apps and verification packages, while improving worktree-aware test environment behavior and timeouts.
New Features:
Bug Fixes:
Enhancements:
Build:
Documentation:
Tests:
Chores: