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

Aperta
#762 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
58/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
swift

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Swift
Stelle
3.3k
Fork
115
Merge medio
1g 15h
PR unite (30g)
5

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di skiptools/skip

Tutte le issue di skiptools/skip

Issue simili

Altre issue su Swift

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.