-
Notifications
You must be signed in to change notification settings - Fork 8.8k
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
refactor(core): Refactor cli command tests (no-changelog) #9731
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So much cleaner, thank you!
@@ -498,7 +498,7 @@ export class Worker extends BaseCommand { | |||
} | |||
|
|||
// Make sure that the process does not close | |||
await new Promise(() => {}); | |||
if (!inTest) await new Promise(() => {}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I take it there's no other choice but in general we should avoid sprinkling inTest
checks in production code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was "temporary" code that Jan had to add, after I broke this in #5452 .
At some point I hope to fix this properly, until then we need this ugly check 😞
}); | ||
|
||
afterAll(async () => { | ||
await testDb.terminate(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit - Some testDb
calls happen in the suite, some happen here. This dries up tests but might condition us to e.g. forget about testDb.terminate
in tests that are not about CLI commands and do not have this convenience? Personally I'd prefer not to switch back and forth to see what the suite is doing. Really minor though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, I wasn't happy about that either, and I'm hoping to clean this up even more in the future. I just wanted to get this change in first, so that I can add unit tests for the rest of the commands.
✅ No visual regressions found. |
3 flaky tests on run #5547 ↗︎
Details:
5-ndv.cy.ts • 2 flaky tests
20-workflow-executions.cy.ts • 1 flaky test
Review all test suite changes for PR #9731 ↗︎ |
✅ All Cypress E2E specs passed |
Got released with |
1 similar comment
Got released with |
Summary
extracted out of #9696
Review / Merge checklist