robotcodedev / robotcode

RobotFramework support for Visual Studio Code
https://robotcode.io
Apache License 2.0
173 stars 14 forks source link

[BUG] Tests are not found when starting via VSCode Testing pane from Testcase level (0.34.0+) #138

Closed Marc2508 closed 1 year ago

Marc2508 commented 1 year ago

Describe the bug Starting with 0.34.0 we are getting an error when we are starting a single test case via the Testing view in VS code.

d-biehl.robotcode-0.34.0/bundled/tool/robotcode debug --no-debug -- -d test_results --suite Tests.Robot.First\ Robot\ Suite --by-longname Tests.Robot.First\ Robot\ Suite.Testcase:\ My\ first\ test\ case . 
[ ERROR ] Suite 'Tests' contains no tests after model modifiers.

It is still working when we are starting the tests from levels above the testcase one:

d-biehl.robotcode-0.34.0/bundled/tool/robotcode debug --no-debug -- -d test_results --suite Tests.Robot.First\ Robot\ Suite --by-longname Tests.Robot.First\ Robot\ Suite . 
==============================================================================
Tests                                              
==============================================================================
Tests.Robot                                     
==============================================================================
Tests.Robot.First Robot Suite ...
==============================================================================
Testcase: My first test case...                                       | PASS |

To Reproduce Steps to reproduce the behavior:

  1. Open the Testing view in VS Code
  2. The plugin should have explored the Test structure:
    v Tests
    v Robot
    v First Robot Suite
      v Testcase: My first test case
      v Testcase: My second test case
      v ...
  3. Start testcase "Testcase: My first test case" by "Run Test" or "Debug Test"
  4. There is no issue if the same is done for: Tests -> "Run Test" or "Debug Test" Robot -> "Run Test" or "Debug Test" First Robot Suite -> "Run Test" or "Debug Test"

Expected behavior When going back to 0.33.0 it is again possible to run tests from testcase level, which is the desired behavior.

Logs There are no logs written to output.

Desktop (please complete the following information):

d-biehl commented 1 year ago

yesterday I published version 0.35.0, where I fixed something regarding starting/debugging tests. Did you try this version?

d-biehl commented 1 year ago

ok, I see you are using a ':' in the test case name. I have changed the way test cases are started. In the RobotFramework documentation it says that you can use all characters in testcase names and a little hint about '*' and '?' characters. However, there are some other characters you should not use in test case names, as they may cause problems on the command line. These include ':' and ';' because they are used as parameter separators in e.g. listeners and modifiers. But also the '.' characters should not be used in test case names, since these are internally the separator for the namespaces.

Nevertheless, I try to mask all these characters in the right places as good as possible and when changing the start behavior of testcases I probably forgot one little thing ;-)

I will have it fixed with the next release coming today or tomorrow.

Marc2508 commented 1 year ago

Thanks a lot, we will check the naming. Just for completeness 0.35.0 has this issue too.

d-biehl commented 1 year ago

this is fixed in the latest version.