Vector Test Unit for Visual Studio CodeThis extension supports you in creating and editing Vector test units ( It interacts with the CAPL, Python, and C# extensions and provides them with type libraries which are necessary to write test implementations. It provides editing support for test unit configuration files with file endings Depending on your use case it can also assist you in building and running the test unit. PrerequisitesThe Vector Test Unit extension requires a Vector toolset to be installed. The Vector toolset comes with any CANoe or CANoe Server Edition. It is also part of the freely available Vector Test Unit Runner. Note, that the DevOps workflow is only available with the Server Editions of CANoe and Vector Test Unit Runner as of toolset version 17. The CANoe workflow is only available with the Desktop Editions of CANoe as of toolset version 18. The currently selected toolset is shown in the status bar.
By default, the latest installed version is used.
To select a specific version, use the command The Vector Simulation and Test Environment extension extension is installed automatically as a dependency.
It provides your test unit with the environment from a The YAML extension is required for editing For editing the actual test implementations, please install the respective programming language extensions CAPL, Python, and C#. UsageThis extension supports two different workflows. The DevOps workflow is tailored towards the Server Editions of CANoe and Vector Test Unit Runner. The CANoe workflow is for editing vtestunit.yaml-based test units in CANoe editions with a GUI. Editing test implementationsWith this extension all CAPL test files referenced in the test unit description file of the active test unit and all included files will automatically have the test-specific CAPL features enabled. For editing tests written in C# or Python this extension will enable you to ...
In case of C# tests the extension additionally enables you to use the .NET assemblies referenced in the test unit description file. In case of Python the packages referenced in the test unit description file should be resolved by default by the Pylance extension. The C# and Python language support is updated at startup and when changing the active test unit. If you want to update it manually, e.g. when you have just written a CAPL function that you now want to use in a C# or Python test file you can do so using the commands DevOps workflowThe Vector Test Unit extension discovers all test units in the current workspace by their description files Test unit description file supportThe extension provides editing support for the configuration files Building a test unitBefore a test unit can be executed it must be built. The extension provides a build task that can be executed using the commands
Running a test unitThis extension provides a Test Explorer for executing the whole test unit or individual tests. It gives a visual representation of the test tree and directly shows the status of each test tree element. If your test unit uses variants, you can select a variant value in the bottom of the Test Explorer. Running tests in the Test Explorer requires at least version 18 of the Vector toolset. The resulting test report can be opened by clicking on the link in the test run output. Test runs can be customized via a ExamplePlease refer to the documentation installed with your Vector toolset for details on how to implement test units. This chapter just provides a short example to facilitate getting started with writing test units for CANoe and Vector Test Unit Runner. A test unit is described using a YAML file with file ending
A test execution tree specifies in which order test cases and test sequences are executed.
It is described using a YAML file with file ending
The actual test implementation in
CANoe workflowFor Vector toolsets beginning at version 18 this extension can also be used to edit YAML-based test units in CANoe. First, you must configure Visual Studio Code as editor for test unit description files. The setting can be found in the CANoe options under External Programs > Tools > Editor for test units of format vtestunit.yaml. Afterwards you can click the Open test design button to edit your test unit in Visual Studio Code. The environment from your CANoe configuration (e.g., system variables and distributed objects) will be available in your test implementations. To run your tests, please use the Test Configuration window in CANoe. FAQ
This extension takes
In case of any troubles with C# IntelliSense, we recommend configuring the C# extension to use the OmniSharp Language Server instead of the default one. You can do this by enabling the following two workspace settings:
Please note that this will disable the
Unfortunately, the Pylint extension does not yet respect the Python environment defined via the |