You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Many of the tests need to run Chrome with a simple application and a debug port open and then test debug commands against it. Normally these are run headless, but for debugging it's useful to have Chrome visible. Right now this is controlled using an environment variable, but that's awkward to change. If we had a debug configuration that could pass an argument, or set an environment variable, or otherwise indicate something that was visible to the running test, that would be better.
Dart-Code always sets an env variable saying whether it's debug or run mode
If you create a launch.json config with some well-known names (for ex. "Run Test" and "Debug Test") we use them as templates for running/debugging tests
We have some other config that lets you add custom test configs that pass arguments, for ex. if you added one called "Run in Browser" and "Debug in Browser", then the Code Lens links and the context menu in the test runner should include them (so you'd have Run Test, Debug Test, Run in Browser, Debug in Browser). This couldn't easily be test-specific, but you could configure it in Workspace Settings (the project-local .vscode/settings.json file)
These seem reasonable generic, and 2/3 may help with some plumbing towards #1197 too (that's for the -p chrome flag where you run the tests actually in the browser using package:test).
2.5 Similar to (2) above, but instead of using names, we add some property that flags a config to be a template for tests, eg.:
{type: "dart",name: "Debug in Browser",// "run-test" | "debug-test" | undefined// run-test: shows in codelens/context menu and will run without debugger// debug-test: shows in codelens/context menu and will run with debugger// undefined: doesn't show anywhere - just a normal launch configtemplateFor: "run-test",args: [/*...*/],env: {/*...*/},}
Then run the Install Extension from VSIX command in VS Code, and locate the vsix file you downloaded. Then click the Reload prompt (you might not get one if you didn't already have a Dart project open).
(If you stick with this build, it'll automatically update to the next stable build when published, so you don't need to worry about uninstalling/going back unless you hit issues with it - in which case please let me know!).
Oh, I forgot to mention that currently this only shows up in Code Lens links and not in the context menu for the test runner - that's a limitation of VS Code I've filed a feature request for, but not sure we're likely to see soon.
Activity
DanTup commentedon Aug 1, 2019
Some notes from our discussion in Gitter:
Some possible ideas:
These seem reasonable generic, and 2/3 may help with some plumbing towards #1197 too (that's for the
-p chromeflag where you run the tests actually in the browser usingpackage:test).2.5 Similar to (2) above, but instead of using names, we add some property that flags a config to be a template for tests, eg.:
Allow launch configs to be used as templates for running tests
DanTup commentedon Aug 6, 2019
@alan-knight I've added support for what was discussed above - details/example are here:
#1916
If you'd like to try it out to give feedback before it goes into a release, you can download the vsix file from here:
https://github.com/Dart-Code/Dart-Code/releases/tag/v3.3.1-alpha.1
Then run the Install Extension from VSIX command in VS Code, and locate the vsix file you downloaded. Then click the Reload prompt (you might not get one if you didn't already have a Dart project open).
(If you stick with this build, it'll automatically update to the next stable build when published, so you don't need to worry about uninstalling/going back unless you hit issues with it - in which case please let me know!).
DanTup commentedon Aug 6, 2019
Oh, I forgot to mention that currently this only shows up in Code Lens links and not in the context menu for the test runner - that's a limitation of VS Code I've filed a feature request for, but not sure we're likely to see soon.
Allow launch configs to be used as templates for running tests
Allow launch configs to be used as templates for running tests