Skip to content

Not --all-features test suite#1038

Open
benalleng wants to merge 4 commits intopayjoin:masterfrom
benalleng:no-default-feat-tests
Open

Not --all-features test suite#1038
benalleng wants to merge 4 commits intopayjoin:masterfrom
benalleng:no-default-feat-tests

Conversation

@benalleng
Copy link
Copy Markdown
Collaborator

@benalleng benalleng commented Sep 3, 2025

Got everything compiling, however based on the current cfg flag layout in the integration tests, all the tests are run when v1 is enabled and none of the tests run when v2 is enabled

Closes #1019

Pull Request Checklist

Please confirm the following before requesting review:

@benalleng benalleng changed the title No default feat tests No-default-feature test suite Sep 3, 2025
@benalleng benalleng force-pushed the no-default-feat-tests branch from 1158ab4 to c367b20 Compare September 3, 2025 19:34
@coveralls
Copy link
Copy Markdown
Collaborator

coveralls commented Sep 3, 2025

Coverage Report for CI Build 24687887120

Coverage increased (+0.002%) to 84.504%

Details

  • Coverage increased (+0.002%) from the base build.
  • Patch coverage: 4 uncovered changes across 1 file (113 of 117 lines covered, 96.58%).
  • No coverage regressions found.

Uncovered Changes

File Changed Covered %
payjoin/src/core/uri/v1.rs 108 104 96.3%

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 12926
Covered Lines: 10923
Line Coverage: 84.5%
Coverage Strength: 409.42 hits per line

💛 - Coveralls

@benalleng benalleng force-pushed the no-default-feat-tests branch from c367b20 to ee62384 Compare September 3, 2025 19:54
Comment thread payjoin/contrib/test.sh Outdated
cargo test --locked --package payjoin --verbose --no-default-features --features v1 --test integration

cargo test --locked --package payjoin --verbose --no-default-features --features v2 --lib
cargo test --locked --package payjoin --verbose --no-default-features --features v2 --test integration
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

based on the current cfg logic in the integration tests no tests run when v2 is the only thing enabled, perhaps someone could point me in the right direction on better splitting up the tests based on features

@benalleng benalleng force-pushed the no-default-feat-tests branch 3 times, most recently from 8e300b4 to 273378f Compare September 3, 2025 20:16
Comment thread payjoin/tests/integration.rs Outdated
@benalleng benalleng force-pushed the no-default-feat-tests branch from 273378f to a0e0e98 Compare September 3, 2025 20:18
Copy link
Copy Markdown
Contributor

@DanGould DanGould left a comment

Choose a reason for hiding this comment

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

My guess is that the v2 tests are relying on the URI builder from v1. We may need another builder that's v2-specific OR to expose this utility without feature gating it. The former seems more appropriate.

let mut pj_uri =
                build_v1_pj_uri(&pj_receiver_address, EXAMPLE_URL, OutputSubstitution::Enabled)?;

@benalleng benalleng force-pushed the no-default-feat-tests branch 2 times, most recently from 4439740 to cea604e Compare September 3, 2025 20:43
@benalleng
Copy link
Copy Markdown
Collaborator Author

My guess is that the v2 tests are relying on the URI builder from v1. We may need another builder that's v2-specific OR to expose this utility without feature gating it. The former seems more appropriate.

let mut pj_uri =
                build_v1_pj_uri(&pj_receiver_address, EXAMPLE_URL, OutputSubstitution::Enabled)?;

Its only the v2_to_v1 test that requires this setup whereas all the others rely on the usual session to create a pj_uri. I guess we could create a pj_uri with a session like that but then it really wouldn't be a v1 receiver

@DanGould
Copy link
Copy Markdown
Contributor

DanGould commented Sep 3, 2025

Ah, and in that case it makes sense to test only with v1 compiled. Needs further investigation I suppose.

@benalleng benalleng marked this pull request as ready for review September 4, 2025 12:02
@benalleng benalleng changed the title No-default-feature test suite Not --all-features test suite Sep 4, 2025
@benalleng benalleng force-pushed the no-default-feat-tests branch 3 times, most recently from a258176 to ace4cf6 Compare September 8, 2025 17:59
@benalleng benalleng force-pushed the no-default-feat-tests branch 2 times, most recently from 257cc45 to b1f803f Compare September 15, 2025 15:30
@benalleng benalleng force-pushed the no-default-feat-tests branch 3 times, most recently from 32abaa0 to 91db3c6 Compare September 22, 2025 16:44
@benalleng benalleng closed this Oct 6, 2025
@benalleng benalleng deleted the no-default-feat-tests branch October 6, 2025 18:39
@benalleng benalleng restored the no-default-feat-tests branch October 6, 2025 18:39
@benalleng benalleng reopened this Oct 6, 2025
@DanGould DanGould removed their request for review October 7, 2025 15:17
@benalleng benalleng force-pushed the no-default-feat-tests branch 2 times, most recently from b790f30 to 65f2cfd Compare October 29, 2025 16:49
@DanGould
Copy link
Copy Markdown
Contributor

@benalleng I may have unrequested reviewership by mistake. Is this ready for review?

@benalleng benalleng force-pushed the no-default-feat-tests branch from 65f2cfd to 4e866cf Compare November 24, 2025 17:12
@benalleng
Copy link
Copy Markdown
Collaborator Author

benalleng commented Nov 24, 2025

It is though with our source code now organized correctly #1019 (comment) we no longer fail on cargo test -p payjoin so before any actual code review I guess we need to ask ourselves if the addition of non --all-features tests still bring joy

This is incorrect we still fail on cargo test -p payjoin on master

@benalleng benalleng force-pushed the no-default-feat-tests branch 2 times, most recently from 0bb2c08 to d3bb1ab Compare February 4, 2026 20:08
@benalleng benalleng requested a review from DanGould February 4, 2026 20:09
@benalleng
Copy link
Copy Markdown
Collaborator Author

At the moment the line
https://github.com/benalleng/rust-payjoin/blob/d3bb1ab5e74f32b74dd2fb50000b920e514a03c9/payjoin/contrib/test.sh#L11
does not test anything with the v2 feature as all the v2 tests require enabling v1 with the way that the integration tests are organized at the moment.

@DanGould
Copy link
Copy Markdown
Contributor

Please remind me how you'd like this one to end up? We want to test v2 only and this is the way to do it? Seems like a no-brainer as a code reduction and ehh we actually want to run our tests.

@benalleng
Copy link
Copy Markdown
Collaborator Author

I think it is good at the moment, but the noop for the v2 feature seems a bit confusing for the integration test with how I organized it. But I guess its better than failing and all the tests still run

The uri tests were looking at bip21 uris with v1 or v2 specific features
and failing when the features were locked to the opposite feature
respectively.

I have moved the relevant tests to be in the correct module so that they
only compile within the correct feature.
This commit locks the integration tests down into their specific enabled
versions.
Add the test suite for the `contrib/test,sh` script in the payjoin
crate.
@benalleng benalleng force-pushed the no-default-feat-tests branch from d3bb1ab to 5ae9703 Compare April 20, 2026 19:10
@DanGould
Copy link
Copy Markdown
Contributor

I see you just rebased but we may need another

@benalleng
Copy link
Copy Markdown
Collaborator Author

Yeah I gave it a try to get the tests properly partitioned but I think the latest commit isn't right

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.

cargo test -p payjoin fails

3 participants