opTestrunner
This repository provides the pytest-optestrunner plugin, which executes simulations based on given configurations and evaluates the results. For more details on how the plugin works, please refer to the plugin documentation.
Debugging
To debug the pytest-optestrunner plugin, follow these steps:
1. Prepare the Environment
Run the prepare.sh script. Before executing, ensure the PYTHON_EXECUTABLE environment variable is set. For example:
export PYTHON_EXECUTABLE=/path/to/python
cd utils/ci/scripts
./prepare.sh
This script creates a virtual environment and installs all the necessary pip packages required for building the plugin.
2. Install in Editable Mode
Change the working directory to plugin/optestrunner and install the plugin in editable mode:
cd plugin/optestrunner
pip install -e .
3. Use the Debug Configuration
Use the following launch.json configuration in VSCode to start debugging:
{
"version": "0.2.0",
"configurations": [
{
"name": "Python Debugger: plugin",
"type": "debugpy",
"request": "launch",
"module": "pytest",
"cwd": "${workspaceFolder}/plugin/optestrunner",
"console": "integratedTerminal",
"args": [
"--simulation=/path/to/opSimulation",
"--mutual=/path/to/Common",
"--resources=/path/to/Configurations",
"--allowed-warnings=/path/to/allowed_warnings.txt",
"/path/to/test_*.json"
]
}
]
}