diff options
author | Ilion Beyst <ilion.beyst@gmail.com> | 2022-03-13 15:20:03 +0100 |
---|---|---|
committer | Ilion Beyst <ilion.beyst@gmail.com> | 2022-03-13 15:20:03 +0100 |
commit | fd52e266c6e25999a49c36f17342977b759a2612 (patch) | |
tree | 9c727cac949c9698343d003ee87cfe73c6c6204a /planetwars-matchrunner/src/bin | |
parent | f7655005ff099e8314ecd31e95b26ad74d4efd02 (diff) | |
download | planetwars.dev-fd52e266c6e25999a49c36f17342977b759a2612.tar.xz planetwars.dev-fd52e266c6e25999a49c36f17342977b759a2612.zip |
apply clippy suggestions
Diffstat (limited to 'planetwars-matchrunner/src/bin')
-rw-r--r-- | planetwars-matchrunner/src/bin/testmatch.rs | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/planetwars-matchrunner/src/bin/testmatch.rs b/planetwars-matchrunner/src/bin/testmatch.rs index db160cf..4a9d10e 100644 --- a/planetwars-matchrunner/src/bin/testmatch.rs +++ b/planetwars-matchrunner/src/bin/testmatch.rs @@ -10,16 +10,9 @@ async fn main() { _run_match(map_path).await; } -const IMAGE: &'static str = "python:3.10-slim-buster"; +const IMAGE: &str = "python:3.10-slim-buster"; async fn _run_match(map_path: String) { - let code_dir_path = PathBuf::from("../simplebot"); - let bot_spec = DockerBotSpec { - image: IMAGE.to_string(), - code_path: code_dir_path, - argv: vec!["python".to_string(), "simplebot.py".to_string()], - }; - run_match(MatchConfig { map_path: PathBuf::from(map_path), map_name: "hex".to_string(), @@ -27,13 +20,25 @@ async fn _run_match(map_path: String) { players: vec![ MatchPlayer { name: "a".to_string(), - bot_spec: Box::new(bot_spec.clone()), + bot_spec: Box::new(DockerBotSpec { + image: IMAGE.to_string(), + // code_path: PathBuf::from("../simplebot"), + code_path: PathBuf::from("./bots/simplebot"), + argv: vec!["python".to_string(), "simplebot.py".to_string()], + }), }, MatchPlayer { name: "b".to_string(), - bot_spec: Box::new(bot_spec.clone()), + bot_spec: Box::new(DockerBotSpec { + image: IMAGE.to_string(), + code_path: PathBuf::from("./bots/broken_bot"), + argv: vec!["python".to_string(), "bot.py".to_string()], + }), }, ], }) .await; + + // TODO: use a joinhandle to wait for the logger to finish + tokio::time::sleep(std::time::Duration::from_secs(1)).await; } |