ppparihar / GoTestExplorer

A Go Test Explorer for VS code (https://marketplace.visualstudio.com/items?itemName=premparihar.gotestexplorer)
47 stars 8 forks source link

Loads indefinitely, no logging statements #10

Closed Divni closed 5 years ago

Divni commented 5 years ago

I'm using this with a project that has no go files in the root folder, which might be related. Unfortunately it's not an open-source project so I cannot share it. But we run our tests using the output of go list ./..., which might be useful for this addon.

I'd say the biggest issue here is that it doesn't seem to conclude that "nope, there's nothing I can use here", as well as that it does not log anything useful to allow me to debug why that's not happening.

ppparihar commented 5 years ago

@Divni Thanks for reporting the issue. I'll love to work on it. As there is not much information to getting started. Can you please confirm if anything is true in your case.

  1. If you have multiple workspaces in vscode then it will only look into only the first workspace to discover the tests.
  2. if you project contains src folder at root level then it will discover test within that folder only.
  3. It assumes all the third party package are in the vendor folder and there is no need to discover tests there.

Feel free to add any additional details if you think that can help to investigate the issue.

Divni commented 5 years ago
  1. I'm not sure what this means, is this a vscode feature I'm not aware of? Odds are I am not using multiple..
  2. It does not have a src folder, all go files reside in internal, pkg and a custom named folder
  3. This is fine, vendor is used as intended; by vendored packages only

What logic do you use to find tests? Any reason not to use go list ./...?

ppparihar commented 5 years ago

@divni all things are looking good at your end. I will add some extra logging to catch the issue. Now days I'm running with short of time and won't be able to add logging now. I will do it in my free time. If you don't mind, can you clone this repo and run it in debug mode and then try to load go tests and see where it is failing (it's very easy to debug this extension and it won't take more than 5min). If possible please share error logs.

The extension needs some file realated information hence it search for files which end with _test.go and use go-outline tool to extract metadata of tests.

Divni commented 5 years ago

Here you go:

Error: ELOOP: too many symbolic links encountered, stat '/Users/divni/.go/src/github.com/-removed-/cli/internal/virtualenvironment/golang/testdata/generated/config/test/src/github.com/github.com/github.com/github.com/github.com/github.com/github.com/github.com/github.com/github.com/github.com/github.com/github.com/github.com/github.com/github.com/github.com/github.com/github.com/github.com/github.com/github.com/github.com/github.com/github.com/github.com/github.com/github.com/github.com/github.com/github.com/github.com/github.com'
testDiscovery.ts:23

After seeing this error I was able to go into the folder and delete the offending directory structure. Definitely seems right for your addon to "fail" on this, but the failure should probably be a bit more graceful.

Anyway, that solved the issue for me :) Thanks!

ppparihar commented 5 years ago

It has been closed as part of #11