Set UV_LINK_MODE=copy for Windows test runs (#8350)

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.
This commit is contained in:
Zanie Blue 2024-10-20 13:37:41 -05:00 committed by GitHub
parent be26e47d2f
commit ab16bf0a8c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 13 additions and 3 deletions

View file

@ -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

View file

@ -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 <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()

View file

@ -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")