exercism / exercism/kotlin-test-runner

Speedup test runner

Open
#30 10 comments 0 reactions 0 assignees View on GitHub
x:action/improve x:knowledge/elementary x:module/test-runner x:size/large x:type/coding
Dominant language
Kotlin
Stars
4
Forks
12
PR merge metrics
No merged PRs in 30d

Description

The current test runner is _very_ slow when running via the Docker container: 20s for a simple hello-world exercise, whereas running it locally without Docker has this happen in 2/3s. With some digging, I found that the likely culprit is the Gradle daemon. If I disable the Gradle daemon on my local system and removing any previous build artifacts, running the tests becomes a lot slower: 8/9s.

I thus set out to try to enable the Gradle daemon in the Docker build by adding the following line in the Dockerfile:

```
RUN gradle
```

This starts the Gradle daemon, but unfortunately, somehow this daemon is then stopped before it can be used by the test runner's `bin/run.sh` script. This can be verified by running `gradle --status` in `bin/run.sh`:

```
cd $2 # Solution directory
gradle --status
```

which outputs:

```
No Gradle daemons are running.
PID STATUS INFO
43 STOPPED (by user or operating system)

Only Daemons for the current Gradle version are displayed. See https://docs.gradle.org/6.8.3/userguide/gradle_daemon.html#sec:status
```

It would be great if someone could figure out how to re-use the Gradle daemon.

There might also be other issues slowing compilation down. If you know any, feel free to test them out.

I've experimented a bit with all this in [this branch](https://github.com/exercism/kotlin-test-runner/tree/gradle-daemon).

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.