Skip to content

Commit

Permalink
refactor: [#661] move Tracker Checker mod
Browse files Browse the repository at this point in the history
  • Loading branch information
josecelano committed Jan 30, 2024
1 parent d8a9f7b commit 0960ff2
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 21 deletions.
17 changes: 2 additions & 15 deletions src/bin/tracker_checker.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@
//! Program to run checks against running trackers.
//!
//! Run providing a config file path:
//!
//! ```text
//! cargo run --bin tracker_checker -- --config-path "./share/default/config/tracker_checker.json"
//! TORRUST_CHECKER_CONFIG_PATH="./share/default/config/tracker_checker.json" cargo run --bin tracker_checker
//! ```
//!
//! Run providing the configuration:
//!
//! ```text
//! TORRUST_CHECKER_CONFIG=$(cat "./share/default/config/tracker_checker.json") cargo run --bin tracker_checker
//! ```
use torrust_tracker::checker::app;
//! Program to run check running trackers.
use torrust_tracker::console::clients::checker::app;

#[tokio::main]
async fn main() {
Expand Down
16 changes: 15 additions & 1 deletion src/checker/app.rs → src/console/clients/checker/app.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
//! Program to run checks against running trackers.
//!
//! Run providing a config file path:
//!
//! ```text
//! cargo run --bin tracker_checker -- --config-path "./share/default/config/tracker_checker.json"
//! TORRUST_CHECKER_CONFIG_PATH="./share/default/config/tracker_checker.json" cargo run --bin tracker_checker
//! ```
//!
//! Run providing the configuration:
//!
//! ```text
//! TORRUST_CHECKER_CONFIG=$(cat "./share/default/config/tracker_checker.json") cargo run --bin tracker_checker
//! ```
use std::path::PathBuf;
use std::sync::Arc;

Expand All @@ -7,7 +21,7 @@ use clap::Parser;
use super::config::Configuration;
use super::console::Console;
use super::service::{CheckResult, Service};
use crate::checker::config::parse_from_json;
use crate::console::clients::checker::config::parse_from_json;

#[derive(Parser, Debug)]
#[clap(author, version, about, long_about = None)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ mod tests {
}

mod building_configuration_from_plan_configuration {
use crate::checker::config::{Configuration, PlainConfiguration};
use crate::console::clients::checker::config::{Configuration, PlainConfiguration};

#[test]
fn it_should_fail_when_a_tracker_udp_address_is_invalid() {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ impl Printer for Logger {

#[cfg(test)]
mod tests {
use crate::checker::logger::Logger;
use crate::checker::printer::{Printer, CLEAR_SCREEN};
use crate::console::clients::checker::logger::Logger;
use crate::console::clients::checker::printer::{Printer, CLEAR_SCREEN};

#[test]
fn should_capture_the_clear_screen_command() {
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use reqwest::{Client, Url};

use super::config::Configuration;
use super::console::Console;
use crate::checker::printer::Printer;
use crate::console::clients::checker::printer::Printer;

pub struct Service {
pub(crate) config: Arc<Configuration>,
Expand Down
1 change: 1 addition & 0 deletions src/console/clients/mod.rs
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
//! Console clients.
pub mod checker;
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,6 @@
//! examples on the integration and unit tests.
pub mod app;
pub mod bootstrap;
pub mod checker;
pub mod console;
pub mod core;
pub mod servers;
Expand Down

0 comments on commit 0960ff2

Please sign in to comment.