Repository navigation
fix(tests): compile the test suite without default features - #24
Merged
Merged
Conversation
Since the ethereum feature was made optional in 0.5.0, the session.rs unit tests and most integration tests imported alloy unconditionally, so `cargo test --no-default-features --tests` failed to compile while the library itself built fine. Gate those tests behind the ethereum feature, keep the shared time helper unconditional, and run clippy and the test suite with --no-default-features in CI so it cannot regress.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
cargo test --no-default-features --testshas not compiled since theethereumfeature was made optional in 0.5.0 (PR #19): the library was gated correctly, the tests were not. Thesession.rsunit tests and eight integration test files importedalloyunconditionally, and CI only ever ran with--all-features, so nobody saw it.Changes
tests/common/mod.rs:now_tsstays unconditional; the five alloy-backed helpers move into a submodule gated onethereumand are re-exported.#![cfg(feature = "ethereum")].threshold_tests.rsandcustom_scheme_tests.rsneed no signer and still run without the feature.src/session.rs: unit test module gated onall(test, feature = "ethereum"). The config builder test in that module did not need alloy but is skipped without the feature rather than splitting the module for one test.cargo clippy --no-default-features --tests -- -D warningsandcargo test --no-default-features --tests.