##################### Steps to reproduce ##################
- Execute the attached setup.bat to create a minimal RobotCode project.
- Open the generated folder in VS Code.
- Open the Testing view.
Expected behavior
Both test roots are discovered and tests can be executed.
Actual behavior
Discovery works correctly.
robotcode discover all
returns:
Path1 & Path2
├─ Path1
└─ Path2
However execution fails:
- If a test from Path1 is started:
Suite 'Path2' contains no tests or tasks.
- If a test from Path2 is started:
Suite 'Path1' contains no tests or tasks.
The problem occurs when multiple entries are configured in:
paths = [
"Tests/path1",
"Tests/path2",
]
With only a single path configured, test execution works correctly.
##################### setup.bat ########################
echo Creating virtual environment...
if not exist ".venv" (
python -m venv .venv
)
echo Creating .robot.toml...
if not exist ".robot.toml" (
(
echo output-dir = "results"
echo.
echo paths = [
echo "Tests/path1",
echo "Tests/path2",
echo ]
) > .robot.toml
)
echo Creating test directories...
if not exist "Tests" mkdir Tests
if not exist "Tests\path1" mkdir Tests\path1
if not exist "Tests\path2" mkdir Tests\path2
echo Creating suite1.robot...
if not exist "Tests\path1\suite1.robot" (
(
echo *** Settings ***
echo.
echo.
echo *** Test Cases ***
echo Suite 1 test 1
echo Log Suite 1 test 1
echo.
echo Suite 1 test 2
echo Log Suite 1 test 2
) > Tests\path1\suite1.robot
)
echo Creating suite2.robot...
if not exist "Tests\path2\suite2.robot" (
(
echo *** Settings ***
echo.
echo.
echo *** Test Cases ***
echo Suite 2 test 1
echo Log Suite 2 test 1
echo.
echo Suite 2 test 2
echo Log Suite 2 test 2
) > Tests\path2\suite2.robot
)
echo Creating VS Code settings...
if not exist ".vscode" (
mkdir .vscode
)
if not exist ".vscode\settings.json" (
(
echo {
echo "python.defaultInterpreterPath": "${workspaceFolder}/.venv/Scripts/python.exe"
echo }
) > .vscode\settings.json
)
echo Activating virtual environment...
call .venv\Scripts\activate.bat
echo Updating pip...
python -m pip install --upgrade pip
echo Installing Robot Framework...
pip install robotframework==7.0
echo Installing RobotCode...
pip install robotcode==0.87.0
pip install robotcode-runner==0.87.0
echo Installing VS Code extensions...
code --install-extension ms-python.python --force
code --install-extension d-biehl.robotcode --force
echo.
echo ==========================================
echo Setup complete.
echo ==========================================
echo.
echo Next steps:
echo.
echo code .
echo.
echo Open the Testing view and run one of the tests.
echo.
echo Expected behaviour:
echo Discovery works:
echo Path1 ^& Path2
echo.
echo Running a test fails:
echo Suite 'Path1' contains no tests or tasks.
echo or
echo Suite 'Path2' contains no tests or tasks.
echo.
echo Verify discovery with:
echo.
echo robotcode discover all
echo.
pause
##################### Steps to reproduce ##################
Expected behavior
Both test roots are discovered and tests can be executed.
Actual behavior
Discovery works correctly.
robotcode discover all
returns:
Path1 & Path2
├─ Path1
└─ Path2
However execution fails:
Suite 'Path2' contains no tests or tasks.
Suite 'Path1' contains no tests or tasks.
The problem occurs when multiple entries are configured in:
paths = [
"Tests/path1",
"Tests/path2",
]
With only a single path configured, test execution works correctly.
##################### setup.bat ########################
echo Creating virtual environment...
if not exist ".venv" (
python -m venv .venv
)
echo Creating .robot.toml...
if not exist ".robot.toml" (
(
echo output-dir = "results"
echo.
echo paths = [
echo "Tests/path1",
echo "Tests/path2",
echo ]
) > .robot.toml
)
echo Creating test directories...
if not exist "Tests" mkdir Tests
if not exist "Tests\path1" mkdir Tests\path1
if not exist "Tests\path2" mkdir Tests\path2
echo Creating suite1.robot...
if not exist "Tests\path1\suite1.robot" (
(
echo *** Settings ***
echo.
echo.
echo *** Test Cases ***
echo Suite 1 test 1
echo Log Suite 1 test 1
echo.
echo Suite 1 test 2
echo Log Suite 1 test 2
) > Tests\path1\suite1.robot
)
echo Creating suite2.robot...
if not exist "Tests\path2\suite2.robot" (
(
echo *** Settings ***
echo.
echo.
echo *** Test Cases ***
echo Suite 2 test 1
echo Log Suite 2 test 1
echo.
echo Suite 2 test 2
echo Log Suite 2 test 2
) > Tests\path2\suite2.robot
)
echo Creating VS Code settings...
if not exist ".vscode" (
mkdir .vscode
)
if not exist ".vscode\settings.json" (
(
echo {
echo "python.defaultInterpreterPath": "${workspaceFolder}/.venv/Scripts/python.exe"
echo }
) > .vscode\settings.json
)
echo Activating virtual environment...
call .venv\Scripts\activate.bat
echo Updating pip...
python -m pip install --upgrade pip
echo Installing Robot Framework...
pip install robotframework==7.0
echo Installing RobotCode...
pip install robotcode==0.87.0
pip install robotcode-runner==0.87.0
echo Installing VS Code extensions...
code --install-extension ms-python.python --force
code --install-extension d-biehl.robotcode --force
echo.
echo ==========================================
echo Setup complete.
echo ==========================================
echo.
echo Next steps:
echo.
echo code .
echo.
echo Open the Testing view and run one of the tests.
echo.
echo Expected behaviour:
echo Discovery works:
echo Path1 ^& Path2
echo.
echo Running a test fails:
echo Suite 'Path1' contains no tests or tasks.
echo or
echo Suite 'Path2' contains no tests or tasks.
echo.
echo Verify discovery with:
echo.
echo robotcode discover all
echo.
pause