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 test suite found on windows for v0.28.5+ #2962

Closed
6 tasks done
xsjcTony opened this issue Mar 5, 2023 · 13 comments
Closed
6 tasks done

No test suite found on windows for v0.28.5+ #2962

xsjcTony opened this issue Mar 5, 2023 · 13 comments
Labels
help wanted Extra attention is needed

Comments

@xsjcTony
Copy link
Contributor

xsjcTony commented Mar 5, 2023

Describe the bug

Hey, I'm running vitest via npm scripts on Windows, which results in no test suite found for all test files.

It might be related to #2020 since it's working for me if I run the command in the docker environment which is WSL (I guess, not sure). But I still want it to be runnable locally, since it's way too slow in the Docker...

Downgrading to v0.28.4 solves the issue, which means the problem only exists for version v0.28.5 and later (I suspect some changes caused this in v0.28.5 release, doubting #2819 or #2858) (For screenshots of v0.28.4 and v0.28.5 please see below)

image

Just so you know, I don't have administrator privilege in my local environment, I'm not sure if that's causing the issue. In the Docker environment, I have all access and it's working perfectly.

But just like I said, since v0.28.4 is working as expected, there's no reason it's not working after v0.28.5 in the exact same machine and environment, there must be some changes in that release caused this issue :(

Thanks for inspecting that, appreciate it.

Reproduction

https://github.com/xsjcTony/vitest-bug-repord

Please clone and run

npm install
npm run test:unit

The original issue is #2921 but since it has been marked as "Need Reproduction" and closed automatically, so I have to open a new issue here. Sorry for the inconvience.

System Info

  System:
    OS: Windows 10 10.0.22000
    CPU: (8) x64 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz
    Memory: 14.60 GB / 31.69 GB
  Binaries:
    Node: 16.18.0 - C:\Program Files\nodejs\node.EXE
    npm: 8.19.2 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.22000.120.0), Chromium (110.0.1587.63)
    Internet Explorer: 11.0.22000.120
  npmPackages:
    @vitest/coverage-c8: 0.29.2 => 0.29.2
    @vitest/coverage-istanbul: 0.29.2 => 0.29.2
    @vitest/ui: 0.29.2 => 0.29.2
    vite: ^4.1.4 => 4.1.4
    vitest: 0.29.2 => 0.29.2

Used Package Manager

npm

Validations

@xsjcTony xsjcTony changed the title No test suite found on windows for v0.28.5+ No test suite found on windows for v0.28.5+ Mar 5, 2023
@xsjcTony
Copy link
Contributor Author

xsjcTony commented Mar 6, 2023

These are screenshots for v0.28.4 (working) and v0.28.5+ (not working, except in Docker, but I do want it to work as expected locally)

v0.28.4
image

v0.28.5
image

v0.29.2
image

v0.29.2 in the Docker environment (As you can see it's super slow)
image

@xsjcTony
Copy link
Contributor Author

Any update on this? really need the help... :(

@xsjcTony
Copy link
Contributor Author

@sheremet-va Hey, sorry to bother you as I know you are busy and really appreciate the work done by the Vitest Team.

Is there any chance this could be inspected? As I can see it's still an issue in v0.29.3.

This is currently causing big trouble for me to use the latest version of Vitest, and someone else reacted with emojis as well so I guess it's not only me.

Thanks for that.

@AriPerkkio
Copy link
Member

@xsjcTony I don't have Windows machine available but hopefully we could reproduce this issue on Windows CI.

Could you try to reduce your minimal setup a bit more:

  • Remove usage of describe.concurrent
  • Remove test.includes from vitest.config.ts
  • Add test.watch: false to vitest.config.ts
  • Remove any unnecessary file, e.g. public/, *.html, vite-env.d.ts

Maybe steps above can narrow down the issue to a specific feature of Vitest.

@xsjcTony
Copy link
Contributor Author

@AriPerkkio I think I've got the cause.

Before I explain, here's my environment.

  1. I'm using Windows 11
  2. I'm using the Terminal App
    image

So my real test project path is c:\Dev\test (focus on this capital D)

but if I enter cd c:\dev\test, it will also work:
image

And things become weird. I'm not sure if the issue is

  • limited to Vitest only, OR
  • the way NodeJS resolves paths, OR
  • just a common windows path system issue

As you can see in the screenshot below, the way Vitest (or NodeJs under the hood, I'm not sure) resolves the path is case sensitive, but the Terminal App itself (or the Windows System) doesn't care about it.

image
image

So I think, if Vitest relies on NodeJS's native path system to resolve test file paths, then I guess nothing we can do and we can just close this issue, or we can mention to care about this somewhere in the doc.

Otherwise, please inspect.

Thanks

@xsjcTony
Copy link
Contributor Author

xsjcTony commented Mar 17, 2023

I believe using pathe in v0.28.5's change likely causes the problem:

import { resolve } from 'pathe'

PR: #2819

I can't find any documentation about the case sensitivity when pathe resolves file paths, but since it's the only change regarding to path system from v0.28.4 to v0.28.5, so it might be the issue.

I'm not sure about it but I think I should at least report what I suspect

cc @sheremet-va

@xsjcTony
Copy link
Contributor Author

Confirmed the same things happens in Windows 10

@sheremet-va
Copy link
Member

sheremet-va commented Mar 17, 2023

Your reproduction works fine for me in PowerShell (Terminal app). My path is: C:\Users\name\Documents\Work\vitest-Bug-repord

@xsjcTony
Copy link
Contributor Author

xsjcTony commented Mar 17, 2023

@sheremet-va Thanks for inspecting. Can you please follow the following steps, as it reproduced the issue for me on three different windows machines:

  1. open PowerShell (no matter in Terminal App or not)
  2. run cd c:\users\name\documents\work\vitest-bug-repord (Please note it's all lowercase and please replace name with your username I guess)
  3. run the test

@sheremet-va
Copy link
Member

@sheremet-va Thanks for inspecting. Can you please follow the following steps, as it reproduced the issue for me on three different windows machines:

  1. open PowerShell (no matter in Terminal App or not)
  2. run cd c:\users\name\documents\work\vitest-bug-repord (Please note it's all lowercase and please replace name with your username I guess)
  3. run the test

Works for me:

PS C:\Users\name> cd c:\users\name\documents\work\vitest-bug-repord
PS C:\users\name\documents\work\vitest-bug-repord> npm run test:unit

@xsjcTony
Copy link
Contributor Author

I'm not getting it... :(

Snipaste_2023-03-18_07-46-10

The node version of my machines which can reproduce this is v16.18.0 and v18.14.0, I'm not sure if this matters, but just to give more details.

If really no one in the team can reproduce it... I guess nothing we can do :((((. Since all I need to do is to make sure the path matches the actual case, although it's a little bit annoying but at least it's not a show stopper.

@xsjcTony
Copy link
Contributor Author

Looks like it's a similar issue, but I've no idea if the root cause can be relevant. vitejs/vite#12923

@sheremet-va
Copy link
Member

I think it is fixed. If not, feel free to comment to reopen the issue.

@github-actions github-actions bot locked and limited conversation to collaborators Mar 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants