mirror of
https://github.com/astral-sh/uv.git
synced 2025-09-30 14:01:13 +00:00
uv/tests: remove non-deterministic checking in ecosystem tests
We basically avoid this by construction now, so there are no failures.
This commit is contained in:
parent
b268f5eb8a
commit
58fac3d577
1 changed files with 2 additions and 32 deletions
|
@ -52,7 +52,7 @@ fn transformers() -> Result<()> {
|
|||
if !cfg!(target_os = "linux") && std::env::var_os("CI").is_some() {
|
||||
return Ok(());
|
||||
}
|
||||
lock_ecosystem_package_non_deterministic("3.12", "transformers")
|
||||
lock_ecosystem_package("3.12", "transformers")
|
||||
}
|
||||
|
||||
// Source: https://github.com/konstin/warehouse/blob/baae127d90417104c8dee3fdd3855e2ba17aa428/pyproject.toml
|
||||
|
@ -68,7 +68,7 @@ fn warehouse() -> Result<()> {
|
|||
if !cfg!(target_os = "linux") && std::env::var_os("CI").is_some() {
|
||||
return Ok(());
|
||||
}
|
||||
lock_ecosystem_package_non_deterministic("3.11", "warehouse")
|
||||
lock_ecosystem_package("3.11", "warehouse")
|
||||
}
|
||||
|
||||
// Currently ignored because the project doesn't build with `uv` yet.
|
||||
|
@ -116,33 +116,3 @@ fn lock_ecosystem_package(python_version: &str, name: &str) -> Result<()> {
|
|||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// This is like `lock_ecosystem_package`, but does not assert that a
|
||||
/// re-run of `uv lock` does not change the lock file.
|
||||
///
|
||||
/// Ideally, this routine would never be used. But it was added as
|
||||
/// a stop-gap to enable at least tracking the lock files of some
|
||||
/// ecosystem packages even if re-locking is producing different
|
||||
/// results.
|
||||
fn lock_ecosystem_package_non_deterministic(python_version: &str, name: &str) -> Result<()> {
|
||||
let context = TestContext::new(python_version);
|
||||
context.copy_ecosystem_project(name);
|
||||
|
||||
let mut cmd = context.lock();
|
||||
cmd.env("UV_EXCLUDE_NEWER", EXCLUDE_NEWER);
|
||||
let (snapshot, _) = common::run_and_format(
|
||||
&mut cmd,
|
||||
context.filters(),
|
||||
name,
|
||||
Some(common::WindowsFilters::Platform),
|
||||
);
|
||||
insta::assert_snapshot!(format!("{name}-uv-lock-output"), snapshot);
|
||||
|
||||
let lock = fs_err::read_to_string(context.temp_dir.join("uv.lock")).unwrap();
|
||||
insta::with_settings!({
|
||||
filters => context.filters(),
|
||||
}, {
|
||||
assert_snapshot!(format!("{name}-lock-file"), lock);
|
||||
});
|
||||
Ok(())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue