Kernel::System::UnitTest - functions to run all or some OTRS unit tests
create unit test object. Do not use it directly, instead use:
my $UnitTestObject = $Kernel::OM->Get('Kernel::System::UnitTest');
run all or some tests located in scripts/test/**/*.t
and print the result.
$UnitTestObject->Run( Name => ['JSON', 'User'], # optional, execute certain test files only Directory => 'Selenium', # optional, execute tests in subdirectory Verbose => 1, # optional (default 0), only show result details for all tests, not just failing SubmitURL => $URL, # optional, send results to unit test result server SubmitAuth => '0abc86125f0fd37baae' # optional authentication string for unit test result server SubmitResultAsExitCode => 1, # optional, specify if exit code should not indicate if tests were ok/not ok, but if submission was successful instead JobID => 12, # optional job ID for unit test submission to server Scenario => 'OTRS 6 git', # optional scenario identifier for unit test submission to server PostTestScripts => ['...'], # Script(s) to execute after a test has been run. # You can specify %File%, %TestOk% and %TestNotOk% as dynamic arguments. PreSubmitScripts => ['...'], # Script(s) to execute after all tests have been executed # and the results are about to be sent to the server. NumberOfTestRuns => 10, # optional (default 1), number of successive runs for every single unit test );
Please note that the individual test files are not executed in the main process, but instead in separate forked child processes which are controlled by Kernel::System::UnitTest::Driver. Their results will be transmitted to the main process via a local file.
This software is part of the OTRS project (https://otrs.org/).
This software comes with ABSOLUTELY NO WARRANTY. For details, see the enclosed file COPYING for license information (GPL). If you did not receive this file, see https://www.gnu.org/licenses/gpl-3.0.txt.