Description: Disable network tests Author: Ximin Luo Forwarded: TODO --- This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ Index: rust/src/tools/cargo/tests/testsuite/git_auth.rs =================================================================== --- rust.orig/src/tools/cargo/tests/testsuite/git_auth.rs +++ rust/src/tools/cargo/tests/testsuite/git_auth.rs @@ -103,7 +103,7 @@ fn setup_failed_auth_test() -> (SocketAd } // Tests that HTTP auth is offered from `credential.helper`. -#[cargo_test] +#[allow(dead_code)] fn http_auth_offered() { // TODO(Seb): remove this once possible. if cargo_uses_gitoxide() { @@ -172,7 +172,7 @@ Caused by: } // Boy, sure would be nice to have a TLS implementation in rust! -#[cargo_test] +#[allow(dead_code)] fn https_something_happens() { let server = TcpListener::bind("127.0.0.1:0").unwrap(); let addr = server.local_addr().unwrap(); Index: rust/src/tools/cargo/tests/testsuite/net_config.rs =================================================================== --- rust.orig/src/tools/cargo/tests/testsuite/net_config.rs +++ rust/src/tools/cargo/tests/testsuite/net_config.rs @@ -2,7 +2,7 @@ use cargo_test_support::project; -#[cargo_test] +#[allow(dead_code)] fn net_retry_loads_from_config() { let p = project() .file( @@ -38,7 +38,7 @@ fn net_retry_loads_from_config() { .run(); } -#[cargo_test] +#[allow(dead_code)] fn net_retry_git_outputs_warning() { let p = project() .file( Index: rust/src/tools/cargo/tests/testsuite/publish.rs =================================================================== --- rust.orig/src/tools/cargo/tests/testsuite/publish.rs +++ rust/src/tools/cargo/tests/testsuite/publish.rs @@ -88,7 +88,7 @@ fn validate_upload_li() { ); } -#[cargo_test] +#[allow(dead_code)] fn simple() { let registry = RegistryBuilder::new().http_api().http_index().build(); @@ -130,7 +130,7 @@ You may press ctrl-c to skip waiting; th // Check that the `token` key works at the root instead of under a // `[registry]` table. -#[cargo_test] +#[allow(dead_code)] fn simple_publish_with_http() { let _reg = registry::RegistryBuilder::new() .http_api() @@ -170,7 +170,7 @@ You may press ctrl-c to skip waiting; th .run(); } -#[cargo_test] +#[allow(dead_code)] fn simple_publish_with_asymmetric() { let _reg = registry::RegistryBuilder::new() .http_api() @@ -213,7 +213,7 @@ You may press ctrl-c to skip waiting; th .run(); } -#[cargo_test] +#[allow(dead_code)] fn old_token_location() { // `publish` generally requires a remote registry let registry = registry::RegistryBuilder::new().http_api().build(); @@ -270,7 +270,7 @@ You may press ctrl-c [..] // Other tests will verify the endpoint gets the right payload. } -#[cargo_test] +#[allow(dead_code)] fn simple_with_index() { // `publish` generally requires a remote registry let registry = registry::RegistryBuilder::new().http_api().build(); @@ -315,7 +315,7 @@ You may press ctrl-c [..] // Other tests will verify the endpoint gets the right payload. } -#[cargo_test] +#[allow(dead_code)] fn git_deps() { // Use local registry for faster test times since no publish will occur let registry = registry::init(); @@ -353,7 +353,7 @@ the `git` specification will be removed .run(); } -#[cargo_test] +#[allow(dead_code)] fn path_dependency_no_version() { // Use local registry for faster test times since no publish will occur let registry = registry::init(); @@ -393,7 +393,7 @@ the `path` specification will be removed .run(); } -#[cargo_test] +#[allow(dead_code)] fn unpublishable_crate() { // Use local registry for faster test times since no publish will occur let registry = registry::init(); @@ -426,7 +426,7 @@ fn unpublishable_crate() { .run(); } -#[cargo_test] +#[allow(dead_code)] fn dont_publish_dirty() { // Use local registry for faster test times since no publish will occur let registry = registry::init(); @@ -468,7 +468,7 @@ to proceed despite this and include the .run(); } -#[cargo_test] +#[allow(dead_code)] fn publish_clean() { // `publish` generally requires a remote registry let registry = registry::RegistryBuilder::new().http_api().build(); @@ -516,7 +516,7 @@ You may press ctrl-c to skip waiting; th // Other tests will verify the endpoint gets the right payload. } -#[cargo_test] +#[allow(dead_code)] fn publish_in_sub_repo() { // `publish` generally requires a remote registry let registry = registry::RegistryBuilder::new().http_api().build(); @@ -565,7 +565,7 @@ You may press ctrl-c [..] // Other tests will verify the endpoint gets the right payload. } -#[cargo_test] +#[allow(dead_code)] fn publish_when_ignored() { // `publish` generally requires a remote registry let registry = registry::RegistryBuilder::new().http_api().build(); @@ -614,7 +614,7 @@ You may press ctrl-c [..] // Other tests will verify the endpoint gets the right payload. } -#[cargo_test] +#[allow(dead_code)] fn ignore_when_crate_ignored() { // `publish` generally requires a remote registry let registry = registry::RegistryBuilder::new().http_api().build(); @@ -662,7 +662,7 @@ You may press ctrl-c [..] // Other tests will verify the endpoint gets the right payload. } -#[cargo_test] +#[allow(dead_code)] fn new_crate_rejected() { // Use local registry for faster test times since no publish will occur let registry = registry::init(); @@ -695,7 +695,7 @@ fn new_crate_rejected() { .run(); } -#[cargo_test] +#[allow(dead_code)] fn dry_run() { // Use local registry for faster test times since no publish will occur let registry = registry::init(); @@ -738,7 +738,7 @@ See [..] assert!(!registry::api_path().join("api/v1/crates/new").exists()); } -#[cargo_test] +#[allow(dead_code)] fn registry_not_in_publish_list() { let p = project() .file( @@ -771,7 +771,7 @@ The registry `alternative` is not listed .run(); } -#[cargo_test] +#[allow(dead_code)] fn publish_empty_list() { let p = project() .file( @@ -800,7 +800,7 @@ fn publish_empty_list() { .run(); } -#[cargo_test] +#[allow(dead_code)] fn publish_allowed_registry() { let _registry = RegistryBuilder::new() .http_api() @@ -860,7 +860,7 @@ You may press ctrl-c [..] ); } -#[cargo_test] +#[allow(dead_code)] fn publish_implicitly_to_only_allowed_registry() { let _registry = RegistryBuilder::new() .http_api() @@ -963,7 +963,7 @@ fn publish_failed_with_index_and_only_al .run(); } -#[cargo_test] +#[allow(dead_code)] fn publish_fail_with_no_registry_specified() { let p = project().build(); @@ -997,7 +997,7 @@ The registry `crates-io` is not listed i .run(); } -#[cargo_test] +#[allow(dead_code)] fn block_publish_no_registry() { let p = project() .file( @@ -1027,7 +1027,7 @@ fn block_publish_no_registry() { } // Explicitly setting `crates-io` in the publish list. -#[cargo_test] +#[allow(dead_code)] fn publish_with_crates_io_explicit() { // `publish` generally requires a remote registry let registry = registry::RegistryBuilder::new().http_api().build(); @@ -1080,7 +1080,7 @@ You may press ctrl-c [..] .run(); } -#[cargo_test] +#[allow(dead_code)] fn publish_with_select_features() { // `publish` generally requires a remote registry let registry = registry::RegistryBuilder::new().http_api().build(); @@ -1131,7 +1131,7 @@ You may press ctrl-c [..] .run(); } -#[cargo_test] +#[allow(dead_code)] fn publish_with_all_features() { // `publish` generally requires a remote registry let registry = registry::RegistryBuilder::new().http_api().build(); @@ -1182,7 +1182,7 @@ You may press ctrl-c [..] .run(); } -#[cargo_test] +#[allow(dead_code)] fn publish_with_no_default_features() { // Use local registry for faster test times since no publish will occur let registry = registry::init(); @@ -1218,7 +1218,7 @@ fn publish_with_no_default_features() { .run(); } -#[cargo_test] +#[allow(dead_code)] fn publish_with_patch() { let registry = RegistryBuilder::new().http_api().http_index().build(); Package::new("bar", "1.0.0").publish(); @@ -1324,7 +1324,7 @@ You may press ctrl-c [..] ); } -#[cargo_test] +#[allow(dead_code)] fn publish_checks_for_token_before_verify() { let registry = registry::RegistryBuilder::new() .no_configure_token() @@ -1373,7 +1373,7 @@ fn publish_checks_for_token_before_verif .run(); } -#[cargo_test] +#[allow(dead_code)] fn publish_with_bad_source() { let p = project() .file( @@ -1422,7 +1422,7 @@ include `--registry crates-io` to use cr } // A dependency with both `git` and `version`. -#[cargo_test] +#[allow(dead_code)] fn publish_git_with_version() { let registry = RegistryBuilder::new().http_api().http_index().build(); @@ -1566,7 +1566,7 @@ You may press ctrl-c [..] ); } -#[cargo_test] +#[allow(dead_code)] fn publish_dev_dep_no_version() { let registry = RegistryBuilder::new().http_api().http_index().build(); @@ -1656,7 +1656,7 @@ repository = "foo" ); } -#[cargo_test] +#[allow(dead_code)] fn credentials_ambiguous_filename() { // `publish` generally requires a remote registry let registry = registry::RegistryBuilder::new().http_api().build(); @@ -1712,7 +1712,7 @@ You may press ctrl-c [..] // --index will not load registry.token to avoid possibly leaking // crates.io token to another server. -#[cargo_test] +#[allow(dead_code)] fn index_requires_token() { // Use local registry for faster test times since no publish will occur let registry = registry::init(); @@ -1747,7 +1747,7 @@ fn index_requires_token() { } // publish with source replacement without --registry -#[cargo_test] +#[allow(dead_code)] fn cratesio_source_replacement() { registry::init(); let p = project() @@ -1776,7 +1776,7 @@ include `--registry dummy-registry` or ` .run(); } -#[cargo_test] +#[allow(dead_code)] fn publish_with_missing_readme() { // Use local registry for faster test times since no publish will occur let registry = registry::init(); @@ -1824,7 +1824,7 @@ Caused by: } // Registry returns an API error. -#[cargo_test] +#[allow(dead_code)] fn api_error_json() { let _registry = registry::RegistryBuilder::new() .alternative() @@ -1872,7 +1872,7 @@ Caused by: } // Registry returns an API error with a 200 status code. -#[cargo_test] +#[allow(dead_code)] fn api_error_200() { let _registry = registry::RegistryBuilder::new() .alternative() @@ -1920,7 +1920,7 @@ Caused by: } // Registry returns an error code without a JSON message. -#[cargo_test] +#[allow(dead_code)] fn api_error_code() { let _registry = registry::RegistryBuilder::new() .alternative() @@ -1975,7 +1975,7 @@ Caused by: } // Registry has a network error. -#[cargo_test] +#[allow(dead_code)] fn api_curl_error() { let _registry = registry::RegistryBuilder::new() .alternative() @@ -2025,7 +2025,7 @@ Caused by: } // Registry returns an invalid response. -#[cargo_test] +#[allow(dead_code)] fn api_other_error() { let _registry = registry::RegistryBuilder::new() .alternative() @@ -2075,7 +2075,7 @@ Caused by: .run(); } -#[cargo_test] +#[allow(dead_code)] fn in_package_workspace() { let registry = RegistryBuilder::new().http_api().http_index().build(); @@ -2127,7 +2127,7 @@ You may press ctrl-c [..] validate_upload_li(); } -#[cargo_test] +#[allow(dead_code)] fn with_duplicate_spec_in_members() { // Use local registry for faster test times since no publish will occur let registry = registry::init(); @@ -2179,7 +2179,7 @@ fn with_duplicate_spec_in_members() { .run(); } -#[cargo_test] +#[allow(dead_code)] fn in_package_workspace_with_members_with_features_old() { let registry = RegistryBuilder::new().http_api().http_index().build(); @@ -2230,7 +2230,7 @@ You may press ctrl-c [..] validate_upload_li(); } -#[cargo_test] +#[allow(dead_code)] fn in_virtual_workspace() { // Use local registry for faster test times since no publish will occur let registry = registry::init(); @@ -2266,7 +2266,7 @@ fn in_virtual_workspace() { .run(); } -#[cargo_test] +#[allow(dead_code)] fn in_virtual_workspace_with_p() { // `publish` generally requires a remote registry let registry = registry::RegistryBuilder::new().http_api().build(); @@ -2324,7 +2324,7 @@ You may press ctrl-c [..] .run(); } -#[cargo_test] +#[allow(dead_code)] fn in_package_workspace_not_found() { // Use local registry for faster test times since no publish will occur let registry = registry::init(); @@ -2369,7 +2369,7 @@ error: package ID specification `li` did .run(); } -#[cargo_test] +#[allow(dead_code)] fn in_package_workspace_found_multiple() { // Use local registry for faster test times since no publish will occur let registry = registry::init(); @@ -2426,7 +2426,7 @@ error: the `-p` argument must be specifi .run(); } -#[cargo_test] +#[allow(dead_code)] // https://github.com/rust-lang/cargo/issues/10536 fn publish_path_dependency_without_workspace() { // Use local registry for faster test times since no publish will occur @@ -2473,7 +2473,7 @@ error: package ID specification `bar` di .run(); } -#[cargo_test] +#[allow(dead_code)] fn http_api_not_noop() { let registry = registry::RegistryBuilder::new().http_api().build(); @@ -2534,7 +2534,7 @@ You may press ctrl-c [..] p.cargo("build").run(); } -#[cargo_test] +#[allow(dead_code)] fn wait_for_first_publish() { // Counter for number of tries before the package is "published" let arc: Arc> = Arc::new(Mutex::new(0)); @@ -2616,7 +2616,7 @@ You may press ctrl-c to skip waiting; th /// A separate test is needed for package names with - or _ as they hit /// the responder twice per cargo invocation. If that ever gets changed /// this test will need to be changed accordingly. -#[cargo_test] +#[allow(dead_code)] fn wait_for_first_publish_underscore() { // Counter for number of tries before the package is "published" let arc: Arc> = Arc::new(Mutex::new(0)); @@ -2712,7 +2712,7 @@ You may press ctrl-c to skip waiting; th p.cargo("build").with_status(0).run(); } -#[cargo_test] +#[allow(dead_code)] fn wait_for_subsequent_publish() { // Counter for number of tries before the package is "published" let arc: Arc> = Arc::new(Mutex::new(0)); @@ -2804,7 +2804,7 @@ You may press ctrl-c to skip waiting; th p.cargo("check").with_status(0).run(); } -#[cargo_test] +#[allow(dead_code)] fn skip_wait_for_publish() { // Intentionally using local registry so the crate never makes it to the index let registry = registry::init(); Index: rust/src/tools/cargo/tests/testsuite/credential_process.rs =================================================================== --- rust.orig/src/tools/cargo/tests/testsuite/credential_process.rs +++ rust/src/tools/cargo/tests/testsuite/credential_process.rs @@ -63,7 +63,7 @@ fn get_token_test() -> (Project, TestReg (p, server) } -#[cargo_test] +#[allow(dead_code)] fn publish() { // Checks that credential-process is used for `cargo publish`. let (p, _t) = get_token_test(); @@ -85,7 +85,7 @@ You may press ctrl-c [..] .run(); } -#[cargo_test] +#[allow(dead_code)] fn basic_unsupported() { // Non-action commands don't support login/logout. let registry = registry::RegistryBuilder::new() @@ -121,7 +121,7 @@ Caused by: .run(); } -#[cargo_test] +#[allow(dead_code)] fn login() { let registry = registry::RegistryBuilder::new() .no_configure_token() @@ -142,7 +142,7 @@ fn login() { .run(); } -#[cargo_test] +#[allow(dead_code)] fn logout() { let server = registry::RegistryBuilder::new() .no_configure_token() @@ -161,7 +161,7 @@ fn logout() { .run(); } -#[cargo_test] +#[allow(dead_code)] fn yank() { let (p, _t) = get_token_test(); @@ -176,7 +176,7 @@ fn yank() { .run(); } -#[cargo_test] +#[allow(dead_code)] fn owner() { let (p, _t) = get_token_test(); @@ -191,7 +191,7 @@ fn owner() { .run(); } -#[cargo_test] +#[allow(dead_code)] fn invalid_token_output() { // Error when credential process does not output the expected format for a token. let cred_proj = project()