Skip to content

Commit

Permalink
Auto merge of #11388 - arlosi:fix-waiting-tests, r=epage
Browse files Browse the repository at this point in the history
Fix several tests that are waiting 60 seconds for publishing to time out

Several tests are missing the pre-publishing hack to avoid the 60 second wait-for-publish timeout.

r? `@epage`
  • Loading branch information
bors committed Nov 17, 2022
2 parents 4d5c036 + 7cd6137 commit eb5d359
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/testsuite/cargo_features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,14 @@ fn publish_allowed() {
)
.file("src/lib.rs", "")
.build();

// HACK: Inject `a` directly into the index so `publish` won't block for it to be in
// the index.
//
// This is to ensure we can verify the Summary we post to the registry as doing so precludes
// the registry from processing the publish.
Package::new("a", "0.0.1").file("src/lib.rs", "").publish();

p.cargo("publish")
.replace_crates_io(registry.index_url())
.masquerade_as_nightly_cargo(&["test-dummy-unstable"])
Expand Down
48 changes: 48 additions & 0 deletions tests/testsuite/inheritable_workspace_fields.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,15 @@ fn inherit_own_workspace_fields() {
.file("bar.txt", "") // should be included when packaging
.build();

// HACK: Inject `foo` directly into the index so `publish` won't block for it to be in
// the index.
//
// This is to ensure we can verify the Summary we post to the registry as doing so precludes
// the registry from processing the publish.
Package::new("foo", "1.2.3")
.file("src/lib.rs", "")
.publish();

p.cargo("publish")
.replace_crates_io(registry.index_url())
.run();
Expand Down Expand Up @@ -287,6 +296,16 @@ fn inherit_own_dependencies() {
assert!(lockfile.contains("dep"));
assert!(lockfile.contains("dep-dev"));
assert!(lockfile.contains("dep-build"));

// HACK: Inject `bar` directly into the index so `publish` won't block for it to be in
// the index.
//
// This is to ensure we can verify the Summary we post to the registry as doing so precludes
// the registry from processing the publish.
Package::new("bar", "0.2.0")
.file("src/lib.rs", "")
.publish();

p.cargo("publish")
.replace_crates_io(registry.index_url())
.run();
Expand Down Expand Up @@ -411,6 +430,16 @@ fn inherit_own_detailed_dependencies() {
p.cargo("check").run();
let lockfile = p.read_lockfile();
assert!(lockfile.contains("dep"));

// HACK: Inject `bar` directly into the index so `publish` won't block for it to be in
// the index.
//
// This is to ensure we can verify the Summary we post to the registry as doing so precludes
// the registry from processing the publish.
Package::new("bar", "0.2.0")
.file("src/lib.rs", "")
.publish();

p.cargo("publish")
.replace_crates_io(registry.index_url())
.run();
Expand Down Expand Up @@ -628,6 +657,15 @@ fn inherit_workspace_fields() {
.file("bar/bar.txt", "") // should be included when packaging
.build();

// HACK: Inject `bar` directly into the index so `publish` won't block for it to be in
// the index.
//
// This is to ensure we can verify the Summary we post to the registry as doing so precludes
// the registry from processing the publish.
Package::new("bar", "1.2.3")
.file("src/lib.rs", "")
.publish();

p.cargo("publish")
.replace_crates_io(registry.index_url())
.cwd("bar")
Expand Down Expand Up @@ -763,6 +801,16 @@ fn inherit_dependencies() {
assert!(lockfile.contains("dep"));
assert!(lockfile.contains("dep-dev"));
assert!(lockfile.contains("dep-build"));

// HACK: Inject `bar` directly into the index so `publish` won't block for it to be in
// the index.
//
// This is to ensure we can verify the Summary we post to the registry as doing so precludes
// the registry from processing the publish.
Package::new("bar", "0.2.0")
.file("src/lib.rs", "")
.publish();

p.cargo("publish")
.replace_crates_io(registry.index_url())
.cwd("bar")
Expand Down

0 comments on commit eb5d359

Please sign in to comment.