Skip to content

Commit 0351fd2

Browse files
committed
Correct coverage cache comment and shard docs
Review follow-ups: rust-cache stores dependencies only, so shard 1's save does not depend on which targets it built; the shard script's extra arguments now reach `cargo llvm-cov` too; the coverage-mode test no longer reads CI_TEST_TIMINGS from the caller's environment. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0174QivDXDqjSDhKth66oLF4
1 parent 4e34fb3 commit 0351fd2

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -626,8 +626,8 @@ jobs:
626626
- name: Cache cargo
627627
# Swatinem/rust-cache, main-only saves: see the first `Cache cargo`
628628
# step in this file.
629-
# The shards share one cache key; shard 1 alone writes it, from the
630-
# warm step that builds every target.
629+
# The shards share one cache key and shard 1 alone writes it.
630+
# rust-cache keeps only dependencies, which every shard builds.
631631
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
632632
with:
633633
save-if: ${{ github.ref == 'refs/heads/main' && matrix.shard == 1 }}

‎scripts/ci-test-shard.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
no doctests, which cargo-llvm-cov leaves out without `--doctests`. A later
2020
`cargo llvm-cov report` exports the shard's profiles.
2121
22-
Extra arguments after `SHARD COUNT` go to every `cargo test` invocation.
22+
Extra arguments after `SHARD COUNT` go to every `cargo` invocation.
2323
Each invocation runs with `--no-fail-fast`; the exit status is non-zero if
2424
any of them failed.
2525

‎scripts/tests/test_ci_test_shard.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ def test_coverage_shards_run_llvm_cov_without_doctests(self):
8686
def test_coverage_mode_comes_from_the_environment(self):
8787
metadata = {"workspace_members": ["a"], "packages": [
8888
{"id": "a", "targets": [{"name": "integration", "kind": ["test"]}]}]}
89-
with patch.dict(shard.os.environ, {"CI_TEST_COVERAGE": "1"}), \
89+
env = {k: v for k, v in shard.os.environ.items() if k != "CI_TEST_TIMINGS"}
90+
with patch.dict(shard.os.environ, {**env, "CI_TEST_COVERAGE": "1"}, clear=True), \
9091
patch.object(shard.subprocess, "run", side_effect=[
9192
subprocess.CompletedProcess([], 0, stdout=json.dumps(metadata)),
9293
subprocess.CompletedProcess([], 0),

0 commit comments

Comments
 (0)