Skip to content

Commit 5e5b532

Browse files
committed
refactor(tests): Be more explicit about publish stderr
This will help find tests timing out due to #11062
1 parent 5e1a647 commit 5e5b532

File tree

1 file changed

+43
-4
lines changed

1 file changed

+43
-4
lines changed

tests/testsuite/publish.rs

Lines changed: 43 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,18 @@ fn publish_with_select_features() {
853853

854854
p.cargo("publish --features required")
855855
.replace_crates_io(registry.index_url())
856-
.with_stderr_contains("[UPLOADING] foo v0.0.1 ([CWD])")
856+
.with_stderr(
857+
"\
858+
[..]
859+
[..]
860+
[..]
861+
[..]
862+
[VERIFYING] foo v0.0.1 ([CWD])
863+
[..]
864+
[..]
865+
[UPLOADING] foo v0.0.1 ([CWD])
866+
",
867+
)
857868
.run();
858869
}
859870

@@ -887,7 +898,18 @@ fn publish_with_all_features() {
887898

888899
p.cargo("publish --all-features")
889900
.replace_crates_io(registry.index_url())
890-
.with_stderr_contains("[UPLOADING] foo v0.0.1 ([CWD])")
901+
.with_stderr(
902+
"\
903+
[..]
904+
[..]
905+
[..]
906+
[..]
907+
[VERIFYING] foo v0.0.1 ([CWD])
908+
[..]
909+
[..]
910+
[UPLOADING] foo v0.0.1 ([CWD])
911+
",
912+
)
891913
.run();
892914
}
893915

@@ -1047,7 +1069,19 @@ fn publish_checks_for_token_before_verify() {
10471069
// Assert package verified successfully on dry run
10481070
p.cargo("publish --dry-run")
10491071
.replace_crates_io(registry.index_url())
1050-
.with_stderr_contains("[VERIFYING] foo v0.0.1 ([CWD])")
1072+
.with_stderr(
1073+
"\
1074+
[..]
1075+
[..]
1076+
[..]
1077+
[..]
1078+
[VERIFYING] foo v0.0.1 ([CWD])
1079+
[..]
1080+
[..]
1081+
[UPLOADING] foo v0.0.1 [..]
1082+
[WARNING] aborting upload due to dry run
1083+
",
1084+
)
10511085
.run();
10521086
}
10531087

@@ -1334,9 +1368,14 @@ fn credentials_ambiguous_filename() {
13341368

13351369
p.cargo("publish --no-verify")
13361370
.replace_crates_io(registry.index_url())
1337-
.with_stderr_contains(
1371+
.with_stderr(
13381372
"\
13391373
[WARNING] Both `[..]/credentials` and `[..]/credentials.toml` exist. Using `[..]/credentials`
1374+
[..]
1375+
[..]
1376+
[..]
1377+
[..]
1378+
[UPLOADING] foo v0.0.1 [..]
13401379
",
13411380
)
13421381
.run();

0 commit comments

Comments
 (0)