Versions Compared

Key

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

Running Unit Tests

Developers typically run Unit Tests through IDEs, not through the classic JUnit test runners.  Unit tests can also be run through Maven - indeed, if you're not careful, Maven will run unit tests even when you don't want it.  When tests are run through Maven, the Surefire plugin can produce various reports on the health of the unit test suite.  In KFS 6, running the unit test suite must be done against a database populated with demo data - ie, to run locally, you should run against a local satellite database.

With KFS 6's move to Maven, the optional KFS modules have been moved into separate KFS modules, and the core modules are together in one Maven module.  To run tests for a single module, simply run the "mvn test" maven lifecycle command in the module where you'd like to run the tests (e.g., kfs/kfs-ar); or, alternatively, run any mvn lifecycle command (package, install) which depends on the test step without applying the -DskipTests command line option in that directory.

...

Of course, you can run single unit tests through Maven as well:

mvn test -e -Dtest=PreCommitSuite

Unit Testing Before Submitting a Pull Request

...