Test definitions
Test definitions control how P4 Code Review constructs and sends test requests to your CI system. They include configuration options that affect test URLs and how project and branch identifiers are encoded. These settings ensure that automated test calls behave correctly across different CI environments
project_and_branch_separator
P4 Code Review can pass project and branch identifiers to your CI system using special test URL variables. The project_and_branch_separator setting defines the character used to separate the {projects} and {branches} values inside generated URLs.
Some CI systems, such as Jenkins, escape certain characters, causing URLs to be interpreted incorrectly and tests to fail. The default separator is a colon (:), which some CI systems may modify.
Recommended alternatives
You may change the separator to a character your CI system accepts, such as:
-
Dash:
- -
Underscore:
_
These characters avoid common problems with escaping and URL parsing
Characters to avoid
Certain characters will break test requests:
-
#– Interpreted as a URL fragment anchor -
%– Escaped inside JSON content, causing malformed data
Either can cause test execution failures
Configuring the Separator
Configure the project_and_branch_separator character with the following configuration block in the SWARM_ROOT/data/config.php file:
'test_definitions' => array(
'project_and_branch_separator' => ':',
),
The default value for the project_and_branch_separator configurable is a colon :.
The project_and_branch_separator setting only affects tests created through the Tests menu, not legacy or manually entered test configurations.
Reloading Configuration After Changes
P4 Code Review does not automatically apply configuration changes.
After editing any test‑definition–related settings, the configuration cache must be reloaded.
To reload the cache:
-
Open the User ID menu.
-
Select System Information.
-
Open the Cache Info tab.
-
Click Reload Configuration.
You must be an admin or super user to perform this action