Skip to main content
GitHub GitLab
Git Integration (formerly Qodo Merge) – AI code review agents for pull requests. This documentation describes the Qodo v1 experience. For the Qodo v2 documentation, click here.
The test tool generate tests for a selected component, based on the PR code changes. The test tool supports the programming languages: Python, Java, C++, JavaScript, TypeScript, C#.

How to use the test tool

This tool can also be triggered interactively by using the analyze tool. Manual usage Comment on the PR:
/test component_name
The tool will generate tests for the selected component. If no component is selected, test will generate tests for largest component.

Choosing components

You can set the component name as the name of a specific component in the PR. To get a list of the components that changed in the PR and choose the relevant component interactively, use the analyze tool.

Configuration options

Configure the test tool by setting configurations under the pr_test part in your configuration file.
Possible configurationsDefault valueWhat they do
num_tests3Number of tests to generate.
testing_frameworkFor Python: pytest,
For Java: JUnit,
For C++: Catch2,
For JavaScript & TypeScript: jest
The testing framework to use.
avoid_mockstrueIf set to true, the tool will try to avoid using mocks in the generated tests. Note that even if this option is set to true, the tool might still use mocks if it cannot generate a test without them.
extra_instructionsnoneOptional extra instructions for the tool. For example: “focus on the changes in the file X”, “Ignore changes in …”
filenoneLets you specify a relevant file in case there are several components with the same name.
class_namenoneLets you specify a relevant class name in case there are several methods with the same name in the same file.
enable_help_texttrueIf set to true, the tool will add a help text to the PR comment.

Example usage