From 9517c3eff870522c791e8676db5de6e5f0c5de06 Mon Sep 17 00:00:00 2001 From: Justin Geibel Date: Wed, 20 Mar 2019 19:22:49 -0400 Subject: [PATCH] Avoid initializing the playback proxy for a few remaining tests This list was obtained by temporarily causing playback to panic if there was no `http-data` file when the proxy is started. The only remaining test that starts a proxy server which goes unused is `krate::yank_not_owner`, however this test does need an index. If more tests fall into this category over time we can switch to a full builder API for orchestrating a `TestApp` but that doesn't seem necessary yet. --- src/tests/krate.rs | 8 ++++---- src/tests/read_only_mode.rs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/tests/krate.rs b/src/tests/krate.rs index eb531741d83..0a83ff51284 100644 --- a/src/tests/krate.rs +++ b/src/tests/krate.rs @@ -1066,7 +1066,7 @@ fn new_krate_with_readme() { #[test] fn new_krate_without_any_email_fails() { - let (app, _, _, token) = TestApp::with_proxy().with_token(); + let (app, _, _, token) = TestApp::init().with_token(); app.db(|conn| { delete(emails::table).execute(conn).unwrap(); @@ -1087,7 +1087,7 @@ fn new_krate_without_any_email_fails() { #[test] fn new_krate_with_unverified_email_fails() { - let (app, _, _, token) = TestApp::with_proxy().with_token(); + let (app, _, _, token) = TestApp::init().with_token(); app.db(|conn| { update(emails::table) @@ -1201,7 +1201,7 @@ fn summary_new_crates() { #[test] fn download() { use chrono::{Duration, Utc}; - let (app, anon, user) = TestApp::with_proxy().with_user(); + let (app, anon, user) = TestApp::init().with_user(); let user = user.as_model(); app.db(|conn| { @@ -1253,7 +1253,7 @@ fn download() { #[test] fn download_nonexistent_version_of_existing_crate_404s() { - let (app, anon, user) = TestApp::with_proxy().with_user(); + let (app, anon, user) = TestApp::init().with_user(); let user = user.as_model(); app.db(|conn| { diff --git a/src/tests/read_only_mode.rs b/src/tests/read_only_mode.rs index de034101c4e..3da27d815a0 100644 --- a/src/tests/read_only_mode.rs +++ b/src/tests/read_only_mode.rs @@ -32,7 +32,7 @@ fn cannot_hit_endpoint_which_writes_db_in_read_only_mode() { #[test] fn can_download_crate_in_read_only_mode() { - let (app, anon, user) = TestApp::with_proxy().with_user(); + let (app, anon, user) = TestApp::init().with_user(); app.db(|conn| { CrateBuilder::new("foo_download_read_only", user.as_model().id)