Server overhaul: one test harness in tests/common for every test binary
core_api/common.rs becomes tests/common/mod.rs and sync_api/m4.rs tests/common/sync_fixtures.rs; each binary includes them through #[path] (the binaries of SPEC §14.7 stay as they are). TempDir's Default moves into the harness instead of three copies; the skeleton helpers take ids, tokens and TempDir from it. Milestone wording in test docs and the server README replaced by what the code does; README seams and test layout updated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TQd3pEP9UeN2uifbHknQ7B
This commit is contained in:
@@ -16,8 +16,8 @@ use serde_json::{Value, json};
|
||||
use uuid::Uuid;
|
||||
|
||||
use crate::common::*;
|
||||
use crate::m4;
|
||||
use crate::stub::*;
|
||||
use crate::sync_fixtures;
|
||||
|
||||
const EXPENSE: &str = "01929c5e-1111-7aaa-8bbb-000000000001";
|
||||
const FAST: [u64; 3] = [10, 20, 40];
|
||||
@@ -31,7 +31,7 @@ struct Setup {
|
||||
|
||||
impl Setup {
|
||||
async fn new() -> Self {
|
||||
let app = m4::app().await;
|
||||
let app = sync_fixtures::app().await;
|
||||
for (device, tok) in [
|
||||
(ADMIN_DEVICE_ID, "tok-admin"),
|
||||
(MEMBER_DEVICE_ID, "tok-member"),
|
||||
@@ -445,12 +445,12 @@ async fn sync_push_reaches_fcm_through_the_queue_and_the_sender_task() {
|
||||
delays: vec![Duration::from_millis(10)],
|
||||
},
|
||||
);
|
||||
m4::with_push(&mut s.app, queue);
|
||||
let id = m4::new_id();
|
||||
m4::push_one(
|
||||
sync_fixtures::with_push(&mut s.app, queue);
|
||||
let id = sync_fixtures::new_id();
|
||||
sync_fixtures::push_one(
|
||||
&s.app,
|
||||
&member_token(),
|
||||
m4::exp(m4::expense(&id, "2026-10-17T11:00:00.000Z")),
|
||||
sync_fixtures::exp(sync_fixtures::expense(&id, "2026-10-17T11:00:00.000Z")),
|
||||
)
|
||||
.await;
|
||||
let deadline = Instant::now() + Duration::from_secs(5);
|
||||
|
||||
@@ -1,17 +1,11 @@
|
||||
//! M4 push tests (SPEC §14.6, FR-13): payloads of every type against `contracts/examples/push/`, recipients, the
|
||||
//! Push tests (SPEC §14.6, FR-13): payloads of every type against `contracts/examples/push/`, recipients, the
|
||||
//! OAuth2 service-account flow and token cache, retries and their delays, token clearing on `UNREGISTERED`/404,
|
||||
//! queue overflow, push disabled without credentials, all against a local stub of Google's two endpoints.
|
||||
|
||||
#[path = "../core_api/common.rs"]
|
||||
#[path = "../common/mod.rs"]
|
||||
pub mod common;
|
||||
#[path = "../sync_api/m4.rs"]
|
||||
pub mod m4;
|
||||
pub mod stub;
|
||||
#[path = "../common/sync_fixtures.rs"]
|
||||
pub mod sync_fixtures;
|
||||
|
||||
mod fcm;
|
||||
|
||||
impl Default for common::TempDir {
|
||||
fn default() -> Self {
|
||||
Self::new()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user