Find Out How

Print Friendly Version

How do I incorporate SOASTA CloudTest into an automated build?

Introduction

SOASTA test compositions and playlists can be incorporated into an automated build process using either Apache Ant (for Java-based builds) or the SCommand utility (for other builds).

Section 1: Apache Ant

The SOASTA CloudTest Ant tasks are bundled in the SCommand utility. Click here for installation instructions.

The task class name is:
com.soasta.tools.scommand.anttasks.PlayTask

 
Attribute Description Required
type The type of test object (either "composition" or "playlist") Yes
name The test object name
url The SOASTA CloudTest URL
username The SOASTA CloudTest user name
password The SOASTA CloudTest password
waitforcompletion Set to "true" to block the build until the composition (or playlist) completes No, defaults to "false"
haltonfailure Set to "true" to stop the build process if the composition (or playlist) fails
failureproperty The name of a property to set if the composition (or playlist) fails No
 

Here is a complete example.

Section 2: Other automated build tools

Any build tool that can run a program and check the exit code can be used to incorporate SOASTA CloudTest.

Here is an example using make:


SCOMMAND_HOME=/Downloads/scommand
SCOMMAND_BIN=$(SCOMMAND_HOME)/bin
CLOUDTEST_URL=https://cloudtest.soasta.com/concerto
CLOUDTEST_USERNAME=exampleuser
CLOUDTEST_PASSWORD=***

all: cloudtests

cloudtests:
$(SCOMMAND_BIN)/scommand cmd=play type=composition name="/My tests/Composition 1"
url=$(CLOUDTEST_URL) username=$(CLOUDTEST_USERNAME) password=$(CLOUDTEST_PASSWORD) wait

Using the play command with the wait parameter causes SCommand to wait until the composition (or playlist) finishes, and then exit with code 0 if the test passes, or code 1 if it fails.