Running integration tests against several test servers

we’re thinking about switching from Maven to Gradle for our project:

we have a set of integration tests, which are executed against a running Redmine server. we would like to run the same set of tests against several servers in parallel (Redmine 2.0, 2.1, 2.2, 2.3, etc). is there any standard/blessed way to do this with Gradle? maybe test profiles or something? we could try parameterized JUnit tests, but I thought maybe there was something in Gradle to help with that…

Hi Alex,

You have two options here:

  1. Parameterise within the test framework 2. Use multiple test tasks

#1 can be more convenient to work with in the IDE than #2 because then you aren’t relying on config from the build for execution. However, depending on how you parameterise it’s not always convenient to run a specific case in a specific context anyway (i.e. the IDE always wants to run all).

#2 involves creating a new test task for each context and parameterising via JVM system properties. This is the only communication channel between the build config and the test framework available. This is usually pretty easy to set up (e.g. you can loop over a data table in your build.gradle creating test tasks dynamically).

thank you! we’ll try both.