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