# Platform inconsistency when running tests with TestNG

**URL:** https://discuss.gradle.org/t/platform-inconsistency-when-running-tests-with-testng/34556
**Category:** Help/Discuss
**Created:** [January 16, 2020, 10:45am UTC](https://discuss.gradle.org/t/platform-inconsistency-when-running-tests-with-testng/34556 "2020-01-16T10:45:45Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![beverlyRoadGoose](https://avatars.discourse-cdn.com/v4/letter/b/7bcc69/32.png) [@beverlyRoadGoose](https://discuss.gradle.org/u/beverlyRoadGoose)
#### Post date: [January 16, 2020, 10:45am UTC](https://discuss.gradle.org/t/platform-inconsistency-when-running-tests-with-testng/34556/1 "2020-01-16T10:45:45Z")

</div>

Hello.

I’m working on a project with Gradle and tests in this project are managed with TestNG and I’ve run into a strange scenario.

My goal is to be able to execute specific tests by filtering them with test groups. I have my test task configured this way:

```gradle
  withType<Test>{
    useTestNG() {
      System.getProperty("testGroups")?.let {
        includeGroups(it)
      }
    }
  }

```

and I trigger the tests running: `./gradlew clean test -DtestGroups=unitTests`

This works as expected when I try to run the tests on my local machine - a mac, but when I try to run the tests on a CI server, Jenkins in this case, it appears that the testGroup specification is ignored and all the tests are executed.

I’ve spent quite some time trying to figure out what could be causing this, thanks in advance for your help!
