Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

...

...

...

Table of Contents

Scanning a build

In order to collect coverage information SeaLights agents need to first scan the binary files for the build information: it can be the *.class, *.jar or even the *.war files.

...

Code Block
languagexml
<junit fork="yes">
  <jvmarg value="-javaagent:${sealights.dir}/sl-test-listener.jar"/>
  <jvmarg value="-Dsl.tokenFile=/path/to/sltoken.txt"/>
  <jvmarg value="-Dsl.buildSessionIdFile=buildSessionId.txt"/>
  <jvmarg value='-Dsl.testStage="Unit Tests"'/>
</junit>
Info

See 'Java Command Reference - Installing test listener as Java Agent' for full parameter details

Sample integration into an existing ANT project

In order to keep backward compatibility, you can use the ant:if condition to execute Sealights commands according to a boolean.
In the sample below, you’ll be required to add -Dsealights=true to your ANT command in order to enable the agents.

Code Block
languagexml
<project name="sl-ant-sample" xmlns:if="ant:if">

    <target name="compile">
		<echo>Compiling the JAR</echo>
		<antcall if:true="${sealights}" target="sealights_scan" />
    </target>

	<target name="sealights_config">
		<echo>Sealights -- Create BSID</echo>
	</target>

	<target name="sealights_scan" depends="sealights_config">
		<echo>Sealights -- Scan artefacts</echo>
	</target>

	<target name="junit">
		<echo if:true="${sealights}">Sealights</echo>
		<echo>Regular</echo>
  	</target>

</project>

Here is a comparison of executions with and without the sealigths parameter set.

...