mirror of
https://github.com/Yuyi-Oak/BlueArchiveToolkit.git
synced 2026-07-22 07:16:45 +08:00
feat: track official versions and import resources
Persist official version-state, extend CAS/ResourceRepository import classification, and add offline catalog and failure regression fixtures. Fixes #13 Fixes #12 Fixes #8
This commit is contained in:
@@ -7,9 +7,9 @@ use bat_adapters::official::yostar_jp::{
|
||||
YostarJpResourceDiscoveryPlan, YostarJpResourceEndpointKind, YostarJpServerInfo,
|
||||
};
|
||||
use bat_infrastructure::{
|
||||
build_official_pull_plan_from_platform_inventory, OfficialGameMainConfigBootstrapService,
|
||||
OfficialResourcePullService, OfficialUpdateConfig, OfficialUpdateProgress,
|
||||
OfficialUpdateService, OfficialUpdateStatus,
|
||||
build_official_pull_plan_from_platform_inventory, read_version_state,
|
||||
OfficialGameMainConfigBootstrapService, OfficialResourcePullService, OfficialUpdateConfig,
|
||||
OfficialUpdateProgress, OfficialUpdateService, OfficialUpdateStatus,
|
||||
};
|
||||
use std::collections::HashMap;
|
||||
use std::fs;
|
||||
@@ -252,15 +252,26 @@ fn official_update_first_run_pulls_without_pre_audit() {
|
||||
.unwrap()
|
||||
.file_type()
|
||||
.is_symlink());
|
||||
assert_eq!(
|
||||
config
|
||||
.output_root
|
||||
.join("official-download-manifest.json")
|
||||
.exists(),
|
||||
false
|
||||
);
|
||||
assert!(!config
|
||||
.output_root
|
||||
.join("official-download-manifest.json")
|
||||
.exists());
|
||||
assert!(published.join("official-download-manifest.json").exists());
|
||||
assert!(published.join("official-sync-snapshot.json").exists());
|
||||
let version_state = read_version_state(&report.version_state_path)
|
||||
.unwrap()
|
||||
.unwrap();
|
||||
assert_eq!(
|
||||
version_state
|
||||
.current_completed_version
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
.version_path
|
||||
.as_deref(),
|
||||
Some(published.as_path())
|
||||
);
|
||||
assert!(version_state.in_progress_version.is_none());
|
||||
assert!(version_state.failed_versions.is_empty());
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -305,6 +316,18 @@ fn official_update_second_run_audits_existing_resources_before_reuse() {
|
||||
.unwrap()
|
||||
.file_type()
|
||||
.is_symlink());
|
||||
let version_state = read_version_state(&report.version_state_path)
|
||||
.unwrap()
|
||||
.unwrap();
|
||||
assert_eq!(
|
||||
version_state
|
||||
.current_completed_version
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
.resource_root,
|
||||
report.active_resource_root
|
||||
);
|
||||
assert!(version_state.in_progress_version.is_none());
|
||||
}
|
||||
|
||||
struct TestHarness {
|
||||
|
||||
Reference in New Issue
Block a user