This plugin allows TeamCity builds to trigger and parse Runscope tests.
Download the plugin from the Mangopay Github release page.
Install the plugin as usual.
The plugin comes with a runner. To use that runner, add a new build step in your build configuration.
You can provide a set of initial variables that will be passed on Runscope along with each test. To do so, you have two choices :
- Fully specify the variable :
variablename=value
. - Specify only the variable name :
variablename
.
Each variable without value specified will take its value from runscope.vars.{variablename}
build parameter.
That can be usefull if you want to be able to run custom build or pass Runscope variable from one build step to another (see below)
While running, each variable that is successfully defined by Runscope (variable.result == pass
) will be added as a TeamCity build parameter available to the currently running build.
Those variables are prefixed with runscope.vars.
.
When defining build configuration, you can pass Runscope variable from one build step to another :
- During a build step, Runscope successfully defines
userId
variable to451
. - Runscope runner adds a build parameter
runscope.vars.userId
equals to451
. - On a second Runscope runner step, you set
Initial variables
parameter touserId
. - All tests triggered from that build step will include a Runscope initial variable
userId
having the value451
.
The plugin allows you to run tests in parallel. Doing so, the build log tree will be all messed-up due a knwown TeamCity bug. Only the build log is messed up, not tests reports. If you do not care about the build log, you should definitly enable parallel tests running to reduce your build time.
- Runscope does not provide an API endpoint to cancel a running test. Thus if your TeamCity build is interrupted (shutdown, cancel, etc), your tests are still running on Runscope side !
- At this time, the plugin is not capable of handling mutliple location. Please enable only one Location at a time.
To build the plugin :
- Install the java SDK. Version 8u77 was used to develop this plugin.
- Install Maven.
- Set
JAVA_HOME
andM2_HOME
variables. - Add
bin
folder of each installation to yourPATH
. - Go to the plugin root directory and run
mvn package
.
The plugin will be packaged to the target
folder.
- Enable debugging :
JAVA_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8007"
- Manually start the agent on which you will attach your debugger :
agent start
- Attach your debugger. For IDEs, you generally needs to configure a remote configuration with the following command line arguments :
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8007
Start runscope-runner-debugq
using TeamcitySimulation
as the main class. This will badly mimic Teamcity context to enable quick debbuging. The arguments are :
- runscope token : mandatory
- runscope bucket id : mandatory
- runscope tests id : optional. Execute only the specified tests from the bucket
- runscope environment id : optional.
- runscope excluded tests id : optional. Do not run specified tests
Tests ids are comma or space separated.
To made debugging easier, it is strongly recommended to use a proxy : -Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=8888
.
Runscope forces the use of HTTPS. To enable HTTPS content decryption :
- export your proxy SSL certificate
- create a new keystore with it :
<jdk_home>/bin/keytool -import -file <path/to/cert> -keystore <keystore name> -alias <alias>
- overwrite JVM default keystore : ``-Djavax.net.ssl.trustStore=<path/to/keystore> -Djavax.net.ssl.trustStorePassword=```