v0.3.3-pre.007
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// file: crates/ksp-store-postgres-lib/tests/dependency_boundary.rs
|
||||
// version: 11
|
||||
// version: 12
|
||||
|
||||
#![warn(missing_docs)]
|
||||
#![deny(unreachable_pub)]
|
||||
@@ -166,12 +166,7 @@ fn pre_005_raw_write_sql_is_atomic_idempotent_and_keeps_later_scope_closed() {
|
||||
] {
|
||||
assert!(raw.contains(required), "missing pre.005 RAW write contract: {required}");
|
||||
}
|
||||
for forbidden in [
|
||||
"DELETE FROM",
|
||||
"transition_raw_transaction_retention",
|
||||
"impl ksp_store_api::RawTransactionWrite",
|
||||
"impl ksp_store_api::RawTransactionObservationWrite",
|
||||
] {
|
||||
for forbidden in ["DELETE FROM", "impl ksp_store_api::RawTransactionWrite", "impl ksp_store_api::RawTransactionObservationWrite"] {
|
||||
assert!(!raw.contains(forbidden), "pre.005 opened later RAW scope prematurely: {forbidden}");
|
||||
}
|
||||
return;
|
||||
@@ -215,9 +210,41 @@ fn pre_006_raw_pagination_is_keyset_cursor_bound_and_policy_free() {
|
||||
}
|
||||
assert!(index.contains("ON ksp_raw_transactions (slot, signature)"));
|
||||
assert!(index.contains("WHERE retention_state <> 'purged'"));
|
||||
for forbidden in [" OFFSET ", "limit.min(", "clamp(", "500", "1000", "DELETE FROM", "transition_raw_transaction_retention"] {
|
||||
for forbidden in [" OFFSET ", "limit.min(", "clamp(", "500", "1000"] {
|
||||
assert!(!raw.contains(forbidden), "pre.006 contains forbidden pagination/policy/later-scope material: {forbidden}");
|
||||
assert!(!cursor.contains(forbidden), "pre.006 cursor contains forbidden pagination/policy/later-scope material: {forbidden}");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn pre_007_raw_retention_is_atomic_compare_and_transition_without_fake_compaction() {
|
||||
let raw = include_str!("../src/raw_transaction.rs");
|
||||
let runtime = include_str!("../src/runtime.rs");
|
||||
for required in [
|
||||
"LOCK_RETENTION_TRANSACTION_SQL",
|
||||
"FOR UPDATE",
|
||||
"INSERT_ARCHIVE_PAYLOAD_SQL",
|
||||
"INSERT INTO ksp_raw_transaction_archive_payloads (signature, payload)",
|
||||
"UPDATE_ARCHIVED_TRANSACTION_SQL",
|
||||
"SET payload = NULL, retention_state = 'archived'",
|
||||
"DELETE_ARCHIVE_PAYLOAD_SQL",
|
||||
"DELETE FROM ksp_raw_transaction_archive_payloads",
|
||||
"UPDATE_PURGED_TRANSACTION_SQL",
|
||||
"SET block_time_unix_millis = NULL, payload = NULL, retention_state = 'purged'",
|
||||
"if current == target",
|
||||
"if current != expected",
|
||||
"RawRetentionWriteOutcome::AlreadyAtTarget",
|
||||
"RawRetentionWriteOutcome::ExpectedStateMismatch",
|
||||
"RawRetentionWriteOutcome::Applied",
|
||||
"RetentionCompactionUnsupported",
|
||||
"transition_raw_transaction_retention",
|
||||
] {
|
||||
assert!(raw.contains(required), "missing pre.007 retention contract: {required}");
|
||||
}
|
||||
assert!(runtime.contains("pub async fn transition_raw_transaction_retention"));
|
||||
for forbidden in ["retention_state = 'compacted'", "impl ksp_store_api::RawTransactionRetentionWrite", "flate", "zstd", "lz4", "snappy"] {
|
||||
assert!(!raw.contains(forbidden), "pre.007 contains fake compaction/direct-trait scope: {forbidden}");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// file: crates/ksp-store-postgres-lib/tests/public_api.rs
|
||||
// version: 7
|
||||
// version: 8
|
||||
|
||||
#![warn(missing_docs)]
|
||||
#![deny(unreachable_pub)]
|
||||
@@ -48,13 +48,14 @@ fn pre_005_backend_error_projection_is_safe_and_static() {
|
||||
ksp_store_postgres_lib::PostgresBackendErrorKind::QueryInvalid,
|
||||
ksp_store_postgres_lib::PostgresBackendErrorKind::ReadFailed,
|
||||
ksp_store_postgres_lib::PostgresBackendErrorKind::ReferenceNotFound,
|
||||
ksp_store_postgres_lib::PostgresBackendErrorKind::RetentionCompactionUnsupported,
|
||||
ksp_store_postgres_lib::PostgresBackendErrorKind::SchemaNewer,
|
||||
ksp_store_postgres_lib::PostgresBackendErrorKind::ShutdownTimeout,
|
||||
ksp_store_postgres_lib::PostgresBackendErrorKind::TlsFailed,
|
||||
ksp_store_postgres_lib::PostgresBackendErrorKind::WriteFailed,
|
||||
ksp_store_postgres_lib::PostgresBackendErrorKind::WrongNetwork,
|
||||
];
|
||||
assert_eq!(kinds.len(), 17);
|
||||
assert_eq!(kinds.len(), 18);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -95,3 +96,9 @@ fn pre_006_raw_list_bridge_uses_backend_independent_query_page_and_reference_mod
|
||||
let _list = ksp_store_postgres_lib::PostgresBackend::list_raw_transactions;
|
||||
return;
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn pre_007_raw_retention_write_bridge_uses_backend_independent_transition_and_outcome_models() {
|
||||
let _transition = ksp_store_postgres_lib::PostgresBackend::transition_raw_transaction_retention;
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user