Skip to content

Conversation

@tylerhawkes
Copy link
Contributor

@tylerhawkes tylerhawkes commented Jan 22, 2026

Update test logger output in xmtp_common::test::build_layers to include file and line, omit target, and switch workspace feature resolver to "3" to improve tester ergonomics

Adjust default fmt layer to show file and line and hide target in crates/xmtp_common/src/test.rs, guard message ID replacement by checking presence, and set Cargo feature resolver to "3" in Cargo.toml. Rename recursive macro calls to $crate::tester! in crates/xmtp_mls/src/utils/test/tester_utils.rs.

📍Where to Start

Start with the logger layer configuration in xmtp_common::test::build_layers in crates/xmtp_common/src/test.rs.


📊 Macroscope summarized a8501e3. 2 files reviewed, 1 issue evaluated, 0 issues filtered, 1 comment posted

🗂️ Filtered Issues

@tylerhawkes tylerhawkes marked this pull request as ready for review January 22, 2026 23:07
@tylerhawkes tylerhawkes requested a review from a team as a code owner January 22, 2026 23:07
Copy link
Contributor Author


How to use the Graphite Merge Queue

Add the label mergequeue to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@claude
Copy link

claude bot commented Jan 22, 2026

Claude finished @tylerhawkes's task —— View job


Code Review Complete

Tasks

  • Read changed files
  • Analyze changes for code quality, bugs, performance, security, and test coverage
  • Post review feedback

Review Summary

Reviewed on: 2026-01-22 23:08 UTC

This PR makes targeted improvements to test ergonomics and logging. The changes are well-focused and appropriate for the stated goal.

Changes Overview

  1. Cargo.toml - Updated resolver from "2" to "3" (Cargo 2024 edition resolver)
  2. crates/xmtp_common/src/test.rs - Enhanced test logger with file/line info and optimized ID replacement
  3. crates/xmtp_mls/src/utils/test/tester_utils.rs - Fixed macro hygiene in the tester! macro

Findings

✅ Code Quality

  • All changes improve code quality without introducing technical debt
  • The macro hygiene fix (using $crate::tester! instead of tester!) is a best practice that prevents namespace collisions

✅ Performance

  • Minor optimization in crates/xmtp_common/src/test.rs:134-138: Added if message.contains(id) guard before calling replace(), reducing unnecessary string allocations when IDs aren't present in messages

✅ Best Practices

  • Cargo resolver upgrade to "3" aligns with Rust 2024 edition standards
  • Enhanced test logs with file/line numbers (with_file(true), with_line_number(true)) will significantly improve debugging
  • Removing timestamps (without_time() -> removed) is appropriate for test output where relative timing matters less than file location

✅ Security

  • No security concerns

✅ Test Coverage

  • Changes are in test infrastructure itself - no additional test coverage needed

Notes

  • The PR achieves its goal of improving "test logs and tester ergonomics" effectively
  • The file/line number additions will make test debugging much easier
  • No breaking changes or API modifications

Comment on lines +134 to 139
if message.contains(id) {
message = message.replace(id, name);
message =
message.replace(&crate::fmt::truncate_hex(id), name);
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The message.contains(id) guard prevents replacing truncated hex when only the truncated form is present. Consider removing this guard or also checking for truncate_hex(id).

Suggested change
if message.contains(id) {
message = message.replace(id, name);
message =
message.replace(&crate::fmt::truncate_hex(id), name);
}
}
message = message.replace(id, name);
message =
message.replace(&crate::fmt::truncate_hex(id), name);

🚀 Want me to fix this? Reply ex: "fix it for me".

@codecov
Copy link

codecov bot commented Jan 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.09%. Comparing base (7c06b2c) to head (a8501e3).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3052      +/-   ##
==========================================
- Coverage   74.20%   74.09%   -0.11%     
==========================================
  Files         445      445              
  Lines       54346    54346              
==========================================
- Hits        40326    40270      -56     
- Misses      14020    14076      +56     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

3 participants