From f1a171b9b1d15a7a859446e5e9378c21a9b5f69a Mon Sep 17 00:00:00 2001 From: Eliah Kagan Date: Thu, 14 Nov 2024 02:01:09 -0500 Subject: [PATCH 1/2] Update a journey test `tree` use delcaration to `find` This also stops installing `tree` on CI. The `tree` package provides the `tree` command, which is useful but does not currently appear to be used anywhere. At one time, various journey tests had used it to generate output for comparison, and this usage/dependency was declared with `with_program` in 688280b, which was also when the first command to install it was added to CI. Later, `tree` was found to be unportable or otherwise unsuitable in the counts it output, and all uses of it were replaced with `find` in 3c1bfd5 (#861). At that point, most `with_program` declarations for it were changed to `find`, but one of them in the `ein` journey tests was not replaced at that time. That test does use `find` (and not `tree`), and should declare its use of `find` rather than `tree`. This commit makes that change. One benefit of doing so is that it is possible to run the tests on a CI (or other) system without `tree` without skipping any tests, so this also removes it from the lists of packages to install with `apt-get` and `brew` in CI jobs. --- .github/workflows/ci.yml | 6 +++--- tests/journey/ein.sh | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 73ca728ccdc..e7efbdef8c1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -65,7 +65,7 @@ jobs: - uses: dtolnay/rust-toolchain@stable - uses: Swatinem/rust-cache@v2 - name: Setup dependencies - run: sudo apt-get install -y --no-install-recommends liblzma-dev tree + run: sudo apt-get install -y --no-install-recommends liblzma-dev - uses: extractions/setup-just@v2 - uses: taiki-e/install-action@v2 with: @@ -91,8 +91,8 @@ jobs: - uses: Swatinem/rust-cache@v2 - name: Setup dependencies (macos) if: startsWith(matrix.os, 'macos') - run: brew install tree openssl gnu-sed - - name: "cargo check default features" + run: brew install openssl gnu-sed + - name: cargo check default features if: startsWith(matrix.os, 'windows') run: cargo check --workspace --bins --examples - uses: taiki-e/install-action@v2 diff --git a/tests/journey/ein.sh b/tests/journey/ein.sh index 1546209c2e6..408256e5178 100644 --- a/tests/journey/ein.sh +++ b/tests/journey/ein.sh @@ -28,7 +28,7 @@ title "Porcelain ${kind}" ) ) snapshot="$snapshot/porcelain" - (with_program tree + (with_program find (when "using the 'tool' subcommand" title "ein tool" (with "a repo with a tiny commit history" From 711c2f593a4c2769e8705d00552ae88f35341372 Mon Sep 17 00:00:00 2001 From: Eliah Kagan Date: Thu, 14 Nov 2024 02:19:47 -0500 Subject: [PATCH 2/2] Split journey tests out into their own CI job In the `justfile`, this renames the old `ci-test` recipe to `ci-test-full`, and has `ci-test` no longer clean the target directory nor run journey tests. The CI `test` job thus remains the same, but it does moderately less work. A new CI job, `test-journey`, is introduced to run the journey tests (still via `ci-test-journey` recipe). This change is intended to allow greater parallelism, and possibly make caches work better. The CI `test` job has sometimes been a few minutes slower than before, ever since 5173e9a (#1668). See comments in #1668 for some discussion on this change. --- .github/workflows/ci.yml | 12 ++++++++++++ justfile | 11 ++++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e7efbdef8c1..99961881e49 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -75,6 +75,17 @@ jobs: GIX_TEST_IGNORE_ARCHIVES: '1' run: just ci-test + test-journey: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - uses: Swatinem/rust-cache@v2 + - uses: extractions/setup-just@v2 + - name: Run journey tests + run: just ci-journey-tests + test-fast: strategy: matrix: @@ -342,6 +353,7 @@ jobs: needs: - pure-rust-build - test + - test-journey - test-fast - test-32bit - lint diff --git a/justfile b/justfile index ffd3ab7deab..3b3fa6db97f 100755 --- a/justfile +++ b/justfile @@ -12,10 +12,15 @@ alias nt := nextest # run all tests, clippy, including journey tests, try building docs test: clippy check doc unit-tests journey-tests-pure journey-tests-small journey-tests-async journey-tests -# run all tests, without clippy, including journey tests, try building docs (and clear target on CI) -ci-test: check doc unit-tests clear-target ci-journey-tests +# run all tests, without clippy, including journey tests, try building docs (and clear target) +ci-test-full: check doc unit-tests clear-target ci-journey-tests -# run all journey tests, but assure these are running after `cargo clean` (and workaround a just-issue of deduplicating targets) +# run all tests, without clippy, and try building docs (without clearing the target) +ci-test: check doc unit-tests + +# run all journey tests +# these should be run in a fresh clone or after `cargo clean` +# (and workaround a just-issue of deduplicating targets) ci-journey-tests: journey-tests-pure journey-tests-small journey-tests-async journey-tests clear-target: