Skip to content

refactor(auction): separate fixtures and tests from production code - #687

Merged
Mathih13 merged 1 commit into
mainfrom
refactor/auction-test-ownership
Oct 12, 2026
Merged

Mathih13 merged 1 commit into
mainfrom
refactor/auction-test-ownership

Conversation

@Mathih13

@Mathih13 Mathih13 commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Debug fixtures and unit tests occupied more than half of module/src/auction.rs. The fixture section also separated the Auction reducers from production code for Character deletion and legacy Mail repair.

Move the eight fixture reducers into a private auction/fixtures.rs module under the existing debug_reducers feature. Move all 41 unit tests and their Fakes into auction/tests.rs. The main file shrinks from 7,854 to 3,566 lines. Production function bodies, table definitions, reducer names, and arguments stay unchanged.

What you verified

  • Source comparison confirms that the extraction preserves production code, fixture bodies, and every unit test. Differences are module placement, feature-gate consolidation, and formatting.
  • cargo check -p lyracore-module --tests passed with default features.
  • cargo test -p lyracore-module --lib --features=debug_reducers: 1565 passed; 0 failed.
  • cargo clippy --workspace --all-targets --all-features -- -D warnings passed.
  • Auction durable targets auction_buyout, auction_cancel, and auction_expiry: all 6 tests passed against disposable local SpacetimeDB instances, including Transfer, expiry replay, and legacy Mail repair.
  • Module build_script and package_api_lint: 7 and 37 tests passed.
  • python3 scripts/check-gateway-bindings.py: All 1184 Gateway binding files are current.
  • cargo fmt --all -- --check and git diff --check passed.

The integration tests used the macOS linker option below for SpacetimeDB host symbols. They executed the real Wasm Module.

cargo test --config 'target.aarch64-apple-darwin.rustflags=["-C","link-arg=-Wl,-undefined,dynamic_lookup"]' \
  -p lyracore-module --test build_script --test package_api_lint \
  --test auction_buyout --test auction_cancel --test auction_expiry -- --include-ignored

The Auction patch is unchanged after rebasing onto ff2e6d6b. Independent adversarial review checked the original patch and its integration with the new base. The full Gateway suite also passed on rebased head 6c23be8e, with 2,009 unit tests and 11 other tests. All nine CI checks passed on 6c23be8e. Main then changed Gateway binding generation in #689. A second rebase onto 5bb75ba4 preserves all three Auction files byte for byte at 7ae1a4fa. All nine CI checks passed at 7ae1a4fa, including the new binding workflow and the complete durable suite. The independent reviewer confirmed compatibility with the pinned CLI and its recursive source fingerprints.

What you did NOT verify

No real-client check or deployment to an existing Realm. Unrelated crate test suites and the complete durable suite were not run locally.

Risk

The main risk is losing a fixture reducer during the move. The durable tests and generated-binding comparison check that contract. Legacy Mail repair, Auction transaction rules, and Fake behavior are outside this change.

Model: GPT-6 Astra, high reasoning effort. Harness: Codex in T3 Code.

@Mathih13

Mathih13 commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor Author

Independent adversarial review found no actionable defects in the extraction or its integration with #685 and #689. All eight fixture reducers and all 41 tests retain their bodies. Production code is unchanged. The pinned CLI hashes the new child files and generates bindings with debug_reducers; fixture registration remains intact. No repairs were needed.

All nine CI checks passed at final head 7ae1a4fa: Rust, durable tests and Gateway binding preparation, and Runtime Scripts. The durable jobs tested the merge of this head with base 5bb75ba4. I checked the successful Auction buyout, Cancellation, and expiry results in the logs. Earlier local checks also passed. No real-client or live Realm check was performed.

Merged as b992f1ae. Auction fixtures and unit tests now live in their own files, with transaction behavior preserved.

Independent reviewer and implementing agent used GPT-6 Astra at high effort through Codex in T3 Code.

@Mathih13
Mathih13 force-pushed the refactor/auction-test-ownership branch from 1fe85eb to 6c23be8 Compare October 12, 2026 09:43
@Mathih13
Mathih13 force-pushed the refactor/auction-test-ownership branch from 6c23be8 to 7ae1a4f Compare October 12, 2026 10:06
@Mathih13
Mathih13 merged commit b992f1a into main Oct 12, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant