Running Tests

Ralf D. Müller Jody Winter

2 minutes to read

docToolchain uses Spock as Test-Framework. See http://spockframework.org/ for details.

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.

Execute a specific test

rm -r build && ./gradlew test --info --tests=ExportStructurizrSpec

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.