Skip to main content

max / makenotwork

server: fix cargo test — AppState.tier_prices in harnesses + stale price assertions Two compounding rots caught when running cargo test --release locally: - tests/load/runner.rs:101, tests/harness/mod.rs:331 constructed AppState without tier_prices (added in b7b2bd5). Derive Default on TierPrices and slot TierPrices::default() into both harnesses. - src/db/creator_tiers.rs:817/822/827 asserted pre-2026-05-31 prices ($10/$20/$30 → 1000/2000/3000). The pricing-change pass updated the enums.rs tests but missed these. Rename + update to $16/$24/$36. Result: 1656 passed, 0 failed, 2 ignored. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Author: Max Johnson <me@maxj.phd> · 2026-06-01 19:19 UTC
Commit: 93b88d650072928c4d2268df362c8b6f9cb72ff7
Parent: f6edda7
4 files changed, +9 insertions, -7 deletions
@@ -813,18 +813,18 @@ mod tests {
813 813 // ── CreatorTier::price_cents ────────────────────────────────────────
814 814
815 815 #[test]
816 - fn price_basic_is_ten_dollars() {
817 - assert_eq!(CreatorTier::Basic.price_cents(), 1000);
816 + fn price_basic_is_sixteen_dollars() {
817 + assert_eq!(CreatorTier::Basic.price_cents(), 1600);
818 818 }
819 819
820 820 #[test]
821 - fn price_small_files_is_twenty_dollars() {
822 - assert_eq!(CreatorTier::SmallFiles.price_cents(), 2000);
821 + fn price_small_files_is_twenty_four_dollars() {
822 + assert_eq!(CreatorTier::SmallFiles.price_cents(), 2400);
823 823 }
824 824
825 825 #[test]
826 - fn price_big_files_is_thirty_dollars() {
827 - assert_eq!(CreatorTier::BigFiles.price_cents(), 3000);
826 + fn price_big_files_is_thirty_six_dollars() {
827 + assert_eq!(CreatorTier::BigFiles.price_cents(), 3600);
828 828 }
829 829
830 830 #[test]
@@ -10,7 +10,7 @@
10 10
11 11 use docengine::{Assumptions, LookupValue};
12 12
13 - #[derive(Clone, Debug)]
13 + #[derive(Clone, Debug, Default)]
14 14 pub struct TierPrices {
15 15 // Standard monthly (post-founder sticker rates).
16 16 pub basic_std: i32,
@@ -331,6 +331,7 @@ impl TestHarness {
331 331 let state = AppState {
332 332 db: pool.clone(),
333 333 config,
334 + tier_prices: makenotwork::tier_prices::TierPrices::default(),
334 335 s3,
335 336 synckit_s3,
336 337 stripe: opts.stripe_client,
@@ -101,6 +101,7 @@ pub async fn run(config: LoadConfig) {
101 101 let state = AppState {
102 102 db: pool.clone(),
103 103 config: app_config,
104 + tier_prices: makenotwork::tier_prices::TierPrices::default(),
104 105 s3: None,
105 106 synckit_s3: None,
106 107 stripe: None,