test: cover trial-email dispatch and pre-warm maintenance commands#198
Open
dan2k3k4 wants to merge 2 commits into
Open
test: cover trial-email dispatch and pre-warm maintenance commands#198dan2k3k4 wants to merge 2 commits into
dan2k3k4 wants to merge 2 commits into
Conversation
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.
Adds test coverage for the trial-email dispatch commands and the pre-warm instance maintenance command.
Greptile Summary
This PR adds feature test coverage for three trial-email dispatch commands (
dispatch-midtrial-emails,dispatch-trial-complete-emails,dispatch-trial-complete-stage-removal) and themaintain-prewarm-instancesmaintenance command. All four files are new test-only additions with no changes to production code.--appUUID filtering,--refresh-all, confirmation-prompt abort, and the early-return no-apps path, withEnsureUnallocatedAppInstancesJobdispatch assertions on every applicable path.Confidence Score: 5/5
Pure test additions with no production code changes; all new tests are well-scoped and correctly structured.
All four files are new feature tests with no production logic modified. Each test class correctly uses Queue::fake(), saveQuietly(), and Queue::assertPushed / assertNotPushed. The two gaps flagged in the previous review round have both been addressed. No logic errors or missing guards were found.
No files require special attention.
Important Files Changed
Sequence Diagram
%%{init: {'theme': 'neutral'}}%% sequenceDiagram participant Test participant Artisan participant Command participant DB participant Queue Note over Test,Queue: Trial-email dispatch commands Test->>DB: createStoreApp() + createInstance() Test->>Artisan: "artisan('polydock:dispatch-*')" Artisan->>Command: handle() Command->>DB: query eligible instances DB-->>Command: collection Command->>Queue: "Job::dispatch(instance->id)" Command-->>Artisan: EXIT 0 Test->>Queue: assertPushed / assertNotPushed Note over Test,Queue: MaintainPreWarmInstances command Test->>DB: createStoreApp(target) + createUnallocatedInstance() Test->>Artisan: artisan('polydock:maintain-prewarm-instances') Artisan->>Command: handle() Command->>DB: query PolydockStoreApp DB-->>Command: apps collection alt no apps found Command-->>Artisan: EXIT 0 else apps found + confirmed loop each app Command->>DB: queueUnallocatedInstancesForRemoval() end Command->>Queue: EnsureUnallocatedAppInstancesJob::dispatch() Command-->>Artisan: EXIT 0 end Test->>Queue: assertPushed(EnsureUnallocatedAppInstancesJob, 1)%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%% sequenceDiagram participant Test participant Artisan participant Command participant DB participant Queue Note over Test,Queue: Trial-email dispatch commands Test->>DB: createStoreApp() + createInstance() Test->>Artisan: "artisan('polydock:dispatch-*')" Artisan->>Command: handle() Command->>DB: query eligible instances DB-->>Command: collection Command->>Queue: "Job::dispatch(instance->id)" Command-->>Artisan: EXIT 0 Test->>Queue: assertPushed / assertNotPushed Note over Test,Queue: MaintainPreWarmInstances command Test->>DB: createStoreApp(target) + createUnallocatedInstance() Test->>Artisan: artisan('polydock:maintain-prewarm-instances') Artisan->>Command: handle() Command->>DB: query PolydockStoreApp DB-->>Command: apps collection alt no apps found Command-->>Artisan: EXIT 0 else apps found + confirmed loop each app Command->>DB: queueUnallocatedInstancesForRemoval() end Command->>Queue: EnsureUnallocatedAppInstancesJob::dispatch() Command-->>Artisan: EXIT 0 end Test->>Queue: assertPushed(EnsureUnallocatedAppInstancesJob, 1)Reviews (2): Last reviewed commit: "test: assert refill dispatch in app-filt..." | Re-trigger Greptile