You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sorry if this is an IDE issue but any clue of running test on debug mode ?
Steps
click on "Debug Test execute"
start_app() basically establishes a db connection and starts a server on a different thread
async fn start_app() {
let pool = PgPool::connect("postgres://<user>:<password>@localhost:<port>/db")
.await
.expect("Failed to connect to database");
let server = run(pool.clone()).expect("Something terrible happened while starting server");
let _ = tokio::spawn(server);
}
Result:
DB connection is successfully established and server starts up but the following error is thrown
_Testing started at 03:26 ...
/Users/<local_path>/target/debug/deps/unit_test-28a3ee7b4f33429a execute --format=json --exact -Z unstable-options --show-output
error: unexpected argument 'execute' found
Usage: unit_test-28a3ee7b4f33429a [OPTIONS]
For more information, try '--help'.
Process finished with exit code 2_
Note:
Test runs well without errors when executed on command lines as follows cargo test -p nubia --test unit_test
The text was updated successfully, but these errors were encountered:
@invent360 I guess Unit::run() by default tries to parse CLI args, and execute --format=json --exact -Z unstable-options --show-output is not something expected by it. You should specify cli::Args manually in this case, because you're running tests harness = false. See this chapter of the Book, .with_cli() docs and .with_default_cli() docs.
Sorry if this is an IDE issue but any clue of running test on debug mode ?
Steps
start_app() basically establishes a db connection and starts a server on a different thread
Result:
DB connection is successfully established and server starts up but the following error is thrown
Note:
Test runs well without errors when executed on command lines as follows
cargo test -p nubia --test unit_test
The text was updated successfully, but these errors were encountered: