Code Tester integrates with the Jenkins CI system to enable the automatic running of Code Tester tests as part of a build. You can run one or more individual unit tests, test definitions, or test suites from the CI build. There are two ways you can configure the integration:
1. Using the QctoCmd.exe command line
2. Using the Code Tester PL/SQL API
Note: This documentation assumes that you know how to configure and use the Jenkins software. For information about any Jenkins options mentioned in this documentation, see the Jenkins online help.
Configure CI integration from the QctoCmd command line
The QctoCmd.exe command line interface of Code Tester is a Windows Console application. For more information about this interface, see Overview of Command Line Execution of Code Tester Executable in the Help Documentation
To configure CI integration
Install Code Tester and the Code Tester repository on the Oracle database server.
Create your test definitions and test suites in Code Tester.
- In Jenkins, select New Item to create a new Jenkins project for your Code Tester test (or tests). Note: You can run one or many Code Tester test definitions or suites from one Jenkins project.
- Assign the project a name, then select the default Freestyle project.
- Under Build, enter one of the following Code Tester commands. Use the /S option to run a test suite or use the /T option to run a test definition. The arguments are case-sensitive.
path_to_Code_Tester_Install_Folder\dctocmd.exe /u=Oracle_user_name /p=user_password /d=Oracle_TNS_alias /S=test_suite /r
path_to_Code_Tester_Install_Folder\dctocmd.exe /u=Oracle_user_name /p=user_password /d=Oracle_TNS_alias /T=test_definition /r
Example: "C:\Program Files\Quest Software\CodeTester for Oracle\dctocmd.exe" /u=cto /p=cto /d=MyOraDB /S=MyTestSuite /r
Notes:
- Enclose path names in quotes if there are spaces in them, as shown in the example.
- Do not name your test suites or definitions with spaces. If a name contains spaces, use the /s or /t option to run with the GUID instead of the name. You can run more than one Code Tester test or suite by using the Add Build Step selection under Build.
- For more information about these command options and other available options, see Parameters for Command Line Execution in the Help Documentation
- For possible exit codes, see Exit Codes for Command Line Execution in the Help Documentation.
- All test definitions in a given test suite and all test cases in a given test definition are executed.
4. Select other Jenkins project configuration options as needed.
5. Click Save.