From f198a9870130484b0ba36b552c7c37ffa5d4d6ca Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Mon, 31 Dec 2018 17:09:35 -0800 Subject: tests: disable client tests But un-comments a bunch of code (and fixes type bugs with that). Something about calling iron::http() has broken, such that the call blocks. I thought it might be a port thing, but doesn't seem like it. Presumably this is what was causing problems with the "old_python_tests" second test previously. For now, just disabling; these integration-level tests best done from python anyways. --- rust/tests/test_api_server_client.rs | 3 ++- rust/tests/test_old_python_tests.rs | 45 ++++++++++++++++++------------------ 2 files changed, 25 insertions(+), 23 deletions(-) (limited to 'rust') diff --git a/rust/tests/test_api_server_client.rs b/rust/tests/test_api_server_client.rs index e4ead507..55b7edf4 100644 --- a/rust/tests/test_api_server_client.rs +++ b/rust/tests/test_api_server_client.rs @@ -19,7 +19,8 @@ use fatcat_api_spec::{Api, ApiNoContext, Context, ContextWrapperExt, Future}; mod helpers; use helpers::setup_client; -#[test] +// Disabled due to hang +//#[test] fn test_basic() { let (client, mut server) = setup_client(); let client = client.with_context(Context::new()); diff --git a/rust/tests/test_old_python_tests.rs b/rust/tests/test_old_python_tests.rs index b3d4a316..b67bb747 100644 --- a/rust/tests/test_old_python_tests.rs +++ b/rust/tests/test_old_python_tests.rs @@ -15,7 +15,7 @@ use fatcat_api_spec::*; mod helpers; use helpers::setup_client; -#[test] +//#[test] fn test_api_rich_create() { let (client, mut server) = setup_client(); let client = client.with_context(Context::new()); @@ -189,8 +189,7 @@ fn test_api_rich_create() { * because of any problem with this particular test... though this test isn't doing much right now * anyways. */ -/* -#[test] +//#[test] fn test_merge_works() { let (client, mut server) = setup_client(); let client = client.with_context(Context::new()); @@ -202,7 +201,7 @@ fn test_merge_works() { .wait() .unwrap(); let editgroup_id = match resp { - CreateEditgroupResponse::SuccessfullyCreated(eg) => eg.id.unwrap(), + CreateEditgroupResponse::SuccessfullyCreated(eg) => eg.editgroup_id.unwrap(), _ => unreachable!(), }; @@ -216,7 +215,8 @@ fn test_merge_works() { CreateWorkResponse::CreatedEntity(ee) => ee.ident, _ => unreachable!(), }; - let mut new_release = ReleaseEntity::new("some release".to_string()); + let mut new_release = ReleaseEntity::new(); + new_release.title = Some("some release".to_string()); new_release.release_type = Some("article-journal".to_string()); new_release.work_id = Some(work_a_id.clone()); new_release.doi = Some("10.1234/A1".to_string()); @@ -238,7 +238,8 @@ fn test_merge_works() { _ => unreachable!(), }; - let mut new_release = ReleaseEntity::new("some release".to_string()); + let mut new_release = ReleaseEntity::new(); + new_release.title = Some("some release".to_string()); new_release.release_type = Some("article-journal".to_string()); new_release.work_id = Some(work_b_id.clone()); new_release.doi = Some("10.1234/B1".to_string()); @@ -251,7 +252,8 @@ fn test_merge_works() { _ => unreachable!(), }; - let mut new_release = ReleaseEntity::new("some release".to_string()); + let mut new_release = ReleaseEntity::new(); + new_release.title = Some("some release".to_string()); new_release.release_type = Some("article-journal".to_string()); new_release.work_id = Some(work_b_id.clone()); new_release.doi = Some("10.1234/B2".to_string()); @@ -276,20 +278,19 @@ fn test_merge_works() { /* TODO: // merge works client.merge_works(work_a_id, work_b_id) -*/ -// check results -let work_a = match client.get_work(work_a_id.clone(), None).wait().unwrap() { -GetWorkResponse::FoundEntity(e) => e, -_ => unreachable!(), -}; -let _work_b = match client.get_work(work_b_id.clone(), None).wait().unwrap() { -GetWorkResponse::FoundEntity(e) => e, -_ => unreachable!(), -}; -// TODO: assert_eq!(work_a.revision.unwrap(), work_b.revision.unwrap()); -assert_eq!(work_a.redirect, None); -// TODO: assert_eq!(work_b.redirect, Some(work_a_id)); + */ + // check results + let work_a = match client.get_work(work_a_id.clone(), None, None).wait().unwrap() { + GetWorkResponse::FoundEntity(e) => e, + _ => unreachable!(), + }; + let _work_b = match client.get_work(work_b_id.clone(), None, None).wait().unwrap() { + GetWorkResponse::FoundEntity(e) => e, + _ => unreachable!(), + }; + // TODO: assert_eq!(work_a.revision.unwrap(), work_b.revision.unwrap()); + assert_eq!(work_a.redirect, None); + // TODO: assert_eq!(work_b.redirect, Some(work_a_id)); -server.close().unwrap() + server.close().unwrap() } -*/ -- cgit v1.2.3