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

empty tests list for after v0.14.1 #57

Closed
alanlivio opened this issue Nov 5, 2022 · 13 comments
Closed

empty tests list for after v0.14.1 #57

alanlivio opened this issue Nov 5, 2022 · 13 comments
Labels
bug Something isn't working

Comments

@alanlivio
Copy link

alanlivio commented Nov 5, 2022

Hi. I used cmake-test-explorer in the past successfully. But now I find an empty list when using it.
So, I tried rollback into multiple versions and the more recent version in which the extension work properly is v0.14.1.
My stat is:
code 1.73.0
TestExplorer UI v2.21.1
TestAdater v0.1.6.

Any suggestion?

@alanlivio alanlivio changed the title empty tests lists for after v0.14.1 empty tests list for after v0.14.1 Nov 5, 2022
@fredericbonnet
Copy link
Owner

Hi, thanks for reporting! I can't reproduce the issue locally with the same versions as above, is there any error message displayed in the interface or the output pane?

@fredericbonnet fredericbonnet added the bug Something isn't working label Nov 5, 2022
@alanlivio
Copy link
Author

alanlivio commented Nov 6, 2022

Many Thanks for you response @fredericbonnet.

is there any error message displayed in the interface or the output pane?

Where exactly I can see error msgs? I tried this "Test Explorer" dropdown option at the tab "Output" tab but no msg.

image

I also use "cmakeExplorer.cmakeIntegration": true but nothing changes if disabled.
I also tried to enable/disabled "testExplorer.useNativeTesting".

To be more precisely on my problem, please see the Testing tab:

in version >=0.14.2
image

and in version 0.14.1 (expected)

image

@fredericbonnet
Copy link
Owner

fredericbonnet commented Nov 6, 2022

The only change introduced by version 0.14.2 is this PR: #39

Basically it only activates the extension when a CMakeLists.txt is present in the workspace. Can you check that it's the case?

@alanlivio
Copy link
Author

Many thanks again @fredericbonnet.

it only activates the extension when a CMakeLists.txt is present in the workspace. Can you check that it's the case?

It is not the case. The CMakeLists.txs is at the root of my project https://github.com/telemidia/ginga

I tried clean VSCode caching but now even the testing button in the activities menu doesn't show up.

at >=0.14.2
image

at <=0.14.1
image

@fredericbonnet
Copy link
Owner

Hmm that's strange, I've just cloned your project in a codespace and the test button is there, I can also display the log pane. Can you try in another environment ?

@alanlivio
Copy link
Author

Many thanks @fredericbonnet

I've just cloned your project in a codespace and the test button is there

I discovered that the button is regarding the "testExplorer.useNativeTesting": true See the screecaptore below.

Code_635

Can you try in another environment ?

I tried a WSL environment and had the same problem. See the below screenshots (without "testExplorer.useNativeTesting": false )
Do you have suggest I way to debug to find the error?

WSL env with 0.14.1

Code_636

WSL env with 0.14.2

image

@alanlivio
Copy link
Author

Hi again @fredericbonnet.
To go further, I also tried this simple cmake example but I face the same problem. It works only at v0.14.1.
I also tried to enable cmakeExplorer.logpanel but did not log at "Output > Test Explorer".
Do you have another suggestion?

@fredericbonnet
Copy link
Owner

Hi, I managed to clone and compile your project on a Linux VM (sorry I don't have WSL), and the extension detects the tests just fine (after setting cmakeExplorer.buildDir to ${workspaceFolder}/build since that's where the CMake build files are located).

Setting testExplorer.useNativeTesting doesn't change anything besides the UI. Maybe there's a problem with your VS Code global settings that prevents the extension from activating properly, have you tried on another host machine? (not a VM with remote).

In the Output pane, under Log (Extension Host) you should see something like that:

2022-11-23 23:02:56.117 [info] ExtensionService#_doActivateExtension fredericbonnet.cmake-test-adapter, startup: true, activationEvent: 'workspaceContains:**/CMakeLists.txt'

@alanlivio
Copy link
Author

alanlivio commented Nov 24, 2022

managed to clone and compile your project on a Linux VM (sorry I don't have WSL),

Sorry if I made confusion. My normal environment is windows11 with msys2. I only used the WSL because when you asked me to try another environment. I list below my attempts.

  • FAIL: windows11, code 1.73.1, TestExplorer UI v2.21.1, TestAdater v0.1.6, camke-test-explorer >v0.14.1, msys2 tool chain (cmake, gcc, g++), testExplorer.useNativeTesting true/false
  • FAIL: windows11, code 1.73.1, TestExplorer UI v2.21.1, TestAdater v0.1.6, camke-test-explorer >v0.14.1, WSL gcc tool chain (cmake, gcc, g++), testExplorer.useNativeTesting true/false

In the Output pane, under Log (Extension Host) you should see something like that:
2022-11-23 23:02:56.117 [info] ExtensionService#_doActivateExtension fredericbonnet.cmake-test-adapter, startup: true, activationEvent: 'workspaceContains:**/CMakeLists.txt'

I am not seeing this or any log. I tried to enable cmakeExplorer.logpanel but did not log at "Output > Test Explorer".

@fredericbonnet
Copy link
Owner

Hey, sorry for the delay. Can you try running the command Developer: Show Running Extensions and check whether the extension is listed there? You should also find Test Explorer UI. The Developer: Open Extension Log Folder is also useful to see all the log files produced by your extensions.

Also, maybe it's an issue with other extensions. Try disabling everything but this one and see if it changes anything.

In last resort you can try removing the activation event manually: go to the %USERPROFILE%\.vscode\extensions folder, find the extension folder fredericbonnet.cmake-test-adapter-*, edit the package.json, replace this line:

	"activationEvents": [
		"workspaceContains:**/CMakeLists.txt"
	],

with:

	"activationEvents": [
		"*"
	],

Then reload the window (Developer: Reload Window). It should display the following message:

image

Click Reload Window, now the extension should be activated (check again with Developer: Show Running Extensions)

@alanlivio
Copy link
Author

Many thanks for your time @fredericbonnet. It worked with that change at v0.16.3. I even double check by installing again, and it only works with that change.

@alanlivio
Copy link
Author

Just to add that I still does not see the log at Output. I don't know if is also a problem.

image

@fredericbonnet
Copy link
Owner

I have the same behavior, it seems that the native UI breaks test output support and that it only works with the Test Explorer UI. I plan to port the extension to the new test API eventually, hopefully there will be a way to fix that.

BTW the temporary fix will only work as long as you don't update the extension, I'll try to find a way to fix the activation in the next version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants