Update pre-commit hooks to use nextest for all tests #70

Merged
jwilger merged 1 commit from update-precommit-nextest into main 2025-07-09 07:45:38 -07:00
jwilger commented 2025-07-09 07:41:44 -07:00 (Migrated from github.com)

This PR aligns pre-commit hooks with developer expectations that the entire ecosystem should be kept working.

Changes

  • Replace separate cargo test commands with a single nextest run that includes all targets except benchmarks
  • Remove bogus benchmark placeholder from eventcore-examples that was causing nextest failures (real benchmarks exist in the dedicated eventcore-benchmarks crate)
  • Fix flaky query timeout test by increasing timeout from 100ms to 500ms to account for database initialization time

Why

Developers are expected to maintain the entire codebase, including examples. The pre-commit hooks should match what CI runs to catch issues early.

Testing

All tests pass locally with PostgreSQL databases running via docker-compose.

Definition of Done Checklist

Please ensure all items in this checklist are completed before merging:

  • Code follows project style guidelines
  • Changes are well-documented
  • All tests pass
  • Performance implications have been considered
  • Security implications have been reviewed
  • Breaking changes are documented
  • The change is backward compatible where possible
This PR aligns pre-commit hooks with developer expectations that the entire ecosystem should be kept working. ## Changes - Replace separate cargo test commands with a single nextest run that includes all targets except benchmarks - Remove bogus benchmark placeholder from eventcore-examples that was causing nextest failures (real benchmarks exist in the dedicated eventcore-benchmarks crate) - Fix flaky query timeout test by increasing timeout from 100ms to 500ms to account for database initialization time ## Why Developers are expected to maintain the entire codebase, including examples. The pre-commit hooks should match what CI runs to catch issues early. ## Testing All tests pass locally with PostgreSQL databases running via docker-compose. ## Definition of Done Checklist Please ensure all items in this checklist are completed before merging: - [x] Code follows project style guidelines - [x] Changes are well-documented - [x] All tests pass - [x] Performance implications have been considered - [x] Security implications have been reviewed - [x] Breaking changes are documented - [x] The change is backward compatible where possible
copilot-pull-request-reviewer[bot] (Migrated from github.com) reviewed 2025-07-09 07:42:53 -07:00
copilot-pull-request-reviewer[bot] (Migrated from github.com) left a comment

Pull Request Overview

This PR streamlines the test workflow by switching pre-commit hooks to cargo nextest, removes placeholder benchmark modules that were causing failures, and stabilizes a flaky database test by increasing its timeout.

  • Consolidate all Rust tests under a single cargo nextest run hook.
  • Remove bogus benchmark placeholders in examples to prevent nextest failures.
  • Increase query timeout in a flaky Postgres test from 100 ms to 500 ms.

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
eventcore/examples/resource_lifecycle_example.rs Converted sync tests to async with tokio::test and added a TestResourceManager helper
eventcore-postgres/tests/connection_pool_tests.rs Bumped query timeout in test_query_timeout_configuration to 500 ms
eventcore-examples/src/lib.rs Removed the benchmarks module placeholder
eventcore-examples/src/distributed_ecommerce_example.rs Switched from read_stream to read_streams and flattened payloads for assertions
eventcore-examples/src/benchmarks/mod.rs Deleted placeholder benchmarks module
eventcore-examples/src/benchmarks/bench.rs Deleted placeholder benchmark executable
eventcore-examples/Cargo.toml Removed example bench configuration
.pre-commit-config.yaml Replaced separate cargo test hooks with a unified cargo nextest
Comments suppressed due to low confidence (2)

eventcore/examples/resource_lifecycle_example.rs:484

  • Missing import for Duration. Consider adding use std::time::Duration; at the top of the test module to resolve this.
        let timed = resource.with_timeout(Duration::from_millis(100));

eventcore-examples/src/distributed_ecommerce_example.rs:1400

  • [nitpick] This payload extraction logic is repeated across multiple tests; consider extracting it into a helper function to reduce duplication and improve maintainability.
        let events: Vec<_> = stream_data.events.into_iter().map(|e| e.payload).collect();
## Pull Request Overview This PR streamlines the test workflow by switching pre-commit hooks to `cargo nextest`, removes placeholder benchmark modules that were causing failures, and stabilizes a flaky database test by increasing its timeout. - Consolidate all Rust tests under a single `cargo nextest run` hook. - Remove bogus benchmark placeholders in examples to prevent nextest failures. - Increase query timeout in a flaky Postgres test from 100 ms to 500 ms. ### Reviewed Changes Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments. <details> <summary>Show a summary per file</summary> | File | Description | |---------------------------------------------|--------------------------------------------------------------------| | eventcore/examples/resource_lifecycle_example.rs | Converted sync tests to async with `tokio::test` and added a `TestResourceManager` helper | | eventcore-postgres/tests/connection_pool_tests.rs | Bumped query timeout in `test_query_timeout_configuration` to 500 ms | | eventcore-examples/src/lib.rs | Removed the `benchmarks` module placeholder | | eventcore-examples/src/distributed_ecommerce_example.rs | Switched from `read_stream` to `read_streams` and flattened payloads for assertions | | eventcore-examples/src/benchmarks/mod.rs | Deleted placeholder benchmarks module | | eventcore-examples/src/benchmarks/bench.rs | Deleted placeholder benchmark executable | | eventcore-examples/Cargo.toml | Removed example bench configuration | | .pre-commit-config.yaml | Replaced separate `cargo test` hooks with a unified `cargo nextest` | </details> <details> <summary>Comments suppressed due to low confidence (2)</summary> **eventcore/examples/resource_lifecycle_example.rs:484** * Missing import for `Duration`. Consider adding `use std::time::Duration;` at the top of the test module to resolve this. ``` let timed = resource.with_timeout(Duration::from_millis(100)); ``` **eventcore-examples/src/distributed_ecommerce_example.rs:1400** * [nitpick] This payload extraction logic is repeated across multiple tests; consider extracting it into a helper function to reduce duplication and improve maintainability. ``` let events: Vec<_> = stream_data.events.into_iter().map(|e| e.payload).collect(); ``` </details>
Sign in to join this conversation.
No description provided.