test regular docker runner operation
This commit is contained in:
parent
6cc629a3b7
commit
e86fbc7275
2 changed files with 21 additions and 0 deletions
5
planetwars-matchrunner/bots/echo_bot.py
Normal file
5
planetwars-matchrunner/bots/echo_bot.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
import sys
|
||||
|
||||
for line in sys.stdin:
|
||||
sys.stdout.write(line)
|
||||
sys.stdout.flush()
|
|
@ -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");
|
||||
|
|
Loading…
Reference in a new issue