Refactor fixtures into common

unused/TracingSupport
Chip Senkbeil 11 months ago
parent 16eb86ad43
commit cd6f2be0e5
No known key found for this signature in database
GPG Key ID: 35EF1F8EC72A4131

@ -4,7 +4,7 @@ use rstest::*;
use serde_json::json;
use test_log::test;
use crate::cli::fixtures::*;
use crate::common::fixtures::*;
const FILE_CONTENTS: &str = r#"
some text

@ -4,7 +4,7 @@ use rstest::*;
use serde_json::json;
use test_log::test;
use crate::cli::fixtures::*;
use crate::common::fixtures::*;
#[rstest]
#[test(tokio::test)]

@ -5,7 +5,7 @@ use rstest::*;
use serde_json::json;
use test_log::test;
use crate::cli::fixtures::*;
use crate::common::fixtures::*;
/// Creates a directory in the form
///

@ -3,7 +3,7 @@ use rstest::*;
use serde_json::json;
use test_log::test;
use crate::cli::fixtures::*;
use crate::common::fixtures::*;
#[rstest]
#[test(tokio::test)]

@ -3,7 +3,7 @@ use rstest::*;
use serde_json::json;
use test_log::test;
use crate::cli::fixtures::*;
use crate::common::fixtures::*;
const FILE_CONTENTS: &str = r#"
some text

@ -3,7 +3,7 @@ use rstest::*;
use serde_json::json;
use test_log::test;
use crate::cli::fixtures::*;
use crate::common::fixtures::*;
const FILE_CONTENTS: &str = r#"
some text

@ -3,7 +3,7 @@ use rstest::*;
use serde_json::json;
use test_log::test;
use crate::cli::fixtures::*;
use crate::common::fixtures::*;
const FILE_CONTENTS: &str = r#"
some text

@ -3,7 +3,7 @@ use rstest::*;
use serde_json::json;
use test_log::test;
use crate::cli::fixtures::*;
use crate::common::fixtures::*;
const FILE_CONTENTS: &str = r#"
some text

@ -3,7 +3,7 @@ use rstest::*;
use serde_json::json;
use test_log::test;
use crate::cli::fixtures::*;
use crate::common::fixtures::*;
const FILE_CONTENTS: &str = r#"
some text

@ -3,7 +3,7 @@ use rstest::*;
use serde_json::json;
use test_log::test;
use crate::cli::fixtures::*;
use crate::common::fixtures::*;
const FILE_CONTENTS: &str = r#"
some text

@ -3,7 +3,7 @@ use rstest::*;
use serde_json::{json, Value};
use test_log::test;
use crate::cli::fixtures::*;
use crate::common::fixtures::*;
const FILE_CONTENTS: &str = r#"
some text

@ -2,8 +2,8 @@ use rstest::*;
use serde_json::json;
use test_log::test;
use crate::cli::fixtures::*;
use crate::cli::scripts::*;
use crate::common::fixtures::*;
fn make_cmd(args: Vec<&str>) -> String {
format!(

@ -4,7 +4,7 @@ use rstest::*;
use serde_json::json;
use test_log::test;
use crate::cli::fixtures::*;
use crate::common::fixtures::*;
#[rstest]
#[test(tokio::test)]

@ -4,7 +4,7 @@ use rstest::*;
use serde_json::json;
use test_log::test;
use crate::cli::fixtures::*;
use crate::common::fixtures::*;
const FILE_CONTENTS: &str = r#"
some text

@ -3,7 +3,7 @@ use rstest::*;
use serde_json::json;
use test_log::test;
use crate::cli::fixtures::*;
use crate::common::fixtures::*;
#[rstest]
#[test(tokio::test)]

@ -4,7 +4,7 @@ use rstest::*;
use serde_json::json;
use test_log::test;
use crate::cli::fixtures::*;
use crate::common::fixtures::*;
#[rstest]
#[test(tokio::test)]

@ -3,7 +3,7 @@ use rstest::*;
use serde_json::json;
use test_log::test;
use crate::cli::fixtures::*;
use crate::common::fixtures::*;
#[rstest]
#[test(tokio::test)]

@ -5,7 +5,7 @@ use rstest::*;
use serde_json::json;
use test_log::test;
use crate::cli::fixtures::*;
use crate::common::fixtures::*;
async fn wait_a_bit() {
wait_millis(250).await;

@ -2,7 +2,7 @@ use assert_fs::prelude::*;
use predicates::prelude::*;
use rstest::*;
use crate::cli::fixtures::*;
use crate::common::fixtures::*;
const FILE_CONTENTS: &str = r#"
some text

@ -1,7 +1,7 @@
use assert_fs::prelude::*;
use rstest::*;
use crate::cli::fixtures::*;
use crate::common::fixtures::*;
#[rstest]
#[test_log::test]

@ -2,7 +2,7 @@ use assert_fs::prelude::*;
use predicates::prelude::*;
use rstest::*;
use crate::cli::fixtures::*;
use crate::common::fixtures::*;
#[rstest]
#[test_log::test]

@ -2,8 +2,8 @@ use assert_fs::prelude::*;
use predicates::prelude::*;
use rstest::*;
use crate::cli::fixtures::*;
use crate::cli::utils::regex_pred;
use crate::common::fixtures::*;
use crate::common::utils::regex_pred;
const FILE_CONTENTS: &str = r#"
some text

@ -4,8 +4,8 @@ use assert_fs::prelude::*;
use predicates::prelude::*;
use rstest::*;
use crate::cli::fixtures::*;
use crate::cli::utils::regex_pred;
use crate::common::fixtures::*;
use crate::common::utils::regex_pred;
/// Creates a directory in the form
///

@ -3,7 +3,7 @@ use indoc::indoc;
use predicates::prelude::*;
use rstest::*;
use crate::cli::fixtures::*;
use crate::common::fixtures::*;
const FILE_CONTENTS: &str = indoc! {r#"
some text

@ -2,7 +2,7 @@ use assert_fs::prelude::*;
use predicates::prelude::*;
use rstest::*;
use crate::cli::fixtures::*;
use crate::common::fixtures::*;
#[rstest]
#[test_log::test]

@ -2,7 +2,7 @@ use assert_fs::prelude::*;
use predicates::prelude::*;
use rstest::*;
use crate::cli::fixtures::*;
use crate::common::fixtures::*;
const FILE_CONTENTS: &str = r#"
some text

@ -3,7 +3,7 @@ use indoc::indoc;
use predicates::Predicate;
use rstest::*;
use crate::cli::fixtures::*;
use crate::common::fixtures::*;
const SEARCH_RESULTS_REGEX: &str = indoc! {r"
.*?[\\/]file1.txt

@ -4,8 +4,8 @@ use std::time::Duration;
use assert_fs::prelude::*;
use rstest::*;
use crate::cli::fixtures::*;
use crate::cli::utils::ThreadedReader;
use crate::common::fixtures::*;
use crate::common::utils::ThreadedReader;
fn wait_a_bit() {
wait_millis(250);

@ -3,7 +3,7 @@ use indoc::indoc;
use predicates::prelude::*;
use rstest::*;
use crate::cli::fixtures::*;
use crate::common::fixtures::*;
const FILE_CONTENTS: &str = indoc! {r#"
some text

@ -1,8 +1,8 @@
use rstest::*;
use crate::cli::fixtures::*;
use crate::cli::scripts::*;
use crate::cli::utils::regex_pred;
use crate::common::fixtures::*;
use crate::common::utils::regex_pred;
#[rstest]
#[test_log::test]

@ -2,7 +2,7 @@ use std::env;
use rstest::*;
use crate::cli::fixtures::*;
use crate::common::fixtures::*;
#[rstest]
#[test_log::test]

@ -1,8 +1,8 @@
use distant_core::protocol::PROTOCOL_VERSION;
use rstest::*;
use crate::cli::fixtures::*;
use crate::cli::utils::TrimmedLinesMatchPredicate;
use crate::common::fixtures::*;
use crate::common::utils::TrimmedLinesMatchPredicate;
#[rstest]
#[test_log::test]

@ -1,7 +1,7 @@
use indoc::indoc;
use rstest::*;
use crate::cli::fixtures::*;
use crate::common::fixtures::*;
const EXPECTED_TABLE: &str = indoc! {"
+---------------+--------------------------------------------------------------+

@ -1,6 +1,4 @@
mod api;
mod client;
mod fixtures;
mod manager;
mod scripts;
mod utils;

@ -1 +1,2 @@
mod cli;
mod common;

@ -0,0 +1,2 @@
pub mod fixtures;
pub mod utils;

@ -1,20 +0,0 @@
/// Path to distant binary
#[inline]
fn bin_path() -> PathBuf {
assert_cmd::cargo::cargo_bin(env!("CARGO_PKG_NAME"))
}
fn start_manager() {
// Start the manager
let mut manager_cmd = StdCommand::new(bin_path());
manager_cmd
.arg("manager")
.arg("listen")
.arg("--log-file")
.arg(random_log_file("manager"))
.arg("--log-level")
.arg("trace")
.stdin(Stdio::piped())
.stdout(Stdio::piped())
.stderr(Stdio::piped());
}

@ -2,28 +2,30 @@ use assert_fs::prelude::*;
use predicates::prelude::*;
use rstest::*;
mod stress;
mod common;
use common::fixtures::*;
#[rstest]
#[test_log::test]
fn should_handle_large_volume_of_requests() {
fn should_handle_large_volume_of_requests(ctx: DistantManagerCtx) {
todo!();
}
#[rstest]
#[test_log::test]
fn should_handle_wide_spread_of_clients() {
fn should_handle_wide_spread_of_clients(ctx: DistantManagerCtx) {
todo!();
}
#[rstest]
#[test_log::test]
fn should_handle_abrupt_client_disconnects() {
fn should_handle_abrupt_client_disconnects(ctx: DistantManagerCtx) {
todo!();
}
#[rstest]
#[test_log::test]
fn should_handle_badly_killing_client_shell_with_interactive_process() {
fn should_handle_badly_killing_client_shell_with_interactive_process(ctx: DistantManagerCtx) {
todo!();
}

Loading…
Cancel
Save