test(webapp): regression tests for resuming manually paused environments#4127
Conversation
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📜 Recent review details⏰ Context from checks skipped due to timeout. (12)
|
| Cohort / File(s) | Summary |
|---|---|
PauseEnvironmentService tests — apps/webapp/test/pauseEnvironment.server.test.ts |
Adds test setup helpers and three integration tests for pause/resume state transitions and billing-limit handling. |
Sequence Diagram(s)
sequenceDiagram
participant Test
participant PauseEnvironmentService
participant Prisma
Test->>Prisma: seedProductionEnv (create runtimeEnvironment)
Test->>PauseEnvironmentService: call(env, "paused")
PauseEnvironmentService->>Prisma: update paused and pauseSource
Test->>PauseEnvironmentService: call(env, "resumed")
PauseEnvironmentService->>Prisma: validate pauseSource and update state
PauseEnvironmentService-->>Test: success or failure result
Related Issues / Related PRs: None provided.
Suggested Labels: test, webapp
Suggested Reviewers: None determined from provided context.
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Description check | The description covers the change summary but misses the template's required issue reference, checklist, testing steps, changelog, and screenshots. | Add a Closes # line, complete the checklist, describe testing steps, fill in the changelog, and include screenshots if applicable. |
✅ Passed checks (4 passed)
| Check name | Status | Explanation |
|---|---|---|
| Title check | ✅ Passed | The title clearly summarizes the change as regression tests for resuming manually paused environments and matches the PR's main focus. |
| Docstring Coverage | ✅ Passed | No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. |
| Linked Issues check | ✅ Passed | Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check | ✅ Passed | Check skipped because no linked issues were found for this pull request. |
✨ Finishing Touches
📝 Generate docstrings
- Create stacked PR
- Commit on current branch
🧪 Generate unit tests (beta)
- Create PR with unit tests
- Commit unit tests in branch
test/pause-environment-resume-regression
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
Follow-up to #4120, adding regression coverage for the pause/resume path in
PauseEnvironmentService.Three tests against the real service with testcontainers Postgres (no mocks), seeded org/project/environment rows, and the same
AuthenticatedEnvironmentcoercion production uses:pauseSourcenull, resume must succeed. Verified this fails with the exact pre-fix(webapp): allow resuming manually paused environments #4120 symptom (false billing-limit error) when the fix is reverted locally.pauseSource = BILLING_LIMIT, and the env stays paused.pauseSource, so billing-limit converge can still find and unpause the environment.Tests-only change, no runtime behavior touched.