Skip to content
Snippets Groups Projects
Commit f8d6d04b authored by Éloïs's avatar Éloïs
Browse files

fix(cucumber): adapt features path for docker case

parent 23adc26c
No related branches found
No related tags found
No related merge requests found
...@@ -214,10 +214,21 @@ struct CustomOpts { ...@@ -214,10 +214,21 @@ struct CustomOpts {
keep_running: bool, keep_running: bool,
} }
const DOCKER_FEATURES_PATH: &str = "/var/lib/duniter/cucumber-features";
const LOCAL_FEATURES_PATH: &str = "cucumber-features";
#[tokio::main(flavor = "current_thread")] #[tokio::main(flavor = "current_thread")]
async fn main() { async fn main() {
//env_logger::init(); //env_logger::init();
let features_path = if std::path::Path::new(DOCKER_FEATURES_PATH).exists() {
DOCKER_FEATURES_PATH
} else if std::path::Path::new(LOCAL_FEATURES_PATH).exists() {
LOCAL_FEATURES_PATH
} else {
panic!("cucumber-features folder not found");
};
let opts = cucumber::cli::Opts::<_, _, _, CustomOpts>::parsed(); let opts = cucumber::cli::Opts::<_, _, _, CustomOpts>::parsed();
let keep_running = opts.custom.keep_running; let keep_running = opts.custom.keep_running;
...@@ -252,7 +263,7 @@ async fn main() { ...@@ -252,7 +263,7 @@ async fn main() {
Box::pin(std::future::ready(())) Box::pin(std::future::ready(()))
}) })
.with_cli(opts) .with_cli(opts)
.run_and_exit("cucumber-features") .run_and_exit(features_path)
.await; .await;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment