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

Đang mở
#762 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
58/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
swift
Lĩnh vực
build-system, testing

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Swift
Star
3.3k
Fork
115
Merge trung bình
1 ngày 15 giờ
Pull request đã merge (30 ngày)
5

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của skiptools/skip

Tất cả issue của skiptools/skip

Issue tương tự

Thêm issue về Swift

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.