Generating Jenkins project configuration for running tests and suites

You can generate Jenkins project configuration for running tests and suites by using the HCL OneTest API Test Execution plug-in.

Procedure

  1. Select Generate External Tool Configuration from the Tools menu.

    The Generate External Tool Configuration wizard is displayed.

  2. On the Configuration type and environment page, select Jenkins project configuration for executing tests or suites using the HCL OneTest API Test Execution plug-in from the Tools menu. Select the existing HCL OneTest™ API environment in which the selected resources are to be run. Click Next.

    The Select resources page is displayed with the project resource tree.

  3. Select the tests, or suites that are to be included in the project configuration (use Ctrl or Shift to select multiple items). You can select the resources by name or by ID. The advantage of using names is that they are more easily recognizable. If you delete the resource from the project and create another one with the same name, the script will still work. If you choose to use IDs, you can rename or move the resource within the project and the script will still work.

    If one or more resources were selected in the Test Factory perspective, those resources are automatically selected. Click Next.

    The Jenkins project configuration options page is displayed.

  4. Select the location to which the Jenkins project configuration should refer. You can either choose the current installation directory of HCL OneTest API or use the environment variables that can be queried at runtime. Click Next.

    The Summary page is displayed with the contents of the Jenkins project configuration.

  5. Click Browse to select a location. Enter config.xml for the filename and save it.
  6. Create a directory (preferably with the name of the job you want to create) under Jenkins_installation_directory/jobs.
  7. Copy the config.xml file into the new directory.
  8. Restart Jenkins. Or, in the Jenkins admin panel, click Manage Jenkins > Reload Configuration from Disk, and then click OK.
    Following is an example Jenkins project configuration generated by HCL OneTest API:
    <?xml version='1.0' encoding='UTF-8'?>
    <project>
      <actions/>
      <description></description>
      <keepDependencies>false</keepDependencies>
      <properties/>
      <scm class="hudson.scm.NullSCM"/>
      <canRoam>true</canRoam>
      <disabled>false</disabled>
      <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
      <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
      <triggers/>
      <concurrentBuild>false</concurrentBuild>
      <builders>
        <com.hcl.products.test.it.jenkins.RunTests plugin="jenkins-it-runtests@1.920.0">
          <additionalArgs></additionalArgs>
          <baseTempDirectory></baseTempDirectory>
          <environment>RedHatTest</environment>
          <environmentTags></environmentTags>
          <input></input>
          <installationDirectory>C:\Program Files\HCL\HCLProducts\API</installationDirectory>
          <junitDir></junitDir>
          <loginAsAdmin>false</loginAsAdmin>
          <noDB>false</noDB>
          <noHTTP>false</noHTTP>
          <noResultsPublishers>false</noResultsPublishers>
          <output></output>
          <overrideSlowFail></overrideSlowFail>
          <project>D:\Shivi\Projects\RIT\92\Testfor66501\911RITTest\911RITTest.ghp</project>
          <projectPassword></projectPassword>
          <projectUser></projectUser>
          <resultsServerLogging></resultsServerLogging>
          <securityToken></securityToken>
          <startupTimeout></startupTimeout>
          <tests>addNumbers/addition/additionTest</tests>
          <useResultsPublishers></useResultsPublishers>
          <vmArgs></vmArgs>
        </com.hcl.products.test.it.jenkins.RunTests>
      </builders>
      <publishers/>
      <buildWrappers/>
    </project>
  9. Click Finish.

Results

Jenkins lists the new job after it restarts or reloads the configuration from the disk. Configure the job as appropriate to run the tests or suites.
Feedback