fix(tests): update api_admin_role AppState to post-0.80 fields
The admin-settings refactor replaced AppState's resync/crawler/ analysis_enabled fields with runtime/reloader/crawler_base/ analysis_base, but tests/api_admin_role.rs still built the old shape, so `cargo test` failed to compile (E0560) and blocked every deploy since 0.80.0. Mirror the no-daemon harness in tests/common/mod.rs. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -18,10 +18,10 @@ use tempfile::TempDir;
|
|||||||
use tower::ServiceExt;
|
use tower::ServiceExt;
|
||||||
|
|
||||||
use mangalord::api;
|
use mangalord::api;
|
||||||
use mangalord::app::AppState;
|
use mangalord::app::{AppState, RuntimeControls};
|
||||||
use mangalord::auth::extractor::RequireAdmin;
|
use mangalord::auth::extractor::RequireAdmin;
|
||||||
use mangalord::auth::rate_limit::AuthRateLimiter;
|
use mangalord::auth::rate_limit::AuthRateLimiter;
|
||||||
use mangalord::config::{AuthConfig, UploadConfig};
|
use mangalord::config::{AnalysisConfig, AuthConfig, CrawlerConfig, UploadConfig};
|
||||||
use mangalord::repo;
|
use mangalord::repo;
|
||||||
use mangalord::storage::{LocalStorage, Storage};
|
use mangalord::storage::{LocalStorage, Storage};
|
||||||
|
|
||||||
@@ -49,10 +49,13 @@ fn admin_test_router(pool: PgPool) -> (Router, TempDir) {
|
|||||||
auth,
|
auth,
|
||||||
upload: UploadConfig::default(),
|
upload: UploadConfig::default(),
|
||||||
auth_limiter,
|
auth_limiter,
|
||||||
resync: None,
|
// Mirror the no-daemon test harness in tests/common/mod.rs: empty
|
||||||
crawler: None,
|
// runtime controls, no reloader, env-derived config bases.
|
||||||
|
runtime: Arc::new(RuntimeControls::new(false)),
|
||||||
|
reloader: None,
|
||||||
|
crawler_base: CrawlerConfig::default(),
|
||||||
|
analysis_base: AnalysisConfig::default(),
|
||||||
admin_allowed_origins: Arc::new(Vec::new()),
|
admin_allowed_origins: Arc::new(Vec::new()),
|
||||||
analysis_enabled: false,
|
|
||||||
analysis_events: Arc::new(mangalord::analysis::events::AnalysisEvents::new()),
|
analysis_events: Arc::new(mangalord::analysis::events::AnalysisEvents::new()),
|
||||||
};
|
};
|
||||||
let app = Router::new()
|
let app = Router::new()
|
||||||
|
|||||||
Reference in New Issue
Block a user