Skip to content
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

E2Ev2 #5278

Merged
merged 50 commits into from
Oct 2, 2024
Merged

E2Ev2 #5278

merged 50 commits into from
Oct 2, 2024

Conversation

RXminuS
Copy link
Contributor

@RXminuS RXminuS commented Aug 21, 2024

We've been plagued by slow and flaky e2e tests. And although Agent tests are effective in eliminating some of that flake they lack the ability to validate real extension behavior and UI states.

The new E2Ev2 framework brings together the best elements of the Agent Tests with a more Developer-Friendly E2E workflow. The initial goal of this framework is to provide the baseline tools to migrate the flaky E2Ev1 tests and re-enable them in CI.

But the ultimate goal is to make the DX fast enough to serve as the go-to way to replicate issues, interactively develop new UI features (watch mode), or fuzzy-test core features across a wide variety of contexts.

Highlights

  • significantly faster
    • all tests can run in parallel
    • all tests can run headless and only require a lightweight VSCode-Server process
    • all http is pre-recorded and played back with 0 delays (but can be controlled per request if needed)
  • more readable & maintainable
    • abstract common functionality in UIX helpers
    • allows the calling of VSCode commands
    • You can invoke custom macros that have full access to the vscode-api. This makes it trivial to set-up testing conditions without requiring tricky to time UI state
  • Flake is fully eliminated
    • all tests are 100% isolated
    • all http is recorded and can be optionally mocked for custom responses
    • timing of http responses can be controlled. This is great for being able to try things like aborting requests even thought the http is recorded
  • More dev friendly & #velocity-wins
    • you can configure every parameter of the frameworks including things like installed extensions, vscode version, user/workspace settings etc.
    • You can use playwright to auto-record your tests
    • You can leverage the excellent playwright --ui and --watch flags to create iterative dev workflows
    • Testing output in CI will contain full logs, network traces, interactive browser recording (much better than video as you can still use your chrome-devtools to inspect stuff)
    • Tests are structured with steps that make the event log more interpretable

Test Plan

This framework should not interfere or break any existing functionality as it's not currently enabled.

  • Existing tests pass
  • Manually verified that builds work across platforms

Copy link
Contributor Author

RXminuS commented Aug 21, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @RXminuS and the rest of your teammates on Graphite Graphite

@RXminuS RXminuS changed the title Allow for extension debugger E2Ev2: Baseline Framework Aug 21, 2024
@RXminuS RXminuS marked this pull request as ready for review August 21, 2024 20:56
@RXminuS
Copy link
Contributor Author

RXminuS commented Aug 21, 2024

@keegancsmith I've merged a whole stack of branches into one because most of the early PRs had the majority of their code tweaked or removed. This now feels like a good enough starting point to at least have been able to migrate 1 flaky test :-)

Would love to find some time to pair and migrate a few more together?

@RXminuS RXminuS requested a review from jhchabran August 21, 2024 21:05
Copy link
Contributor

@dominiccooney dominiccooney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some incremental feedback inline.

vscode/e2e/utils/credentials.setup.ts Outdated Show resolved Hide resolved
vscode/e2e/utils/credentials.setup.ts Outdated Show resolved Hide resolved
vscode/e2e/utils/vscody/credentials-envfile.ts Outdated Show resolved Hide resolved
vscode/e2e/utils/vscody/credentials-envfile.ts Outdated Show resolved Hide resolved
vscode/e2e/utils/vscody/credentials-envfile.ts Outdated Show resolved Hide resolved

function deactivate() {}

// create a command for running macros by name. Normally you would just call the macro directly, but this is useful for testing
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

??? what does this comment relate to?

vscode/e2e/utils/vscody/extension/main.js Show resolved Hide resolved
@RXminuS RXminuS force-pushed the rnauta/e2ev2/lockfile-fixes branch from 56aba8f to cc7ce26 Compare August 22, 2024 07:37
@keegancsmith
Copy link
Member

Would love to find some time to pair and migrate a few more together?

Lets pair monday morning?

@RXminuS RXminuS force-pushed the rnauta/e2ev2/baseline-framework branch 3 times, most recently from cf5d56c to 441afc8 Compare September 10, 2024 13:07
@RXminuS RXminuS force-pushed the rnauta/e2ev2/baseline-framework branch from 441afc8 to 2a75cc3 Compare September 10, 2024 13:53
@RXminuS RXminuS mentioned this pull request Sep 11, 2024
@RXminuS RXminuS force-pushed the rnauta/e2ev2/baseline-framework branch from 2a75cc3 to 73429a9 Compare September 13, 2024 21:25
@RXminuS RXminuS force-pushed the rnauta/e2ev2/baseline-framework branch from 73429a9 to c387e03 Compare September 18, 2024 05:59
@RXminuS RXminuS force-pushed the rnauta/e2ev2/baseline-framework branch from 3b09ee8 to 661fc38 Compare October 2, 2024 05:10
@RXminuS RXminuS force-pushed the rnauta/e2ev2/baseline-framework branch from 661fc38 to 12283bc Compare October 2, 2024 12:33
@RXminuS RXminuS merged commit cdeb84b into main Oct 2, 2024
19 checks passed
@RXminuS RXminuS deleted the rnauta/e2ev2/baseline-framework branch October 2, 2024 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants