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