Skip to content

Conversation

@niran
Copy link
Contributor

@niran niran commented Jan 11, 2026

Summary

  • Move tests from tests/ directory to inline #[cfg(test)] modules in block.rs, meter.rs, and rpc.rs
  • Delete tests/meter.rs, tests/meter_block.rs, tests/meter_rpc.rs

Test plan

  • cargo test -p base-metering - all 18 tests pass
  • cargo +nightly clippy -p base-metering --tests - no warnings

@cb-heimdall
Copy link
Collaborator

cb-heimdall commented Jan 11, 2026

✅ Heimdall Review Status

Requirement Status More Info
Reviews 1/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

danyalprout pushed a commit that referenced this pull request Jan 11, 2026
## 📝 Summary

<!--- A general summary of your changes -->

## 💡 Motivation and Context

<!--- (Optional) Why is this change required? What problem does it
solve? Remove this section if not applicable. -->

---

## ✅ I have completed the following steps:

* [ ] Run `make lint`
* [ ] Run `make test`
* [ ] Added tests (if applicable)
@niran niran force-pushed the niran/metering-test-harness branch from 8695f6f to fa14653 Compare January 12, 2026 00:25
- Add MeteringTestContext for unit tests that don't need a full node
- Move meter.rs tests inline using MeteringTestContext (sync tests)
- Move block.rs tests inline using MeteringTestContext (sync tests)
- Move rpc.rs tests inline using TestHarness with MeteringExtension
- Delete tests/ directory (all tests now inline)
- Update lib.rs to expose test_utils with #[cfg(any(test, feature = "test-utils"))]
@niran niran force-pushed the niran/metering-test-harness branch from fa14653 to 64ae567 Compare January 12, 2026 17:38
@niran niran changed the title refactor(metering): Use test-utils's TestHarness and move tests inline refactor(metering): move tests inline with MeteringTestContext Jan 12, 2026
@danyalprout danyalprout added this to the v0.3.0 milestone Jan 12, 2026
Address PR review feedback:
- Delete test_utils.rs and remove test-utils feature to avoid duplication
- Use TestHarness from base-client-node for all tests
- Remove envelope_from_signed helper - use direct conversion
- Remove unused imports
@niran niran changed the title refactor(metering): move tests inline with MeteringTestContext refactor(metering): move tests inline Jan 12, 2026
@niran niran requested a review from danyalprout January 12, 2026 19:18
@niran niran added this pull request to the merge queue Jan 12, 2026
Merged via the queue into main with commit 49fc6a8 Jan 12, 2026
27 of 28 checks passed
@niran niran deleted the niran/metering-test-harness branch January 12, 2026 19:35
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.

4 participants