Refactor the integration test suite

This commit is contained in:
2022-02-19 14:00:07 +01:00
parent 289c3959da
commit 294e1a867d
4 changed files with 5 additions and 10 deletions

View File

@@ -1,6 +1,5 @@
pub mod test_helper; use crate::helpers::app_address;
use rstest::*; use rstest::*;
use test_helper::app_address;
#[rstest] #[rstest]
#[tokio::test] #[tokio::test]

View File

@@ -2,7 +2,6 @@ use contextswitch_api::contextswitch::taskwarrior;
use contextswitch_api::observability::{get_subscriber, init_subscriber}; use contextswitch_api::observability::{get_subscriber, init_subscriber};
use mktemp::Temp; use mktemp::Temp;
use rstest::*; use rstest::*;
use std::fs;
use std::net::TcpListener; use std::net::TcpListener;
use tracing::info; use tracing::info;
@@ -31,10 +30,6 @@ fn setup_taskwarrior() -> String {
task_data_location task_data_location
} }
pub fn clear_tasks(task_data_location: String) {
fs::remove_dir_all(task_data_location).unwrap();
}
#[fixture] #[fixture]
#[once] #[once]
pub fn app_address() -> String { pub fn app_address() -> String {

3
tests/api/main.rs Normal file
View File

@@ -0,0 +1,3 @@
mod health_check;
mod helpers;
mod task;

View File

@@ -1,10 +1,8 @@
pub mod test_helper; use crate::helpers::app_address;
use contextswitch_api::contextswitch; use contextswitch_api::contextswitch;
use contextswitch_types::{Bookmark, ContextswitchData, NewTask, Task, TaskId}; use contextswitch_types::{Bookmark, ContextswitchData, NewTask, Task, TaskId};
use http::uri::Uri; use http::uri::Uri;
use rstest::*; use rstest::*;
use test_helper::app_address;
use uuid::Uuid; use uuid::Uuid;
#[rstest] #[rstest]