feat: bump depot version to 0.23.1 and add tests for self-update context handling
This commit is contained in:
Generated
+1
-1
@@ -418,7 +418,7 @@ checksum = "807800ff3288b621186fe0a8f3392c4652068257302709c24efd918c3dffcdc2"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "depot"
|
name = "depot"
|
||||||
version = "0.23.0"
|
version = "0.23.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"ar",
|
"ar",
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "depot"
|
name = "depot"
|
||||||
version = "0.23.0"
|
version = "0.23.1"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
|
|
||||||
[lints.rust]
|
[lints.rust]
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
project(
|
project(
|
||||||
'depot',
|
'depot',
|
||||||
version: '0.23.0',
|
version: '0.23.1',
|
||||||
meson_version: '>=0.60.0',
|
meson_version: '>=0.60.0',
|
||||||
default_options: ['buildtype=release'],
|
default_options: ['buildtype=release'],
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -151,6 +151,10 @@ fn is_explicit_depot_self_update_request(packages: &[String]) -> bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn ensure_depot_self_update_not_required(config: &config::Config, rootfs: &Path) -> Result<()> {
|
fn ensure_depot_self_update_not_required(config: &config::Config, rootfs: &Path) -> Result<()> {
|
||||||
|
if current_install_invocation_context() == InstallInvocationContext::Update {
|
||||||
|
return Ok(());
|
||||||
|
}
|
||||||
|
|
||||||
let db_path = config.installed_db_path(rootfs);
|
let db_path = config.installed_db_path(rootfs);
|
||||||
if db::get_package_version(&db_path, DEPOT_PACKAGE_NAME)
|
if db::get_package_version(&db_path, DEPOT_PACKAGE_NAME)
|
||||||
.with_context(|| {
|
.with_context(|| {
|
||||||
@@ -6343,6 +6347,47 @@ optional = []
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn depot_self_update_check_is_skipped_for_nested_update_install_context() -> Result<()> {
|
||||||
|
let temp = tempfile::tempdir().context("Failed to create temp dir")?;
|
||||||
|
let rootfs = temp.path().join("rootfs");
|
||||||
|
let repo_clones = temp.path().join("repos");
|
||||||
|
let build_dir = temp.path().join("build");
|
||||||
|
let db_dir = rootfs.join("var/lib/depot");
|
||||||
|
fs::create_dir_all(&db_dir)?;
|
||||||
|
fs::create_dir_all(&repo_clones)?;
|
||||||
|
fs::create_dir_all(&build_dir)?;
|
||||||
|
|
||||||
|
let mut config = config::Config::for_rootfs(&rootfs);
|
||||||
|
config.repo_clone_dir = repo_clones.clone();
|
||||||
|
config.build_dir = build_dir;
|
||||||
|
config.db_dir = db_dir;
|
||||||
|
config.repo_settings.prefer_binary = false;
|
||||||
|
config.binary_repos.clear();
|
||||||
|
config.source_repos.insert(
|
||||||
|
"core".into(),
|
||||||
|
config::SourceRepo {
|
||||||
|
url: "https://example.test/core.git".into(),
|
||||||
|
enabled: true,
|
||||||
|
priority: 0,
|
||||||
|
subdirs: Vec::new(),
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
register_installed_test_package(&config, &rootfs, DEPOT_PACKAGE_NAME, "1.0.0")?;
|
||||||
|
write_test_repo_spec(
|
||||||
|
&repo_clones.join("core").join("depot.toml"),
|
||||||
|
DEPOT_PACKAGE_NAME,
|
||||||
|
"1.1.0",
|
||||||
|
)?;
|
||||||
|
|
||||||
|
let mut env = TestEnv::new();
|
||||||
|
env.set_var(DEPOT_INSTALL_CONTEXT_ENV, INSTALL_CONTEXT_UPDATE);
|
||||||
|
|
||||||
|
ensure_depot_self_update_not_required(&config, &rootfs)?;
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn collect_missing_update_dependencies_skips_planned_provides_and_installed_deps() -> Result<()>
|
fn collect_missing_update_dependencies_skips_planned_provides_and_installed_deps() -> Result<()>
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user