Added a test console
ci/woodpecker/push/woodpecker Pipeline failed
Details
ci/woodpecker/push/woodpecker Pipeline failed
Details
This commit is contained in:
parent
48e78cebff
commit
c5b457accd
|
@ -16,4 +16,7 @@ Cargo.lock
|
|||
# Rider
|
||||
.idea
|
||||
/cobertura.xml
|
||||
|
||||
# binary specific
|
||||
/tests/version_checker_db
|
||||
/test_console/src/settings.development.toml
|
||||
|
|
|
@ -3,5 +3,6 @@
|
|||
members = [
|
||||
"application",
|
||||
"console",
|
||||
"test_console",
|
||||
"tests",
|
||||
]
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
[package]
|
||||
name = "test_console"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
application = { path = "../application" }
|
|
@ -0,0 +1,21 @@
|
|||
/*
|
||||
I use this as a test bench instead of running the binary from a terminal.
|
||||
TODO: i might change this to a test, that is muted somehow, but through configuration can be wired
|
||||
to a real SMTP server, so i can test the full flow of the binary
|
||||
*/
|
||||
fn main() {
|
||||
let parser = ArgumentParser {};
|
||||
let settings = Settings::new(None).unwrap();
|
||||
let console = Console {};
|
||||
|
||||
let notification = EmailNotification {
|
||||
smtp_relay: settings.email.smtp_relay.clone(),
|
||||
smtp_username: settings.email.smtp_username.clone(),
|
||||
smtp_password: settings.email.smtp_password.clone(),
|
||||
from: settings.email.from.clone(),
|
||||
};
|
||||
let args = std::env::args().collect();
|
||||
let application = Application::new(&settings, &console, ¬ification, parser, args);
|
||||
|
||||
application.run();
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
[database]
|
||||
connection_string = "version_checker_db"
|
||||
in_memory = false
|
Loading…
Reference in New Issue