Skip to content

Remove the url crate dep from payjoin-test-utils#1111

Merged
DanGould merged 1 commit intopayjoin:masterfrom
benalleng:remove-test-utils-url-and-request
Sep 25, 2025
Merged

Remove the url crate dep from payjoin-test-utils#1111
DanGould merged 1 commit intopayjoin:masterfrom
benalleng:remove-test-utils-url-and-request

Conversation

@benalleng
Copy link
Collaborator

@benalleng benalleng commented Sep 24, 2025

This removes the url crate completely and replaces it with Strings where appropriate. Notably we still use rewqest::Url in the wait_for_services_ready function.

In the payjoin crate we have not yet removed the Url so we need to parse the EXAMPLE_URL in some tests.

checks some boxes in #513

Pull Request Checklist

Please confirm the following before requesting review:

@benalleng benalleng requested a review from DanGould September 24, 2025 21:46
@benalleng benalleng force-pushed the remove-test-utils-url-and-request branch from 569e1e8 to dd4c373 Compare September 24, 2025 21:48
@coveralls
Copy link
Collaborator

coveralls commented Sep 24, 2025

Pull Request Test Coverage Report for Build 18014757645

Details

  • 26 of 28 (92.86%) changed or added relevant lines in 6 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.005%) to 84.552%

Changes Missing Coverage Covered Lines Changed/Added Lines %
payjoin-test-utils/src/lib.rs 7 9 77.78%
Files with Coverage Reduction New Missed Lines %
payjoin-test-utils/src/lib.rs 1 87.73%
Totals Coverage Status
Change from base Build 18014443430: 0.005%
Covered Lines: 8571
Relevant Lines: 10137

💛 - Coveralls

@benalleng benalleng force-pushed the remove-test-utils-url-and-request branch 3 times, most recently from 3eaa107 to 06090bf Compare September 25, 2025 14:26
Copy link
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.

YES! nice net deletion. I did note one place Url was being used redundantly.

var proposal = res.inner;
return await process_unchecked_proposal(
proposal, recv_persister);
return await process_unchecked_proposal(proposal, recv_persister);
Copy link
Contributor

Choose a reason for hiding this comment

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

noting that this is just a lint

Comment on lines 236 to 238
let health_url: Url = format!("{}/health", service_url.trim_end_matches("/"))
.parse()
.map_err(|_| "Invalid Url")?;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
let health_url: Url = format!("{}/health", service_url.trim_end_matches("/"))
.parse()
.map_err(|_| "Invalid Url")?;
let health_url = format!("{}/health", service_url.trim_end_matches("/"));

Because the fn get type signature takes U: IntoUrl and From<String> for [reqwest::]IntoUrl is implemented.

reqwest::async_impl::client::Client
pub fn get<U>(&self, url: U) -> RequestBuilder
where
    U: IntoUrl,

@benalleng benalleng force-pushed the remove-test-utils-url-and-request branch 4 times, most recently from c5c7e6f to 1b3d976 Compare September 25, 2025 16:28
@DanGould
Copy link
Contributor

gah, conflict

This removes the url crate completely and replaces it with Strings where
appropriate. Notably we still use `reqest::Url` in the
`wait_for_services_ready` function.
@benalleng benalleng force-pushed the remove-test-utils-url-and-request branch from 1b3d976 to 6ebeec8 Compare September 25, 2025 16:53
Copy link
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.

ack 6ebeec8

@DanGould DanGould merged commit 81c1108 into payjoin:master Sep 25, 2025
14 checks passed
@benalleng benalleng deleted the remove-test-utils-url-and-request branch October 6, 2025 18:39
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