Continuous Integration

XStudio client comes with a tool called XContinuousIntegration.
  • On Windows platforms, you can find it in the bin folder. The executable is named xcontinuousintegration.exe
  • On MacOSX and linux platforms, the executable script is named xcontinuousintegration.sh

Goal

XContinuousIntegration is aimed at being called by automatic build machines. Once a build has been run successfully, the build server can automatically trigger the creation and the start of a campaign session in XStudio. This way, after your overnight build has completed you can automatically run your automated test suites without having to attend.

This is even more convenient when we speak about continuous integration. In this case, each time a commit will occur on the versioning system, a build will be generated and the tests executed.


xcontinuousintegration integration

Usage

To Trigger the creation and the execution of a campaign session, the build server will just have to call the XContinuousIntegration with the appropriate arguments which are...

Usage: xcontinuousintegration.exe --campaignId <campaignId>
                                  --agents <agentId>:<nbInstances>:<sync>,...
                                  --sutId <sutId>
                                  --configurations <categoryId>:<configId>,...
								  
Options:
	--sessionName               <sessionName>
	--operatorId                <userId>
	--agentsPick                <agentsPick>
	--ccEmailUserIds            <userId>,...
	--monitoringAgentId         <agentId>
	--monitoringConfId          <monitoringConfId>
	--ifParentFailed            <action>
	--ifParentUnknown           <action>
	--synchronous       
	--synchronousTimeout        <timeout>    (only with '--synchronous')         
	--generateReport                         (only with '--synchronous')              
	--reportTransform           <xsltName>   (only with '--synchronous' and '--generateReport')         
	--reportStyle               <styleName>  (only with '--synchronous' and '--generateReport')         
	--reportOutputPath          <path>       (only with '--synchronous' and '--generateReport')     
	--reportName                <reportName> (only with '--synchronous' and '--generateReport') 
	--reportIncludesAttachments    

Where:
	<sync> can take the following values: 0=None,
                                              1=Synchronization on tests,
                                              2=Synchronization on test cases,
                                              3=In a row
												
	<agentsPick> can take the following values: 0=Any agent in the pool,
                                                    1=All agents in the pool (default value),
                                                    2=first available agent in the pool
												
	<action> can take the following values: 'EXECUTE', 
                                                'SET_AS_FAILED'
                                                'DO_NOT_EXECUTE'
																								
	<timeout> is a timeout given in seconds (if the session is not executed after this delay, 
	                XContinuousIntegration exits and no report is generated)
	<path> is a local path to an existing folder (i.e. 'C:/Users/eric')		
				

Where do I find all those Ids

As you see, this command line needs many ids. Hopefully you can get them pretty easily:


IdWhere to find it
Mandatory
campaignId From the campaign tree, select the campaign and check the header on the right panel
agentId From the agent tree, select the agent and check the header on the right panel
sutId From the SUT tree, select the sut and check the header on the right panel
categoryId From the test tree, select the category and check the header on the right panel
configurationId From the campaign tree, select a session that has already been executed using this configuration, select the Configuration tab and check for each category the id of the configuration
Optional
operatorId From the user tree, select the user and check the header on the right panel
userId From the user tree, select the user and check the header on the right panel
monitoringConfIdFrom the campaign tree, select a session that has already been executed using this monitoring configuration, select the Monitoring / Monitored features tab and check the id of the configuration


IMPORTANT: all the ids must be provided WITHOUT their prefix!
For instance, if you have a campaign with the id C_1234, you just need to provide to XContinuousIntegration the value 1234.


Example

xcontinuousintegration.exe --campaignId 1090 --agents 16:1:0;17:2:2 --sutId 89 --configurations 80:42;81:13 --synchronous --synchronousTimeout 14400 --generateReport --reportTransform HTML_Complete_with_stats --reportStyle XQual --reportOutputPath E:/tmp --reportName my_last_report

This command will run XContinuousIntegration in synchronous mode (it returns only when the session completed). The program will returns if the session is not completed after 4 hours (14400 seconds). When the session is completed, an HTML report named my_last_report.html is generated locally in E:/tmp based on the XSLT reportHTML_Complete_with_stats.xslt (presented in XStudio as (HTML) Complete_with_stats in the drop-down menu). A my_last_report.zip file is also created that contains all the resources (including attachments etc.) to have a fully indexed/emailable/attachable report.

The linux version is also provided and use the same syntax except that the binary is a shell script.

Integration with third-party systems

XStudio can be integrated in ANY continuous integration environment as it just consists in executing a simple command after a build is completed.
However, the continuous integration system may even better integrate with XStudio if it can retrieve the results.





Bamboo (and others) can parse any test output that conforms to the standard JUnit XML format. You have just to specify the option --reportTransform XML_JUnit in the command line and a JUnit XML report will be additionally generated so that Bamboo can parse it and retrieve the results.

You can refer to Atlassion's tutorial on how to configure an external command in Bamboo.

Atlassian also have a page describing the JUnit XML format if you're interested.




Jenkins can also parse any test output that conforms to the standard JUnit XML format so you can use --reportTransform XML_JUnit as well with Jenkins.

Please refer to Jenkins documentation on how to include the XContinuousIntegration command line in the process.




Hudson can also parse any test output that conforms to the standard JUnit XML format so you can use --reportTransform XML_JUnit as well with Hudson.

Please refer to Hudson documentation on how to include the XContinuousIntegration command line in the process.




TeamCity can also parse any test output that conforms to the standard JUnit XML format so you can use --reportTransform XML_JUnit as well with TeamCity.

Please refer to TeamCity documentation on how to include the XContinuousIntegration command line in the process.