Check idempotence in packse lock scenarios (#5485)

Add tests for the instabilities fix.

Part of
https://github.com/astral-sh/uv/issues/5180#issuecomment-2247696198

Closes #5180
This commit is contained in:
konsti 2024-07-31 17:39:16 +02:00 committed by GitHub
parent 38c6033010
commit 2247b0f540
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 244 additions and 0 deletions

View file

@ -7,6 +7,7 @@
#![allow(clippy::needless_raw_string_hashes)]
use anyhow::Result;
use assert_cmd::assert::OutputAssertExt;
use assert_fs::prelude::*;
use insta::assert_snapshot;
@ -71,6 +72,17 @@ fn {{module_name}}() -> Result<()> {
"###
);
});
// Assert the idempotence of `uv lock`
context
.lock()
.env_remove("UV_EXCLUDE_NEWER")
.arg("--index-url")
.arg("https://astral-sh.github.io/packse/0.3.31/simple-html/")
.assert()
.success();
let lock2 = fs_err::read_to_string(context.temp_dir.join("uv.lock"))?;
assert_eq!(lock2, lock);
{{/expected.satisfiable}}
Ok(())