Running Tests

Jody Winter Ralf D. Müller

2 minutes to read

Before You Begin

  • Git and Graphviz must both be installed.

  • Your Gradle setup must be able to work with proxies.

  • You must be using Java 8.

Prepare the Project

git clone git@github.com:docToolchain/docToolchain.git
cd docToolchain/
git checkout V1.0.0         # (1)
git submodule update -i

(1) The version to test. Not required if you work on the HEAD revision on Master.

Execute Tests

rm -r build && ./gradlew test --info

The rm command ensures that you have a clean test running. This is vital because if artifacts of an older test run still exist, Gradle will skip steps (‘Up-to-date’) and you might get false positives.

Workaround to Ensure Correct Proxy Settings for Tests

The docToolchain setup is based on the Gradle-Test-Kit and makes use of the Spock test execution framework.

The Gradle test runner is started in its own test environment and its own JVM instance. As a result, the global proxy settings are ignored. To execute the test with the correct proxy settings, you must use a workaround. Copy the proxy settings from the gradle.properties file located in the user directory to the gradle.properties file located in the docToolchain folder itself.

Note: The files downloaded by the Gradle test runner are placed in a different folder than the default Gradle cache. You will find them in the Tmp folder C:\Users\YOUR_USER_NAME\AppData\Local\Temp\.gradle-test-kit-YOUR_USER_NAME\caches.