@@ -84,20 +84,6 @@ fn validate_upload_li() {
84
84
) ;
85
85
}
86
86
87
- fn validate_upload_foo_clean ( ) {
88
- publish:: validate_upload (
89
- CLEAN_FOO_JSON ,
90
- "foo-0.0.1.crate" ,
91
- & [
92
- "Cargo.lock" ,
93
- "Cargo.toml" ,
94
- "Cargo.toml.orig" ,
95
- "src/main.rs" ,
96
- ".cargo_vcs_info.json" ,
97
- ] ,
98
- ) ;
99
- }
100
-
101
87
#[ cargo_test]
102
88
fn simple ( ) {
103
89
// HACK below allows us to use a local registry
@@ -147,7 +133,8 @@ See [..]
147
133
// `[registry]` table.
148
134
#[ cargo_test]
149
135
fn old_token_location ( ) {
150
- let registry = registry:: init ( ) ;
136
+ // `publish` generally requires a remote registry
137
+ let registry = registry:: RegistryBuilder :: new ( ) . http_api ( ) . build ( ) ;
151
138
152
139
let p = project ( )
153
140
. file (
@@ -192,12 +179,14 @@ See [..]
192
179
)
193
180
. run ( ) ;
194
181
195
- validate_upload_foo ( ) ;
182
+ // Skip `validate_upload_foo` as we just cared we got far enough for verify the token behavior.
183
+ // Other tests will verify the endpoint gets the right payload.
196
184
}
197
185
198
186
#[ cargo_test]
199
187
fn simple_with_index ( ) {
200
- let registry = registry:: init ( ) ;
188
+ // `publish` generally requires a remote registry
189
+ let registry = registry:: RegistryBuilder :: new ( ) . http_api ( ) . build ( ) ;
201
190
202
191
let p = project ( )
203
192
. file (
@@ -229,7 +218,8 @@ fn simple_with_index() {
229
218
)
230
219
. run ( ) ;
231
220
232
- validate_upload_foo ( ) ;
221
+ // Skip `validate_upload_foo` as we just cared we got far enough for verify the VCS behavior.
222
+ // Other tests will verify the endpoint gets the right payload.
233
223
}
234
224
235
225
#[ cargo_test]
@@ -387,7 +377,8 @@ to proceed despite this and include the uncommitted changes, pass the `--allow-d
387
377
388
378
#[ cargo_test]
389
379
fn publish_clean ( ) {
390
- let registry = registry:: init ( ) ;
380
+ // `publish` generally requires a remote registry
381
+ let registry = registry:: RegistryBuilder :: new ( ) . http_api ( ) . build ( ) ;
391
382
392
383
let p = project ( ) . build ( ) ;
393
384
@@ -422,12 +413,14 @@ fn publish_clean() {
422
413
)
423
414
. run ( ) ;
424
415
425
- validate_upload_foo_clean ( ) ;
416
+ // Skip `validate_upload_foo_clean` as we just cared we got far enough for verify the VCS behavior.
417
+ // Other tests will verify the endpoint gets the right payload.
426
418
}
427
419
428
420
#[ cargo_test]
429
421
fn publish_in_sub_repo ( ) {
430
- let registry = registry:: init ( ) ;
422
+ // `publish` generally requires a remote registry
423
+ let registry = registry:: RegistryBuilder :: new ( ) . http_api ( ) . build ( ) ;
431
424
432
425
let p = project ( ) . no_manifest ( ) . file ( "baz" , "" ) . build ( ) ;
433
426
@@ -463,12 +456,14 @@ fn publish_in_sub_repo() {
463
456
)
464
457
. run ( ) ;
465
458
466
- validate_upload_foo_clean ( ) ;
459
+ // Skip `validate_upload_foo_clean` as we just cared we got far enough for verify the VCS behavior.
460
+ // Other tests will verify the endpoint gets the right payload.
467
461
}
468
462
469
463
#[ cargo_test]
470
464
fn publish_when_ignored ( ) {
471
- let registry = registry:: init ( ) ;
465
+ // `publish` generally requires a remote registry
466
+ let registry = registry:: RegistryBuilder :: new ( ) . http_api ( ) . build ( ) ;
472
467
473
468
let p = project ( ) . file ( "baz" , "" ) . build ( ) ;
474
469
@@ -504,23 +499,14 @@ fn publish_when_ignored() {
504
499
)
505
500
. run ( ) ;
506
501
507
- publish:: validate_upload (
508
- CLEAN_FOO_JSON ,
509
- "foo-0.0.1.crate" ,
510
- & [
511
- "Cargo.lock" ,
512
- "Cargo.toml" ,
513
- "Cargo.toml.orig" ,
514
- "src/main.rs" ,
515
- ".gitignore" ,
516
- ".cargo_vcs_info.json" ,
517
- ] ,
518
- ) ;
502
+ // Skip `validate_upload` as we just cared we got far enough for verify the VCS behavior.
503
+ // Other tests will verify the endpoint gets the right payload.
519
504
}
520
505
521
506
#[ cargo_test]
522
507
fn ignore_when_crate_ignored ( ) {
523
- let registry = registry:: init ( ) ;
508
+ // `publish` generally requires a remote registry
509
+ let registry = registry:: RegistryBuilder :: new ( ) . http_api ( ) . build ( ) ;
524
510
525
511
let p = project ( ) . no_manifest ( ) . file ( "bar/baz" , "" ) . build ( ) ;
526
512
@@ -555,17 +541,8 @@ fn ignore_when_crate_ignored() {
555
541
)
556
542
. run ( ) ;
557
543
558
- publish:: validate_upload (
559
- CLEAN_FOO_JSON ,
560
- "foo-0.0.1.crate" ,
561
- & [
562
- "Cargo.lock" ,
563
- "Cargo.toml" ,
564
- "Cargo.toml.orig" ,
565
- "src/main.rs" ,
566
- "baz" ,
567
- ] ,
568
- ) ;
544
+ // Skip `validate_upload` as we just cared we got far enough for verify the VCS behavior.
545
+ // Other tests will verify the endpoint gets the right payload.
569
546
}
570
547
571
548
#[ cargo_test]
@@ -894,7 +871,8 @@ The registry `alternative` is not listed in the `publish` value in Cargo.toml.
894
871
// Explicitly setting `crates-io` in the publish list.
895
872
#[ cargo_test]
896
873
fn publish_with_crates_io_explicit ( ) {
897
- let registry = registry:: init ( ) ;
874
+ // `publish` generally requires a remote registry
875
+ let registry = registry:: RegistryBuilder :: new ( ) . http_api ( ) . build ( ) ;
898
876
899
877
let p = project ( )
900
878
. file (
@@ -940,7 +918,8 @@ The registry `alternative` is not listed in the `publish` value in Cargo.toml.
940
918
941
919
#[ cargo_test]
942
920
fn publish_with_select_features ( ) {
943
- let registry = registry:: init ( ) ;
921
+ // `publish` generally requires a remote registry
922
+ let registry = registry:: RegistryBuilder :: new ( ) . http_api ( ) . build ( ) ;
944
923
945
924
let p = project ( )
946
925
. file (
@@ -985,7 +964,8 @@ fn publish_with_select_features() {
985
964
986
965
#[ cargo_test]
987
966
fn publish_with_all_features ( ) {
988
- let registry = registry:: init ( ) ;
967
+ // `publish` generally requires a remote registry
968
+ let registry = registry:: RegistryBuilder :: new ( ) . http_api ( ) . build ( ) ;
989
969
990
970
let p = project ( )
991
971
. file (
@@ -1514,7 +1494,8 @@ repository = "foo"
1514
1494
1515
1495
#[ cargo_test]
1516
1496
fn credentials_ambiguous_filename ( ) {
1517
- let registry = registry:: init ( ) ;
1497
+ // `publish` generally requires a remote registry
1498
+ let registry = registry:: RegistryBuilder :: new ( ) . http_api ( ) . build ( ) ;
1518
1499
1519
1500
let credentials_toml = paths:: home ( ) . join ( ".cargo/credentials.toml" ) ;
1520
1501
fs:: write ( credentials_toml, r#"token = "api-token""# ) . unwrap ( ) ;
@@ -1547,8 +1528,6 @@ fn credentials_ambiguous_filename() {
1547
1528
" ,
1548
1529
)
1549
1530
. run ( ) ;
1550
-
1551
- validate_upload_foo ( ) ;
1552
1531
}
1553
1532
1554
1533
// --index will not load registry.token to avoid possibly leaking
@@ -2104,7 +2083,8 @@ fn in_virtual_workspace() {
2104
2083
2105
2084
#[ cargo_test]
2106
2085
fn in_virtual_workspace_with_p ( ) {
2107
- let registry = registry:: init ( ) ;
2086
+ // `publish` generally requires a remote registry
2087
+ let registry = registry:: RegistryBuilder :: new ( ) . http_api ( ) . build ( ) ;
2108
2088
2109
2089
let p = project ( )
2110
2090
. file (
0 commit comments