fix(tests): update api_admin_role AppState to post-0.80 fields
Some checks failed
deploy / test-backend (push) Failing after 8m1s
deploy / build-and-push (push) Has been cancelled
deploy / deploy (push) Has been cancelled
deploy / test-frontend (push) Has been cancelled

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:
2026-06-14 16:01:09 +02:00
parent f441425519
commit e6fcff5eea

View File

@@ -18,10 +18,10 @@ use tempfile::TempDir;
use tower::ServiceExt;
use mangalord::api;
use mangalord::app::AppState;
use mangalord::app::{AppState, RuntimeControls};
use mangalord::auth::extractor::RequireAdmin;
use mangalord::auth::rate_limit::AuthRateLimiter;
use mangalord::config::{AuthConfig, UploadConfig};
use mangalord::config::{AnalysisConfig, AuthConfig, CrawlerConfig, UploadConfig};
use mangalord::repo;
use mangalord::storage::{LocalStorage, Storage};
@@ -49,10 +49,13 @@ fn admin_test_router(pool: PgPool) -> (Router, TempDir) {
auth,
upload: UploadConfig::default(),
auth_limiter,
resync: None,
crawler: None,
// Mirror the no-daemon test harness in tests/common/mod.rs: empty
// 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()),
analysis_enabled: false,
analysis_events: Arc::new(mangalord::analysis::events::AnalysisEvents::new()),
};
let app = Router::new()