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

--no-threads doesn't seem to do anything (trying to use on lerna repo) #2301

Closed
6 tasks done
JamesHenry opened this issue Nov 8, 2022 · 2 comments
Closed
6 tasks done

Comments

@JamesHenry
Copy link

Describe the bug

I feel like I must be doing something wrong here...

I was curious if we could make use of vitest on lerna to help us run our tests as efficiently as possible.

It cannot complete because of a ton of these errors:

image

The fixtures we on the Nrwl team inherited when we took over stewardship of the lerna project do a process.chdir()ing

These errors with vitest are despite running with the --no-threads options

Reproduction

(This is not the end state of adding vitest to lerna because I would want to clean up the jest usage etc, but until I can get past this fundamental issue there is no point in going any further.)

I did the following:

import { defineConfig } from 'vitest/config'

export default defineConfig({
  test: {
    globals: true,
  },
})
  • ran npx vitest
  • Hit the above mentioned error, so then ran npx vitest --no-threads and it made no difference

System Info

System:
    OS: macOS 13.0
    CPU: (10) arm64 Apple M1 Max
    Memory: 3.66 GB / 64.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.15.0 - ~/.volta/tools/image/node/16.15.0/bin/node
    Yarn: 1.22.18 - ~/.volta/tools/image/yarn/1.22.18/bin/yarn
    npm: 8.12.1 - ~/.volta/tools/image/npm/8.12.1/bin/npm
  Browsers:
    Brave Browser: 106.1.44.105
    Safari: 16.1
  npmPackages:
    vitest: ^0.25.1 => 0.25.1

Used Package Manager

npm

Validations

@sheremet-va
Copy link
Member

You cannot disable this behaviour. No threads just reduces the number of workers to one.

@JamesHenry
Copy link
Author

Apologies I’ve noticed this is actually a duplicate of #1436, closing in favour of that one.

But would really appreciate any kind of hint of path forward for tests which need this…

I don’t believe it’s currently documented as part of the Jest migration guide and it should be because jest supports this just fine

@JamesHenry JamesHenry closed this as not planned Won't fix, can't repro, duplicate, stale Nov 8, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Jun 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants