-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Make some blocking tests non-blocking #11650
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
Changes from all commits
04d592c
a8233d4
0b06a45
5751e17
fbe7ac2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -287,7 +287,12 @@ fn cannot_publish_to_crates_io_with_registry_dependency() { | |
|
||
#[cargo_test] | ||
fn publish_with_registry_dependency() { | ||
registry::alt_init(); | ||
let _reg = RegistryBuilder::new() | ||
.http_api() | ||
.http_index() | ||
.alternative() | ||
.build(); | ||
|
||
let p = project() | ||
.file( | ||
"Cargo.toml", | ||
|
@@ -307,10 +312,26 @@ fn publish_with_registry_dependency() { | |
|
||
Package::new("bar", "0.0.1").alternative(true).publish(); | ||
|
||
// Login so that we have the token available | ||
p.cargo("login --registry alternative TOKEN").run(); | ||
|
||
p.cargo("publish --registry alternative").run(); | ||
p.cargo("publish --registry alternative") | ||
.with_stderr( | ||
"\ | ||
[UPDATING] `alternative` index | ||
[WARNING] [..] | ||
[..] | ||
[PACKAGING] foo v0.0.1 [..] | ||
[UPDATING] `alternative` index | ||
[VERIFYING] foo v0.0.1 [..] | ||
[DOWNLOADING] [..] | ||
[DOWNLOADED] bar v0.0.1 (registry `alternative`) | ||
[COMPILING] bar v0.0.1 (registry `alternative`) | ||
[COMPILING] foo v0.0.1 [..] | ||
[FINISHED] [..] | ||
[PACKAGED] [..] | ||
[UPLOADING] foo v0.0.1 [..] | ||
[UPDATING] `alternative` index | ||
", | ||
) | ||
.run(); | ||
|
||
validate_alt_upload( | ||
r#"{ | ||
|
@@ -415,48 +436,43 @@ or use environment variable CARGO_REGISTRIES_ALTERNATIVE_TOKEN", | |
|
||
#[cargo_test] | ||
fn publish_to_alt_registry() { | ||
registry::alt_init(); | ||
let p = project().file("src/main.rs", "fn main() {}").build(); | ||
|
||
// Setup the registry by publishing a package | ||
Package::new("bar", "0.0.1").alternative(true).publish(); | ||
let _reg = RegistryBuilder::new() | ||
.http_api() | ||
.http_index() | ||
.alternative() | ||
.build(); | ||
|
||
// Login so that we have the token available | ||
p.cargo("login --registry alternative TOKEN").run(); | ||
let p = project().file("src/main.rs", "fn main() {}").build(); | ||
|
||
// Now perform the actual publish | ||
p.cargo("publish --registry alternative").run(); | ||
|
||
validate_alt_upload( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you say why this validation was removed? I would not expect it to be removed. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sigh I was specifically looking for any still removed and missed this. Thanks for spotting it! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @hi-rustin Can you post a PR to return the |
||
r#"{ | ||
"authors": [], | ||
"badges": {}, | ||
"categories": [], | ||
"deps": [], | ||
"description": null, | ||
"documentation": null, | ||
"features": {}, | ||
"homepage": null, | ||
"keywords": [], | ||
"license": null, | ||
"license_file": null, | ||
"links": null, | ||
"name": "foo", | ||
"readme": null, | ||
"readme_file": null, | ||
"repository": null, | ||
"homepage": null, | ||
"documentation": null, | ||
"vers": "0.0.1" | ||
}"#, | ||
"foo-0.0.1.crate", | ||
&["Cargo.lock", "Cargo.toml", "Cargo.toml.orig", "src/main.rs"], | ||
); | ||
p.cargo("publish --registry alternative") | ||
.with_stderr( | ||
"\ | ||
[UPDATING] `alternative` index | ||
[WARNING] [..] | ||
[..] | ||
[PACKAGING] foo v0.0.1 [..] | ||
[VERIFYING] foo v0.0.1 [..] | ||
[COMPILING] foo v0.0.1 [..] | ||
[FINISHED] [..] | ||
[PACKAGED] [..] | ||
[UPLOADING] foo v0.0.1 [..] | ||
[UPDATING] `alternative` index | ||
", | ||
) | ||
.run(); | ||
} | ||
|
||
#[cargo_test] | ||
fn publish_with_crates_io_dep() { | ||
registry::alt_init(); | ||
// crates.io registry. | ||
let _dummy_reg = registry::init(); | ||
// Alternative registry. | ||
let _alt_reg = RegistryBuilder::new() | ||
.http_api() | ||
.http_index() | ||
.alternative() | ||
.build(); | ||
let p = project() | ||
.file( | ||
"Cargo.toml", | ||
|
@@ -477,10 +493,26 @@ fn publish_with_crates_io_dep() { | |
|
||
Package::new("bar", "0.0.1").publish(); | ||
|
||
// Login so that we have the token available | ||
p.cargo("login --registry alternative TOKEN").run(); | ||
|
||
p.cargo("publish --registry alternative").run(); | ||
p.cargo("publish --registry alternative") | ||
.with_stderr( | ||
"\ | ||
[UPDATING] `alternative` index | ||
[WARNING] [..] | ||
[..] | ||
[PACKAGING] foo v0.0.1 [..] | ||
[UPDATING] `dummy-registry` index | ||
[VERIFYING] foo v0.0.1 [..] | ||
[DOWNLOADING] [..] | ||
[DOWNLOADED] bar v0.0.1 (registry `dummy-registry`) | ||
[COMPILING] bar v0.0.1 | ||
[COMPILING] foo v0.0.1 [..] | ||
[FINISHED] [..] | ||
[PACKAGED] [..] | ||
[UPLOADING] foo v0.0.1 [..] | ||
[UPDATING] `alternative` index | ||
", | ||
) | ||
.run(); | ||
|
||
validate_alt_upload( | ||
r#"{ | ||
|
Uh oh!
There was an error while loading. Please reload this page.