-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Print URL on failure to upload. #8479
Conversation
When setting up a local copy of crates.io, I got error output like this: Uploading uploadtest v0.1.0 (/home/jsha/learnrust/uploadtest) error: [7] Couldn't connect to server I was pretty sure cargo was getting the wrong URL for my local registry, so I wanted to amend the error output to include the failed URL. Now the output looks like this: Uploading uploadtest v0.1.0 (/home/jsha/learnrust/uploadtest) error: publishing to http://localhost:8888//api/v1/crates/new: [7] Couldn't connect to server
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Eh2406 (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
This seems reasonable. I wonder why we don't have an existing test. @alexcrichton or @ehuss is there some reason this should not have a test or any advice on adding one? |
It should be pretty easy to make a test that has a dummy server that drops the connection. Let me know if you need help or guidance on how to set that up. I would also suggest using |
Thanks for the feedback on chain_err. I'll give that a try. My original version of this did use As for testing, yes I'd definitely love some guidance on setting that up. Not sure where to start. Thanks! |
Ah, I forgot this is The CONTRIBUTING document has some information on running tests. Cargo uses a library called I would stick the test in I would roughly structure it as:
|
Ping @jsha. Just checking if you have any questions on writing the test. |
Thanks for your patience! I've just now come back to this, and I'm running into trouble getting the tests to run, even on the master branch. Here's some environment info:
I believe I've followed the instructions at https://github.com/rust-lang/cargo/blob/master/CONTRIBUTING.md#running-tests, though it's possible I've made a mistake. When I run |
Hm, that's strange. I've only seen that if you execute cargo directly (like |
☔ The latest upstream changes (presumably #8950) made this pull request unmergeable. Please resolve the merge conflicts. Note that reviewers usually do not review pull requests until merge conflicts are resolved! Once you resolve the conflicts, you should change the labels applied by bors to indicate that your PR is ready for review. Post this as a comment to change the labels:
|
Ping @jsha: just wondering if you were able to figure out what issue you were having with the tests and if you had any questions on writing the new test. |
Hi @ehuss! Thanks for the ping. I'm afraid I have not had time to circle back and figure out what the issue with the tests was. I'm going to close this out for now but may try again later. |
When setting up a local copy of crates.io, I got error output like this:
Uploading uploadtest v0.1.0 (/home/jsha/learnrust/uploadtest)
error: [7] Couldn't connect to server
I was pretty sure cargo was getting the wrong URL for my local registry,
so I wanted to amend the error output to include the failed URL. Now the
output looks like this:
Uploading uploadtest v0.1.0 (/home/jsha/learnrust/uploadtest)
error: publishing to http://localhost:8888//api/v1/crates/new: [7] Couldn't connect to server