Allow `XCSkipTests` to run Gradle without `--rerun-tasks`

Open
#762 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
58/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
swift

Research direction

Start by reading XCGradleHarness and compare its Gradle invocation with gradleExec, which already sets rerunTasks: false; also check how the harness selects test tasks. Determine whether incremental compilation handles changes in symlinked peer modules, while ensuring tests still run when Gradle would mark them UP-TO-DATE. Done when an opt-in setting controls task reruns and the tests execute without forcing library recompilation.

Written by the indexing model from the issue text.

Description

XCGradleHarness always passes --rerun-tasks to Gradle. So every swift test compiles SkipLib, SkipFoundation, SkipModel and SkipUI again from scratch, even when I only changed one file in my app.

In my app (about 320 tests, Skip 1.9.20, Gradle 9.8):

Run Time
XCSkipTests 125 s
Same gradle testDebug command without --rerun-tasks, after a one-file change 32 s

About 30 s of each run is the tests themselves. The rest is compiling the Skip libraries again.

gradleExec already uses rerunTasks: false, so the switch exists. The test harness just doesn't use it.

Two questions:

  1. Is there a reason the tests need --rerun-tasks? Maybe Gradle misses changes in the symlinked peer modules?
  2. How about an opt-in env var, like SKIP_GRADLE_RERUN_TASKS=NO, next to SKIP_GRADLE_VERBOSE? Happy to send a PR.

One catch: with no changes, Gradle marks the test task UP-TO-DATE and doesn't run it. So the harness would still need to force the tests themselves, for example with :Module:testDebugUnitTest --rerun, and keep the compiling incremental.

Dominant language
Swift
Stars
3.3k
Forks
115
Avg merge
1d 15h
Merged PRs (30d)
5

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from skiptools/skip

All issues in skiptools/skip

Similar issues

More Swift issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.