From ab16bf0a8c2362a698037d41c510d9deadbbf43e Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Sun, 20 Oct 2024 13:37:41 -0500 Subject: [PATCH] Set `UV_LINK_MODE=copy` for Windows test runs (#8350) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cherry-picked from #8347 Might fix https://github.com/astral-sh/uv/issues/6940 — I'm not seeing a failure over there after this change. I think there may be some problem with concurrent reads of junctioned files on the DevDrive? It's really hard to say. We might lose some important test coverage with this change. I'm not sure what to do about that either. --- .github/workflows/ci.yml | 4 ++++ crates/uv/tests/it/common/mod.rs | 6 ++++++ crates/uv/tests/it/edit.rs | 6 +++--- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 034688e43..8313c1b59 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -298,6 +298,10 @@ jobs: - name: "Cargo test" working-directory: ${{ env.UV_WORKSPACE }} + env: + # Avoid permission errors during concurrent tests + # See https://github.com/astral-sh/uv/issues/6940 + UV_LINK_MODE: copy run: | cargo nextest run --no-default-features --features python,pypi --workspace --status-level skip --failure-output immediate-final --no-fail-fast -j 20 --final-status-level slow diff --git a/crates/uv/tests/it/common/mod.rs b/crates/uv/tests/it/common/mod.rs index 229a1e71a..b744c1a15 100644 --- a/crates/uv/tests/it/common/mod.rs +++ b/crates/uv/tests/it/common/mod.rs @@ -299,6 +299,12 @@ impl TestContext { let mut filters = Vec::new(); + // Exclude `link-mode` on Windows since we set it in the remote test suite + if cfg!(windows) { + filters.push(("--link-mode ".to_string(), String::new())); + filters.push(((r#"link-mode = "copy"\n"#).to_string(), String::new())); + } + filters.extend( Self::path_patterns(&cache_dir) .into_iter() diff --git a/crates/uv/tests/it/edit.rs b/crates/uv/tests/it/edit.rs index 94607c904..0100cdd06 100644 --- a/crates/uv/tests/it/edit.rs +++ b/crates/uv/tests/it/edit.rs @@ -3383,7 +3383,7 @@ fn add_reject_multiple_git_ref_flags() { let context = TestContext::new("3.12"); // --tag and --branch - uv_snapshot!(context + uv_snapshot!(context.filters(), context .add() .arg("foo") .arg("--tag") @@ -3404,7 +3404,7 @@ fn add_reject_multiple_git_ref_flags() { ); // --tag and --rev - uv_snapshot!(context + uv_snapshot!(context.filters(), context .add() .arg("foo") .arg("--tag") @@ -3425,7 +3425,7 @@ fn add_reject_multiple_git_ref_flags() { ); // --tag and --tag - uv_snapshot!(context + uv_snapshot!(context.filters(), context .add() .arg("foo") .arg("--tag")