Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add RegistryBuilder for tests, and update crates-io error handling. #9126

Merged
merged 2 commits into from
Feb 3, 2021

Conversation

ehuss
Copy link
Contributor

@ehuss ehuss commented Feb 3, 2021

This adds RegistryBuilder to the test suite to make it more flexible to create different registry setups, and to reuse code a little more easily.

This also makes a small adjustment to the registry API to add a ResponseError type to make it easier to work with API errors. As part of this, some tests were added to validate the API behavior for response errors. There are only a few very small changes here:

  • Extra newlines are removed from the headers printed in the error message.
  • The UTF-8 error now also includes the text "invalid response from server".
  • The "file too large" crates.io publish error now displays the tarball size. (There is no test for this because it is only issued for talking to crates.io.)

Split from #9111.

The intent here is to make it more flexible to create different registry
setups, and to reuse code a little more easily.
The intent here is to make it easier to work with API errors.

This also includes some new tests for checking network errors.
@rust-highfive
Copy link

r? @Eh2406

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 3, 2021
@alexcrichton
Copy link
Member

@bors: r+

@bors
Copy link
Contributor

bors commented Feb 3, 2021

📌 Commit 06b8d1c has been approved by alexcrichton

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 3, 2021
@bors
Copy link
Contributor

bors commented Feb 3, 2021

⌛ Testing commit 06b8d1c with merge 537dc09...

@bors
Copy link
Contributor

bors commented Feb 3, 2021

☀️ Test successful - checks-actions
Approved by: alexcrichton
Pushing 537dc09 to master...

@bors bors merged commit 537dc09 into rust-lang:master Feb 3, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 5, 2021
Update cargo

5 commits in e099df243bb2495b9b197f79c19f124032b1e778..34170fcd6e0947808a1ac63ac85ffc0da7dace2f
2021-02-01 16:24:34 +0000 to 2021-02-04 15:52:52 +0000
- Fix permission issue with `cargo vendor`. (rust-lang/cargo#9131)
- Add split-debuginfo profile option (rust-lang/cargo#9112)
- Add RegistryBuilder for tests, and update crates-io error handling. (rust-lang/cargo#9126)
- Add some documentation for index and registry stuff. (rust-lang/cargo#9125)
- Fix env/cfg set for `cargo test` and `cargo run`. (rust-lang/cargo#9122)
@ehuss ehuss added this to the 1.51.0 milestone Feb 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants