Couldn't make executionWrapper to work
See original GitHub issueChecklist
- The issue is about this extension and NOT about a fork.
- Check the known issues list.
- The latest version of the extension was used.
- It is not related to remote-vscode or I checked the following issue
- Imagine yourself into my position and think how hard to debug the issue without insufficient information. I understand that you have privacy concerns and I expect you to understand that this extension is developed for free. Thanks.
Describe the bug
I test the code that is supposed to run under the root privileges. Moreover, I do use remote to debug, but this is not the failure I see in the ticket #201 that is mentioned above. The problem is that the executionWrapper
doesn’t work for me. The configuration is as follows:
"testMate.cpp.test.advancedExecutables": [
{
"name" : "gtest",
"pattern": "**/gtest",
"executionWrapper": {
"path": "sudo",
"args": [ "${argsFlat}", "-d", "5" ]
},
}
],
My gtest
executable was added to NOPASSWD list in the sudoers
files for my account. I’ve tested the command by manually running it from the command line and it worked. It ran without asking for the password. Moreover, the Test-Explorer shows the list of the tests correctly. But when I request to run a test, in the output window I see that it shows that sudo wasn’t called and even other argument specified about (i.e. “-d”, “5”) do not appear:
$12│ ❌ Executable run is finished with error.$12│ "~/github/project/tests/googletest/gtest"" "--gtest_color=no"" "--gtest_filter=<here is a long list of the selected group of tests"" "--gtest_also_run_disabled_tests""$12│ ❗️ Test has ended unexpectedly: Signal received: SIGSEGV
As you can see neiter sudo
nor extra arguments appear there. I also tried to replace in the settings the line "args": [ "${argsFlat}", "-d", "5" ]
with "args": [ "${cmd}", "${argsFlat}", "-d", "5" ]
, which made it only worse. In the latter configuration even Test Explorer shows nothing.
To Reproduce
To reproduce the failure I believe you need the following:
- Create a VM with Ubuntu (I am using 20.04)
- Set the configurations to allow SSH connection to the VM from the Windows machine
- Create a directory on a drive of this VM and place there a simple c++ hello world with google tests and dummy tests
- From a Windows Machine open VSCode
- Install Remote Development extension pack
- Use Command Palette to invoke “Remote-SSH: Connect to Host …”
- Install “C++ TestMate” and configure the setting as specified above.
- Compile the program with the tests and try to issue the unit-tests
Desktop
- Extension Version: v4.3.0
- VS Code Version: 1.71.2
- Google Test: Unfortunately, I don’t know; I only know that it came after 2017 at least (if not later)
- OS Type and Version: Windows 11
- Using remote-ssh/docker/wsl?: Remote-SSH to a server running Ubuntu Server 20.04
Regression bug?
I tried even with C++ TestMate Legacy. There results even worse, I have no idea how to get the logs of the failure.
- Last extension version in which the feature were working: Never seen it working
Log (optional but recommended)
I have the only log that I mentioned above.
Thank you, Arseniy
Issue Analytics
- State:
- Created a year ago
- Comments:9 (4 by maintainers)
Top GitHub Comments
Happy to hear that the main problem is solved.
Regarding to the parallelism. I’m afraid you did set the settings right…
One possible explanation could be that your tests depending on each other in an ordered way. The extension has its own ordering an it will run the tests in that order. Try to run your executable a couple of times from command lines with shuffling. If it fails that would mean that the issue is probably in your code not in the extension. If succeeds fine like 10 times then it likely the extensions fault.
In that case please open a new issue with log attached and I will look into it. (or you can try to read it too, not too complicated)
Hi @matepek, I’ve tried your idea with
SETUID
and it works great. Thank you. Now I finally can run and debug conveniently the code, without usingsudo
as an execution-wrapper.However, I have encountered another issue. Some tests in our test-suite are running on HW, and as such cannot run simultaneously. Following the guidelines of the documentation I added the following settings to my
settings.json
to ensure no parallelism and infinite time of execution:When I run the tests from the command line manually, the tests are passing without an issue. When I run it from the VSCODE each test-suite independently, the tests of each test-suite pass perfectly. However, if I request to run them all, the tests start colliding and start failing. Is there something in the settings that I should configure more? Am I missing something?
Thank you, Arseniy