Skip to content

[BUG] Unable to run individual test when multiple paths configured #348

Closed

Description

@yuriverweij

Describe the bug
When having multiple paths configured in the robot.toml file, when trying to execute a single test in the Testing section, an [ERROR] appears that the Suite contains no tests.

Steps To Reproduce
Steps to reproduce the behavior:

  1. Configure multple paths in the robot.toml (paths = ["tests", "under_development"]
  2. Have at least 1 test in both folders/suites
  3. In the Testing section of VSCode try to execute a single test

In my example I have 2 folders: "tests" & "sandbox"
Both folders contain a test.
When trying to execute a single test in "tests", I get [ERROR] Suite 'Sandbox' contains no tests or tasks.
(and vice versa, when starting a single test in "sandbox": [ERROR] Suite 'Tests' contains no tests or tasks)
When executing all tests, there is no error.

Expected behavior
When executing a specific test or suite, ignore suites that are not selected.

image

Logs
--default-path . debug --no-debug -- -P ./ --parse-include under_development/tests/example_2.robot --name Tests\ &\ Sandbox -
-suite Tests\ &\ Sandbox.Tests.Example\ 2 --by-longname Tests.Tests.Example\ 2.Example
[ ERROR ] Suite 'Sandbox' contains no tests or tasks.

Desktop

  • VS Code Version 1.94.2
  • RobotCode Version 0.96.0
  • OS: macOS
  • Python Version 3.11.7
  • RobotFramework Version 7.0.1

Activity

  1. d-biehl commented on Nov 5, 2024

    @d-biehl
    Member

    Yes, this is an open problem in the Robot Framework robotframework/robotframework#4289 that we have probably forgotten.

    The problem is that the suite names in Robot Framework are not passed on correctly if you specify several paths, but a test case is only found in one of the paths. Perhaps this will now bring the issue back into focus ;-)

    The workaround is to set a new name for the suite in your suite and say that robot should also execute empty suites. Put something like this to your robot.toml:

    paths = ["under_development/tests", "under_development/sandbox"]
    
    run-empty-suite = true
    name = "Tests & Sandbox"
  2. d-biehl commented on Nov 11, 2024

    @d-biehl
    Member

    @yuriverweij does this work for you?

  3. yuriverweij commented on Nov 14, 2024

    @yuriverweij
    Author

    That works for me. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions