1

In order to execute the whole test suite you only have to press enter key in dev mode.

But how to execute one only test or a subset of the whole test suite?

Charles
  • 4,372
  • 9
  • 41
  • 80
Paco Abato
  • 3,920
  • 4
  • 31
  • 54
  • You can file an issue at https://github.com/OpenLiberty/ci.maven/issues to suggest this as an enhancement. – ykchang Jan 24 '20 at 14:41

1 Answers1

1

Since dev mode dynamically loads pom.xml changes, one approach would be to dynamically edit the pom.xml configuration and then hit <Enter> e.g.:

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-failsafe-plugin</artifactId>

            <configuration>
                <test>BonusPayoutIT#testForceFailure</test>
            </configuration>

        </plugin>
Scott Kurz
  • 4,985
  • 1
  • 18
  • 40
  • This way runs all the tests as unit tests and then re-runs the tests configured in pom.xml as integration tests. – Paco Abato Jan 27 '20 at 06:47
  • I'd think you could extend this idea to excluding unit tests via `maven-surefire-plugin` config. – Scott Kurz Jan 27 '20 at 11:28
  • I tried and it doesn't seem to be working. – Paco Abato Jan 27 '20 at 13:29
  • Are you expecting to use the 'failsafe' plugin to configure unit tests? You probably need to use the 'surefire' plugin for UTs and 'failsafe' for ITs. Maybe you could show your pom or a snippet? – Scott Kurz Jan 27 '20 at 16:34
  • I got it, knowing the differences within surefire and failsafe and using inside works great. Thanks. – Paco Abato Jan 28 '20 at 07:14