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

[ERROR] No tests found, check the SearchPattern in the extension settings #35

Closed
ffMathy opened this issue Aug 23, 2020 · 2 comments · Fixed by #41
Closed

[ERROR] No tests found, check the SearchPattern in the extension settings #35

ffMathy opened this issue Aug 23, 2020 · 2 comments · Fixed by #41

Comments

@ffMathy
Copy link

ffMathy commented Aug 23, 2020

It's for this project: https://github.com/dogger/app.dogger.io

I'm just running it from the root.

Glob pattern is set to: "**/bin/**/*.Tests.{dll,exe}"

@andrewbridge
Copy link
Contributor

Hi @ffMathy,

Apologies for the delay in getting back to you!

You'll need to remove "**/bin/": true from L5 of your .vscode/settings.json for the adapter to discover tests correctly. Moving that line into files.watcherExclude may mitigate any performance issues that may arise elsewhere in VSCode.


Further details

Our discovery phase uses the VSCode API to find the necessary binaries (we use the findFiles method in our file discovery). This allows the adapter to run reliably, regardless of how VSCode is being run (remotely, in browser, across platforms etc), however it does also mean the adapter is caught in the confusion of how this method works (1, 2, 3, 4).

The files.exclude and search.exclude settings both have an impact on the files visible to extensions that use this method. Extensions that use file watchers, like ours, are also affected by the files.watcherExclude setting. The reason no tests are found in your project is that you are excluding bin directories in your files.exclude project setting.

It's possible for us to ignore all exclusions except those in the extension skippattern setting during the discovery phase, but we're not able to ignore exclusions when setting file watchers. Between that inconsistency and the potential performance hit in big codebases or over slow remote connections, it doesn't seem worthwhile to add an additional override setting to allow this.

I'll add further information and a link to this issue in our readme so this is clear from the outset. Additionally, in diagnosing your issue, I have made a few unrelated fixes to our adapter, so many thanks!

I'll close this issue when I merge in the update to the readme, but feel free to reopen if my suggestion hasn't worked as expected.

@junalmeida
Copy link

@andrewbridge Would you consider any alternative approach for discovery? It is very annoying to see binaries on file explorer. Maybe an alternative is to use dotnet command to discover tests?
dotnet test -t --nologo --no-build

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants