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

Duplicate test execution with monorepo/workspace setup #183

Closed
jzillmann opened this issue Sep 28, 2023 · 4 comments
Closed

Duplicate test execution with monorepo/workspace setup #183

jzillmann opened this issue Sep 28, 2023 · 4 comments
Labels
p3-minor-bug An edge case that only affects very specific usage (priority)

Comments

@jzillmann
Copy link

Describe the bug
Using VSCodes xxx.code-workspace file and setting the ROOT folder up as well, leads to vitest running the tests twice.

[INFO 2:51:23 PM] Tests run start
[INFO 2:51:23 PM] [Workspace "ROOT] Run tests from workspace
[INFO 2:51:23 PM] [Execute Vitest] /myproject/node_modules/.bin/vitest /myproject/frontend/src/editor/complete4.test.ts -t options default functions
[INFO 2:51:23 PM] [Workspace "frontend] Run tests from workspace
[INFO 2:51:23 PM] [Execute Vitest] /myproject/node_modules/.bin/vitest /myproject/frontend/src/editor/complete4.test.ts -t options default functions
[INFO 2:51:23 PM] Start api process at port 61934
[INFO 2:51:23 PM] [RUN] /myproject/node_modules/.bin/vitest /myproject/frontend/src/editor/complete4.test.ts -t options default functions
[INFO 2:51:23 PM] [RUN.cwd] /myproject
[INFO 2:51:23 PM] Start api process at port 61935
[INFO 2:51:23 PM] [RUN] /myproject/node_modules/.bin/vitest /myproject/frontend/src/editor/complete4.test.ts -t options default functions
[INFO 2:51:23 PM] [RUN.cwd] /myproject/frontend

With this .code-workspace it runs the tests twice as shown above:

{
  "folders": [
    {
      "name": "ROOT",
      "path": "../"
    },
    {
      "name": "backend",
      "path": "../backend"
    },
    {
      "name": "frontend",
      "path": "../frontend"
    }
  ],
  "settings": {}
}

If I remove the ROOT folder the tests are only executed once.

To Reproduce

See setup above. Create a (npm) monorepo with vscode workspaces setup while including the ROOT folder as well.
Use the VSCode extension to run in test in a submodule.

Expected behavior
Shouldn't run the tests two times.

Screenshots
n/a

Environment

  • OS: macOS
  • VSCode version: 1.82.2
  • Vitest version: 0.34.4
  • Vitest plugin version: v0.2.42

Additional notes
As a side effect it seems to produce #47 sporadically.

@jzillmann jzillmann added the p3-minor-bug An edge case that only affects very specific usage (priority) label Sep 28, 2023
@marviobezerra
Copy link

I'm facing the same issue.

@ennioVisco
Copy link

Did you find a solution to this?

@ffMathy
Copy link
Collaborator

ffMathy commented Feb 18, 2024

This should be greatly improved with #241, #232 and #231. I no longer get these issues.

@ffMathy
Copy link
Collaborator

ffMathy commented Feb 19, 2024

Let's re-open this if it re-occurs for someone.

@ffMathy ffMathy closed this as completed Feb 19, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Mar 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
p3-minor-bug An edge case that only affects very specific usage (priority)
Projects
None yet
Development

No branches or pull requests

4 participants