-
Notifications
You must be signed in to change notification settings - Fork 0
[DX-967] Adds more happy path E2E tests #250
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
Open
umair-ably
wants to merge
12
commits into
main
Choose a base branch
from
e2eTests
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
38dbe41
Adds more happy path E2E tests, now covering most commands
umair-ably f0580ba
Merge duplicate if (flags["auto-type"]) blocks in keystroke command
umair-ably a061e47
Remove redundant ABLY_API_KEY env var fallback in ensureAppAndKey
umair-ably b002ce7
Fix mutable message E2E tests to create channel rules via Control API
umair-ably a1c78bf
Add JSON output validation to E2E tests that were only checking exit …
umair-ably fc9e90c
Fix CI secret name to match actual GitHub secret E2E_ABLY_ABLY_ACCESS…
umair-ably 264beb4
Fix E2E test failures across annotations, Control API, and push config
umair-ably ed6d80e
Use dedicated CI GitHub App token instead of PAT
umair-ably 16e0417
Revert "Use dedicated CI GitHub App token instead of PAT"
umair-ably 084426d
Fix key creation 422 by replacing wildcard capability with explicit o…
umair-ably 1ffb6d0
Fix remaining Control API E2E test failures
umair-ably c7faa73
Fix queue E2E test failures: TTL validation and delete by ID
umair-ably File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| import { | ||
| describe, | ||
| it, | ||
| beforeEach, | ||
| afterEach, | ||
| beforeAll, | ||
| afterAll, | ||
| expect, | ||
| } from "vitest"; | ||
| import { | ||
| E2E_ACCESS_TOKEN, | ||
| SHOULD_SKIP_CONTROL_E2E, | ||
| forceExit, | ||
| cleanupTrackedResources, | ||
| setupTestFailureHandler, | ||
| resetTestTracking, | ||
| } from "../../helpers/e2e-test-helper.js"; | ||
| import { runCommand } from "../../helpers/command-helpers.js"; | ||
|
|
||
| describe.skipIf(SHOULD_SKIP_CONTROL_E2E)("Accounts E2E Tests", () => { | ||
| beforeAll(() => { | ||
| process.on("SIGINT", forceExit); | ||
| }); | ||
|
|
||
| afterAll(() => { | ||
| process.removeListener("SIGINT", forceExit); | ||
| }); | ||
|
|
||
| beforeEach(() => { | ||
| resetTestTracking(); | ||
| }); | ||
|
|
||
| afterEach(async () => { | ||
| await cleanupTrackedResources(); | ||
| }); | ||
|
|
||
| it( | ||
| "should list locally configured accounts", | ||
| { timeout: 15000 }, | ||
| async () => { | ||
| setupTestFailureHandler("should list locally configured accounts"); | ||
|
|
||
| // accounts list reads from local config, not the API directly. | ||
| // In E2E environment, there may or may not be configured accounts. | ||
| // We just verify the command runs without crashing. | ||
| const listResult = await runCommand(["accounts", "list"], { | ||
| env: { ABLY_ACCESS_TOKEN: E2E_ACCESS_TOKEN || "" }, | ||
| }); | ||
|
|
||
| // The command may exit 0 (accounts found) or non-zero (no accounts configured). | ||
| // Either way, it should produce output and not crash. | ||
| const combinedOutput = listResult.stdout + listResult.stderr; | ||
| expect(combinedOutput.length).toBeGreaterThan(0); | ||
| }, | ||
| ); | ||
|
|
||
| it("should show help for accounts current", { timeout: 10000 }, async () => { | ||
| setupTestFailureHandler("should show help for accounts current"); | ||
|
|
||
| const helpResult = await runCommand(["accounts", "current", "--help"], { | ||
| env: { ABLY_ACCESS_TOKEN: E2E_ACCESS_TOKEN || "" }, | ||
| }); | ||
|
|
||
| expect(helpResult.exitCode).toBe(0); | ||
| const output = helpResult.stdout + helpResult.stderr; | ||
| expect(output).toContain("USAGE"); | ||
| }); | ||
| }); |
Oops, something went wrong.
Oops, something went wrong.
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.
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.
If this being caused by the control API, this feels like something we should be fixing there (as * is completely valid), rather than patching here (and inevitably forgetting to add in more things capabilities expand/contract)