@@ -101,6 +101,7 @@ fn validate_upload_foo_clean() {
101
101
102
102
#[ cargo_test]
103
103
fn simple ( ) {
104
+ // HACK below allows us to use a local registry
104
105
let registry = registry:: init ( ) ;
105
106
106
107
let p = project ( )
@@ -118,6 +119,15 @@ fn simple() {
118
119
. file ( "src/main.rs" , "fn main() {}" )
119
120
. build ( ) ;
120
121
122
+ // HACK: Inject `foo` directly into the index so `publish` won't block for it to be in
123
+ // the index.
124
+ //
125
+ // This is to ensure we can verify the Summary we post to the registry as doing so precludes
126
+ // the registry from processing the publish.
127
+ Package :: new ( "foo" , "0.0.1" )
128
+ . file ( "src/lib.rs" , "" )
129
+ . publish ( ) ;
130
+
121
131
p. cargo ( "publish --no-verify" )
122
132
. replace_crates_io ( registry. index_url ( ) )
123
133
. with_stderr (
@@ -698,6 +708,7 @@ The registry `alternative` is not listed in the `publish` value in Cargo.toml.
698
708
699
709
#[ cargo_test]
700
710
fn publish_allowed_registry ( ) {
711
+ // HACK below allows us to use a local registry
701
712
registry:: alt_init ( ) ;
702
713
703
714
let p = project ( ) . build ( ) ;
@@ -721,6 +732,16 @@ fn publish_allowed_registry() {
721
732
. file ( "src/main.rs" , "fn main() {}" )
722
733
. build ( ) ;
723
734
735
+ // HACK: Inject `foo` directly into the index so `publish` won't block for it to be in
736
+ // the index.
737
+ //
738
+ // This is to ensure we can verify the Summary we post to the registry as doing so precludes
739
+ // the registry from processing the publish.
740
+ Package :: new ( "foo" , "0.0.1" )
741
+ . file ( "src/lib.rs" , "" )
742
+ . alternative ( true )
743
+ . publish ( ) ;
744
+
724
745
p. cargo ( "publish --registry alternative" )
725
746
. with_stderr (
726
747
"\
@@ -748,6 +769,7 @@ fn publish_allowed_registry() {
748
769
749
770
#[ cargo_test]
750
771
fn publish_implicitly_to_only_allowed_registry ( ) {
772
+ // HACK below allows us to use a local registry
751
773
registry:: alt_init ( ) ;
752
774
753
775
let p = project ( ) . build ( ) ;
@@ -771,6 +793,16 @@ fn publish_implicitly_to_only_allowed_registry() {
771
793
. file ( "src/main.rs" , "fn main() {}" )
772
794
. build ( ) ;
773
795
796
+ // HACK: Inject `foo` directly into the index so `publish` won't block for it to be in
797
+ // the index.
798
+ //
799
+ // This is to ensure we can verify the Summary we post to the registry as doing so precludes
800
+ // the registry from processing the publish.
801
+ Package :: new ( "foo" , "0.0.1" )
802
+ . file ( "src/lib.rs" , "" )
803
+ . alternative ( true )
804
+ . publish ( ) ;
805
+
774
806
p. cargo ( "publish" )
775
807
. with_stderr (
776
808
"\
@@ -1035,6 +1067,7 @@ fn publish_with_no_default_features() {
1035
1067
1036
1068
#[ cargo_test]
1037
1069
fn publish_with_patch ( ) {
1070
+ // HACK below allows us to use a local registry
1038
1071
let registry = registry:: init ( ) ;
1039
1072
Package :: new ( "bar" , "1.0.0" ) . publish ( ) ;
1040
1073
@@ -1078,6 +1111,15 @@ fn publish_with_patch() {
1078
1111
// Remove the usage of new functionality and try again.
1079
1112
p. change_file ( "src/main.rs" , "extern crate bar; pub fn main() {}" ) ;
1080
1113
1114
+ // HACK: Inject `foo` directly into the index so `publish` won't block for it to be in
1115
+ // the index.
1116
+ //
1117
+ // This is to ensure we can verify the Summary we post to the registry as doing so precludes
1118
+ // the registry from processing the publish.
1119
+ Package :: new ( "foo" , "0.0.1" )
1120
+ . file ( "src/lib.rs" , "" )
1121
+ . publish ( ) ;
1122
+
1081
1123
p. cargo ( "publish" )
1082
1124
. replace_crates_io ( registry. index_url ( ) )
1083
1125
. with_stderr (
@@ -1233,7 +1275,9 @@ include `--registry crates-io` to use crates.io
1233
1275
// A dependency with both `git` and `version`.
1234
1276
#[ cargo_test]
1235
1277
fn publish_git_with_version ( ) {
1278
+ // HACK below allows us to use a local registry
1236
1279
let registry = registry:: init ( ) ;
1280
+
1237
1281
Package :: new ( "dep1" , "1.0.1" )
1238
1282
. file ( "src/lib.rs" , "pub fn f() -> i32 {1}" )
1239
1283
. publish ( ) ;
@@ -1274,6 +1318,16 @@ fn publish_git_with_version() {
1274
1318
. build ( ) ;
1275
1319
1276
1320
p. cargo ( "run" ) . with_stdout ( "2" ) . run ( ) ;
1321
+
1322
+ // HACK: Inject `foo` directly into the index so `publish` won't block for it to be in
1323
+ // the index.
1324
+ //
1325
+ // This is to ensure we can verify the Summary we post to the registry as doing so precludes
1326
+ // the registry from processing the publish.
1327
+ Package :: new ( "foo" , "0.1.0" )
1328
+ . file ( "src/lib.rs" , "" )
1329
+ . publish ( ) ;
1330
+
1277
1331
p. cargo ( "publish --no-verify" )
1278
1332
. replace_crates_io ( registry. index_url ( ) )
1279
1333
. with_stderr (
@@ -1367,6 +1421,7 @@ fn publish_git_with_version() {
1367
1421
1368
1422
#[ cargo_test]
1369
1423
fn publish_dev_dep_no_version ( ) {
1424
+ // HACK below allows us to use a local registry
1370
1425
let registry = registry:: init ( ) ;
1371
1426
1372
1427
let p = project ( )
@@ -1392,6 +1447,15 @@ fn publish_dev_dep_no_version() {
1392
1447
. file ( "bar/src/lib.rs" , "" )
1393
1448
. build ( ) ;
1394
1449
1450
+ // HACK: Inject `foo` directly into the index so `publish` won't block for it to be in
1451
+ // the index.
1452
+ //
1453
+ // This is to ensure we can verify the Summary we post to the registry as doing so precludes
1454
+ // the registry from processing the publish.
1455
+ Package :: new ( "foo" , "0.1.0" )
1456
+ . file ( "src/lib.rs" , "" )
1457
+ . publish ( ) ;
1458
+
1395
1459
p. cargo ( "publish --no-verify" )
1396
1460
. replace_crates_io ( registry. index_url ( ) )
1397
1461
. with_stderr (
@@ -1846,6 +1910,7 @@ Caused by:
1846
1910
1847
1911
#[ cargo_test]
1848
1912
fn in_package_workspace ( ) {
1913
+ // HACK below allows us to use a local registry
1849
1914
let registry = registry:: init ( ) ;
1850
1915
1851
1916
let p = project ( )
@@ -1874,6 +1939,13 @@ fn in_package_workspace() {
1874
1939
. file ( "li/src/main.rs" , "fn main() {}" )
1875
1940
. build ( ) ;
1876
1941
1942
+ // HACK: Inject `foo` directly into the index so `publish` won't block for it to be in
1943
+ // the index.
1944
+ //
1945
+ // This is to ensure we can verify the Summary we post to the registry as doing so precludes
1946
+ // the registry from processing the publish.
1947
+ Package :: new ( "li" , "0.0.1" ) . file ( "src/lib.rs" , "" ) . publish ( ) ;
1948
+
1877
1949
p. cargo ( "publish -p li --no-verify" )
1878
1950
. replace_crates_io ( registry. index_url ( ) )
1879
1951
. with_stderr (
@@ -1944,6 +2016,7 @@ fn with_duplicate_spec_in_members() {
1944
2016
1945
2017
#[ cargo_test]
1946
2018
fn in_package_workspace_with_members_with_features_old ( ) {
2019
+ // HACK below allows us to use a local registry
1947
2020
let registry = registry:: init ( ) ;
1948
2021
1949
2022
let p = project ( )
@@ -1971,6 +2044,13 @@ fn in_package_workspace_with_members_with_features_old() {
1971
2044
. file ( "li/src/main.rs" , "fn main() {}" )
1972
2045
. build ( ) ;
1973
2046
2047
+ // HACK: Inject `foo` directly into the index so `publish` won't block for it to be in
2048
+ // the index.
2049
+ //
2050
+ // This is to ensure we can verify the Summary we post to the registry as doing so precludes
2051
+ // the registry from processing the publish.
2052
+ Package :: new ( "li" , "0.0.1" ) . file ( "src/lib.rs" , "" ) . publish ( ) ;
2053
+
1974
2054
p. cargo ( "publish -p li --no-verify" )
1975
2055
. replace_crates_io ( registry. index_url ( ) )
1976
2056
. with_stderr (
0 commit comments