aboutsummaryrefslogtreecommitdiff
path: root/planetwars-matchrunner/src/bin/testmatch.rs
diff options
context:
space:
mode:
Diffstat (limited to 'planetwars-matchrunner/src/bin/testmatch.rs')
-rw-r--r--planetwars-matchrunner/src/bin/testmatch.rs25
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;
}