From e86fbc7275c036cefe75d7c46b0f11898bde1c6c Mon Sep 17 00:00:00 2001 From: Ilion Beyst Date: Sat, 24 Sep 2022 22:21:38 +0200 Subject: test regular docker runner operation --- planetwars-matchrunner/tests/test_matchrunner.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'planetwars-matchrunner/tests') diff --git a/planetwars-matchrunner/tests/test_matchrunner.rs b/planetwars-matchrunner/tests/test_matchrunner.rs index 5b96406..131a7b8 100644 --- a/planetwars-matchrunner/tests/test_matchrunner.rs +++ b/planetwars-matchrunner/tests/test_matchrunner.rs @@ -77,6 +77,22 @@ where ctx.shutdown().await; } +#[tokio::test] +async fn docker_runner_success() { + let bot_spec = simple_python_docker_bot_spec("./bots", "echo_bot.py"); + with_bot_match_ctx(bot_spec, |ctx| { + async move { + let resp = ctx + .request(1, b"sup".to_vec(), Duration::from_millis(200)) + .await; + + assert_eq!(resp, Ok(b"sup\n".to_vec())); + } + .boxed() + }) + .await; +} + #[tokio::test] async fn docker_runner_timeout() { let bot_spec = simple_python_docker_bot_spec("./bots", "timeout_bot.py"); -- cgit v1.2.3