Skip to content

Commit 4a92ad1

Browse files
committed
test(package): Better characterize the -Zpackage-workspace behavior change
1 parent 68f0c65 commit 4a92ad1

File tree

1 file changed

+215
-1
lines changed

1 file changed

+215
-1
lines changed

tests/testsuite/package.rs

Lines changed: 215 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6950,6 +6950,56 @@ Caused by:
69506950
location searched: `alternative` index
69516951
required by package `main v0.0.1 ([ROOT]/foo/main)`
69526952
6953+
"#]])
6954+
.run();
6955+
6956+
p.cargo("package --exclude-lockfile")
6957+
.with_status(101)
6958+
.with_stderr_data(str![[r#"
6959+
[PACKAGING] dep v0.1.0 ([ROOT]/foo/dep)
6960+
[PACKAGED] 3 files, [FILE_SIZE]B ([FILE_SIZE]B compressed)
6961+
[PACKAGING] main v0.0.1 ([ROOT]/foo/main)
6962+
[PACKAGED] 3 files, [FILE_SIZE]B ([FILE_SIZE]B compressed)
6963+
[VERIFYING] dep v0.1.0 ([ROOT]/foo/dep)
6964+
[COMPILING] dep v0.1.0 ([ROOT]/foo/target/package/dep-0.1.0)
6965+
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
6966+
[VERIFYING] main v0.0.1 ([ROOT]/foo/main)
6967+
[UPDATING] `alternative` index
6968+
[ERROR] failed to verify package tarball
6969+
6970+
Caused by:
6971+
no matching package named `dep` found
6972+
location searched: `alternative` index
6973+
required by package `main v0.0.1 ([ROOT]/foo/target/package/main-0.0.1)`
6974+
6975+
"#]])
6976+
.run();
6977+
6978+
p.cargo("package --no-verify")
6979+
.with_status(101)
6980+
.with_stderr_data(str![[r#"
6981+
[PACKAGING] dep v0.1.0 ([ROOT]/foo/dep)
6982+
[PACKAGED] 4 files, [FILE_SIZE]B ([FILE_SIZE]B compressed)
6983+
[PACKAGING] main v0.0.1 ([ROOT]/foo/main)
6984+
[UPDATING] `alternative` index
6985+
[ERROR] failed to prepare local package for uploading
6986+
6987+
Caused by:
6988+
no matching package named `dep` found
6989+
location searched: `alternative` index
6990+
required by package `main v0.0.1 ([ROOT]/foo/main)`
6991+
6992+
"#]])
6993+
.run();
6994+
6995+
p.cargo("package --exclude-lockfile --no-verify")
6996+
.with_status(0)
6997+
.with_stderr_data(str![[r#"
6998+
[PACKAGING] dep v0.1.0 ([ROOT]/foo/dep)
6999+
[PACKAGED] 3 files, [FILE_SIZE]B ([FILE_SIZE]B compressed)
7000+
[PACKAGING] main v0.0.1 ([ROOT]/foo/main)
7001+
[PACKAGED] 3 files, [FILE_SIZE]B ([FILE_SIZE]B compressed)
7002+
69537003
"#]])
69547004
.run();
69557005
}
@@ -7011,6 +7061,33 @@ fn registry_not_inferred_because_of_conflict_nightly() {
70117061
.with_stderr_data(str![[r#"
70127062
[ERROR] conflicts between `package.publish` fields in the selected packages
70137063
7064+
"#]])
7065+
.run();
7066+
7067+
p.cargo("package --exclude-lockfile -Zpackage-workspace")
7068+
.masquerade_as_nightly_cargo(&["package-workspace"])
7069+
.with_status(101)
7070+
.with_stderr_data(str![[r#"
7071+
[ERROR] conflicts between `package.publish` fields in the selected packages
7072+
7073+
"#]])
7074+
.run();
7075+
7076+
p.cargo("package --no-verify -Zpackage-workspace")
7077+
.masquerade_as_nightly_cargo(&["package-workspace"])
7078+
.with_status(101)
7079+
.with_stderr_data(str![[r#"
7080+
[ERROR] conflicts between `package.publish` fields in the selected packages
7081+
7082+
"#]])
7083+
.run();
7084+
7085+
p.cargo("package --exclude-lockfile --no-verify -Zpackage-workspace")
7086+
.masquerade_as_nightly_cargo(&["package-workspace"])
7087+
.with_status(101)
7088+
.with_stderr_data(str![[r#"
7089+
[ERROR] conflicts between `package.publish` fields in the selected packages
7090+
70147091
"#]])
70157092
.run();
70167093

@@ -7193,7 +7270,29 @@ fn registry_not_inferred_because_of_multiple_options() {
71937270
.file("dep/src/lib.rs", "")
71947271
.build();
71957272

7196-
p.cargo("package")
7273+
p.cargo("package --exclude-lockfile")
7274+
.with_status(101)
7275+
.with_stderr_data(str![[r#"
7276+
[PACKAGING] dep v0.1.0 ([ROOT]/foo/dep)
7277+
[PACKAGED] 3 files, [FILE_SIZE]B ([FILE_SIZE]B compressed)
7278+
[PACKAGING] main v0.0.1 ([ROOT]/foo/main)
7279+
[PACKAGED] 3 files, [FILE_SIZE]B ([FILE_SIZE]B compressed)
7280+
[VERIFYING] dep v0.1.0 ([ROOT]/foo/dep)
7281+
[COMPILING] dep v0.1.0 ([ROOT]/foo/target/package/dep-0.1.0)
7282+
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
7283+
[VERIFYING] main v0.0.1 ([ROOT]/foo/main)
7284+
[UPDATING] `alternative` index
7285+
[ERROR] failed to verify package tarball
7286+
7287+
Caused by:
7288+
no matching package named `dep` found
7289+
location searched: `alternative` index
7290+
required by package `main v0.0.1 ([ROOT]/foo/target/package/main-0.0.1)`
7291+
7292+
"#]])
7293+
.run();
7294+
7295+
p.cargo("package --no-verify")
71977296
.with_status(101)
71987297
.with_stderr_data(str![[r#"
71997298
[PACKAGING] dep v0.1.0 ([ROOT]/foo/dep)
@@ -7207,6 +7306,17 @@ Caused by:
72077306
location searched: `alternative` index
72087307
required by package `main v0.0.1 ([ROOT]/foo/main)`
72097308
7309+
"#]])
7310+
.run();
7311+
7312+
p.cargo("package --exclude-lockfile --no-verify")
7313+
.with_status(0)
7314+
.with_stderr_data(str![[r#"
7315+
[PACKAGING] dep v0.1.0 ([ROOT]/foo/dep)
7316+
[PACKAGED] 3 files, [FILE_SIZE]B ([FILE_SIZE]B compressed)
7317+
[PACKAGING] main v0.0.1 ([ROOT]/foo/main)
7318+
[PACKAGED] 3 files, [FILE_SIZE]B ([FILE_SIZE]B compressed)
7319+
72107320
"#]])
72117321
.run();
72127322
}
@@ -7268,6 +7378,33 @@ fn registry_not_inferred_because_of_multiple_options_nightly() {
72687378
.with_stderr_data(str![[r#"
72697379
[ERROR] --registry is required to disambiguate between "alternative" or "alternative2" registries
72707380
7381+
"#]])
7382+
.run();
7383+
7384+
p.cargo("package --exclude-lockfile -Zpackage-workspace")
7385+
.masquerade_as_nightly_cargo(&["package-workspace"])
7386+
.with_status(101)
7387+
.with_stderr_data(str![[r#"
7388+
[ERROR] --registry is required to disambiguate between "alternative" or "alternative2" registries
7389+
7390+
"#]])
7391+
.run();
7392+
7393+
p.cargo("package --no-verify -Zpackage-workspace")
7394+
.masquerade_as_nightly_cargo(&["package-workspace"])
7395+
.with_status(101)
7396+
.with_stderr_data(str![[r#"
7397+
[ERROR] --registry is required to disambiguate between "alternative" or "alternative2" registries
7398+
7399+
"#]])
7400+
.run();
7401+
7402+
p.cargo("package --exclude-lockfile --no-verify -Zpackage-workspace")
7403+
.masquerade_as_nightly_cargo(&["package-workspace"])
7404+
.with_status(101)
7405+
.with_stderr_data(str![[r#"
7406+
[ERROR] --registry is required to disambiguate between "alternative" or "alternative2" registries
7407+
72717408
"#]])
72727409
.run();
72737410

@@ -7359,6 +7496,56 @@ Caused by:
73597496
location searched: `alternative` index
73607497
required by package `main v0.0.1 ([ROOT]/foo/main)`
73617498
7499+
"#]])
7500+
.run();
7501+
7502+
p.cargo("package --exclude-lockfile")
7503+
.with_status(101)
7504+
.with_stderr_data(str![[r#"
7505+
[PACKAGING] dep v0.1.0 ([ROOT]/foo/dep)
7506+
[PACKAGED] 3 files, [FILE_SIZE]B ([FILE_SIZE]B compressed)
7507+
[PACKAGING] main v0.0.1 ([ROOT]/foo/main)
7508+
[PACKAGED] 3 files, [FILE_SIZE]B ([FILE_SIZE]B compressed)
7509+
[VERIFYING] dep v0.1.0 ([ROOT]/foo/dep)
7510+
[COMPILING] dep v0.1.0 ([ROOT]/foo/target/package/dep-0.1.0)
7511+
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
7512+
[VERIFYING] main v0.0.1 ([ROOT]/foo/main)
7513+
[UPDATING] `alternative` index
7514+
[ERROR] failed to verify package tarball
7515+
7516+
Caused by:
7517+
no matching package named `dep` found
7518+
location searched: `alternative` index
7519+
required by package `main v0.0.1 ([ROOT]/foo/target/package/main-0.0.1)`
7520+
7521+
"#]])
7522+
.run();
7523+
7524+
p.cargo("package --no-verify")
7525+
.with_status(101)
7526+
.with_stderr_data(str![[r#"
7527+
[PACKAGING] dep v0.1.0 ([ROOT]/foo/dep)
7528+
[PACKAGED] 4 files, [FILE_SIZE]B ([FILE_SIZE]B compressed)
7529+
[PACKAGING] main v0.0.1 ([ROOT]/foo/main)
7530+
[UPDATING] `alternative` index
7531+
[ERROR] failed to prepare local package for uploading
7532+
7533+
Caused by:
7534+
no matching package named `dep` found
7535+
location searched: `alternative` index
7536+
required by package `main v0.0.1 ([ROOT]/foo/main)`
7537+
7538+
"#]])
7539+
.run();
7540+
7541+
p.cargo("package --exclude-lockfile --no-verify")
7542+
.with_status(0)
7543+
.with_stderr_data(str![[r#"
7544+
[PACKAGING] dep v0.1.0 ([ROOT]/foo/dep)
7545+
[PACKAGED] 3 files, [FILE_SIZE]B ([FILE_SIZE]B compressed)
7546+
[PACKAGING] main v0.0.1 ([ROOT]/foo/main)
7547+
[PACKAGED] 3 files, [FILE_SIZE]B ([FILE_SIZE]B compressed)
7548+
73627549
"#]])
73637550
.run();
73647551
}
@@ -7421,6 +7608,33 @@ fn registry_not_inferred_because_of_mismatch_nightly() {
74217608
.with_stderr_data(str![[r#"
74227609
[ERROR] --registry is required because not all `package.publish` settings agree
74237610
7611+
"#]])
7612+
.run();
7613+
7614+
p.cargo("package --exclude-lockfile -Zpackage-workspace")
7615+
.masquerade_as_nightly_cargo(&["package-workspace"])
7616+
.with_status(101)
7617+
.with_stderr_data(str![[r#"
7618+
[ERROR] --registry is required because not all `package.publish` settings agree
7619+
7620+
"#]])
7621+
.run();
7622+
7623+
p.cargo("package --no-verify -Zpackage-workspace")
7624+
.masquerade_as_nightly_cargo(&["package-workspace"])
7625+
.with_status(101)
7626+
.with_stderr_data(str![[r#"
7627+
[ERROR] --registry is required because not all `package.publish` settings agree
7628+
7629+
"#]])
7630+
.run();
7631+
7632+
p.cargo("package --exclude-lockfile --no-verify -Zpackage-workspace")
7633+
.masquerade_as_nightly_cargo(&["package-workspace"])
7634+
.with_status(101)
7635+
.with_stderr_data(str![[r#"
7636+
[ERROR] --registry is required because not all `package.publish` settings agree
7637+
74247638
"#]])
74257639
.run();
74267640

0 commit comments

Comments
 (0)