Skip to content

Support running extension tests from command-line when same flavour of vscode is open #137678

Closed

Description

As described in #112793, you can't run extension tests from the command-line if the flavour of VSCode needed to run the tests is already open (stable/insiders).

Using the command-line for testing (rather than debug launch from inside VSCode) is often important in more complex projects that might have multiple test suites and where not every development workflow involves having VSCode actually open.

The limitation makes testing a bit more inconvenient:

  • If you really want to test against insiders so that automated tests catch problems quickly then you can't also use insiders as your normal IDE so that the human developer notices other kinds of problems.
  • Even if you don't mind which version you test against, you either need to get your whole team to standardise on the other flavour for their development, or you need to make it a parameter that can be configured when they run the tests.

None of these are absolute blockers, but the limitation certainly adds friction.

CC Isidor Nikolic (@isidorn)

Activity

  1. bpasero commented on Nov 23, 2021

    @bpasero
    Contributor

    As a workaround, passing --user-data-dir <path> that is separate from the running instance should work.

  2. connor4312 commented on Nov 23, 2021

    @connor4312
    Member

    I wonder if we should do this by default, set the user data and extension dirs to ${dir}-test. It would also prevent user settings or extensions from interfering with tests, which they can easily do.

  3. bpasero commented on Nov 24, 2021

    @bpasero
    Contributor

    Yeah in fact our very own integration (API) tests always open VS Code on a random user data dir:

    VSCODEUSERDATADIR=`mktemp -d 2>/dev/null`

  4. added
    feature-request
    on Nov 24, 2021
  5. hsenag commented on Nov 29, 2021

    @hsenag
    Author

    As a workaround, passing --user-data-dir <path> that is separate from the running instance should work.

    Thanks! Using this now and it's looking good.

  6. added
    verification-needed
    on Jan 25, 2022
  7. connor4312 commented on Jan 25, 2022

    @connor4312
    Member

    Verifier:

    • Test that you can do this ^ on @vscode/test-electron 2.0.0 or newer. This creates and uses a user data dir in the .vscode-test folder
    • Test that you can pass reuseMachineInstall: true in the call to runTests to use the old behavior (use the global user data dir)
  8. rchiodo commented on Jan 26, 2022

    @rchiodo
    Contributor

    /verified using jupyter extension tests after upgrading to newest test-electron.

    • Running with reusedMachineInstall will give an error if VS code is already open
    • Running with no user-data-dir will generate one
  9. locked and limited conversation to collaborators on Jan 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

extensions-developmentfeature-requestverification-neededverified

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions