Skip to content

Conversation

@m-005
Copy link
Member

@m-005 m-005 commented Jan 16, 2026

Summary

Implements transport-layer test utilities in objects-test-utils and migrates all objects-transport tests to use the shared utilities, completing PR3 from the test utilities consolidation roadmap.

Changes

New transport.rs Module

  • Network configuration factories (network_config(), network_config_with_relay())
  • Endpoint creation utilities (endpoint(), endpoint_with_key(), endpoint_with_config())
  • Cryptographic helper (secret_key())
  • Async wait helpers (wait_short(), wait_medium(), wait_long())
  • Assertion helper (assert_node_ids_match() with #[track_caller])

Migration

  • integration_test.rs: 13 tests migrated (6 ignored for relay requirements)
  • property_test.rs: 16 property tests migrated
  • Removed all rand::rng() direct usage in tests → now using transport::secret_key()
  • Deleted crates/objects-transport/tests/common/ (no backward compatibility stubs)

Test Results

✅ All tests passing:

  • objects-test-utils: 26 doctests + 12 unit tests + 15 self-tests
  • objects-transport: 13 integration + 16 property tests
  • Clippy: 0 warnings

Benefits

  1. Eliminates 84 lines of duplicated code from transport common module
  2. Standardizes endpoint creation across all transport tests
  3. Consistent async wait patterns for test timing
  4. Single source of truth for transport test utilities

Roadmap Progress

  • ✅ PR1: Foundation & Identity Utilities (merged)
  • PR3: Transport Utilities (this PR)
  • ⏳ PR2: Data Utilities (can develop in parallel)
  • ⏳ PR4: Sync Utilities (depends on PR2 + PR3)
  • ⏳ PR5: Cleanup

Verification

cargo test -p objects-test-utils
cargo test -p objects-transport
cargo clippy --workspace -- -D warnings

Related to #13

m-005 added 2 commits January 15, 2026 22:09
…ansport tests

Implements transport-layer test utilities in objects-test-utils and
migrates all objects-transport tests to use the shared utilities.

Changes:
- Add transport.rs module with endpoint, config, and assertion utilities
- Add objects-transport and tokio dependencies to test-utils
- Migrate integration_test.rs to use objects_test_utils::transport
- Migrate property_test.rs to remove common module dependency
- Remove crates/objects-transport/tests/common/ entirely
- Replace rand::rng() usage for consistency with existing patterns

All tests pass (13 integration tests, 16 property tests).

Related to PR3 roadmap for test utilities consolidation.
@claude
Copy link

claude bot commented Jan 16, 2026

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

m-005 added 2 commits January 15, 2026 22:39
… pattern

- Migrate all 6 remaining SecretKey::generate calls in property tests to transport::secret_key()
- Remove unused SecretKey import from property_test.rs
- Apply direct import pattern for assert_node_ids_match in integration tests
- Demonstrates recommended module-prefixed pattern (transport::endpoint()) with
  pragmatic exceptions for assertion helpers (assert_node_ids_match)

All tests passing: 45 transport tests (16 unit + 13 integration + 16 property)
Zero clippy warnings
@m-005 m-005 merged commit 49b5c4e into main Jan 16, 2026
@m-005 m-005 deleted the feat/test-utils-transport branch January 16, 2026 03:42
m-005 added a commit that referenced this pull request Jan 16, 2026
…ansport tests (PR3) (#17)

* feat(objects-test-utils): Add transport module and migrate objects-transport tests

Implements transport-layer test utilities in objects-test-utils and
migrates all objects-transport tests to use the shared utilities.

Changes:
- Add transport.rs module with endpoint, config, and assertion utilities
- Add objects-transport and tokio dependencies to test-utils
- Migrate integration_test.rs to use objects_test_utils::transport
- Migrate property_test.rs to remove common module dependency
- Remove crates/objects-transport/tests/common/ entirely
- Replace rand::rng() usage for consistency with existing patterns

All tests pass (13 integration tests, 16 property tests).

Related to PR3 roadmap for test utilities consolidation.

* fix(objects-test-utils): Add missing Duration import to transport doctest

* refactor: Complete property test migration and apply pragmatic import pattern

- Migrate all 6 remaining SecretKey::generate calls in property tests to transport::secret_key()
- Remove unused SecretKey import from property_test.rs
- Apply direct import pattern for assert_node_ids_match in integration tests
- Demonstrates recommended module-prefixed pattern (transport::endpoint()) with
  pragmatic exceptions for assertion helpers (assert_node_ids_match)

All tests passing: 45 transport tests (16 unit + 13 integration + 16 property)
Zero clippy warnings
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.

2 participants