3ba24a0faf
openfut-import-fifa17/tests/durable_import.rs drives the REAL import pipeline
(analyze -> Report dry-run; emit_content; plan_apply -> GenericImportRequest +
deterministic identity mappings + watermark; the staging/preflight/seed/
post-validate gates over a real JsonIdentityStore; openfut_core::services::
import::apply_profile_import in one Core SQLite tx) against a disposable
temp-file Core DB, from a small sanitized in-test fixture (750000 coins, 3
resolvable base players, unopenedPackIds [70,70,101], one squad).
Five ordered steps on one durable target, all green:
A dry-run: report exposes persona/coins/inventory/unopened/fingerprint; ZERO
DB mutation (all Core tables COUNT=0, identity store empty).
B apply: coins=750000 exact, owned=3, packs=3 (opened=0), squad_players=2,
deterministic owned ids, import_fingerprint recorded, identities reverse-
resolve both ways, watermark=100000600.
C restart: close+reopen the SAME sqlite file -> identical state.
D re-apply same source -> AlreadyImported (fingerprint), no doubling.
E conflict (coins 750000->750001 flips the fingerprint for the same game)
-> apply fails closed ('different source'); DB unchanged.
Fingerprint = FNV-1a-64 hex of the source snapshot, carried into
ProfileImportRequest.source_fingerprint = Core profiles.import_fingerprint, the
per-game rerun-identity key. dev-deps added to openfut-import-fifa17
(openfut-core path, tokio, sqlx). No production/live data.
28 lines
1.0 KiB
TOML
28 lines
1.0 KiB
TOML
[package]
|
|
name = "openfut-import-fifa17"
|
|
version = "0.1.0"
|
|
edition = "2021"
|
|
description = "Evidence-driven import of a real FIFA 17 Python profile into OpenFUT Core: read-only dry-run analysis (item accounting, observed-definition generation with a consistency gate, owned-instance identity preservation, squad coverage) plus public content-pack / host-catalog emission and a private import manifest. Writes no Core/identity state without an explicit apply phase."
|
|
|
|
[[bin]]
|
|
name = "openfut-import-fifa17"
|
|
path = "src/main.rs"
|
|
|
|
[lib]
|
|
name = "openfut_import_fifa17"
|
|
path = "src/lib.rs"
|
|
|
|
[dependencies]
|
|
anyhow = "1"
|
|
serde = { version = "1", features = ["derive"] }
|
|
serde_json = "1"
|
|
uuid = { version = "1", features = ["v5"] }
|
|
openfut-adapter-fifa17 = { path = "../openfut-adapter-fifa17" }
|
|
openfut-identity = { path = "../openfut-identity" }
|
|
|
|
[dev-dependencies]
|
|
tempfile = "3"
|
|
openfut-core = { path = "../openfut-core" }
|
|
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }
|
|
sqlx = { version = "0.7", features = ["sqlite", "runtime-tokio-rustls"] }
|