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

Convert mocked VSCode tests into integration tests PoC #510

Closed

Conversation

ruifigueira
Copy link
Contributor

I created a small test framework on top of VSCode extension testing runner and playwright tests, extending the existing tests-integration suite.

The main idea is to be able to evaluate VSCode-side code from playwright tests, in a similar way as Page.evaluate / Page.evaluateHandle. Besides, I also introduced the VSCodeHandle to keep remote references to VSCode objects that those functions may return, as well as registering local listeners over remote EventEmitters.

Another nice thing with this approach is that using a library as sinon (I use it to decorate some vscode behaviour) is as simple as installing it with npm install and dynamically import it in the VSCode function to evaluate.

With all this, I was able to create proxies with similar API to the existing mocked VSCode and converting test specs to use the integration library is as easy as changing the import, basically.

@ruifigueira ruifigueira changed the title Convert mock VSCode tests into ntegration tests PoC Convert mocked VSCode tests into integration tests PoC Jul 30, 2024
@pavelfeldman
Copy link
Member

Could you help me understand how you intend to be using this? We already have a test harness that scales well enough to allow for large number of tests with options matrices. The idea behind the integration tests is that extension does not fail miserably in the production, they were not intended to be used for correctness testing.

@ruifigueira
Copy link
Contributor Author

It was just an exercise, to see if it was feasible.

When I was extending the mocked vscode for the embedded trace viewer, I wondered if it was possible to use vscode itself. I then realized that you already had those integration tests, and so I just tried to fill the gaps.

@pavelfeldman
Copy link
Member

I'll close it as outside of the scope.

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.

2 participants