Skip to content

Commit

Permalink
Add test for when interactive jobs dies
Browse files Browse the repository at this point in the history
  • Loading branch information
sverhoeven committed Jun 5, 2024
1 parent 5c57dea commit 9646064
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/web/test_interactive_apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

from bartender.web.api.job.interactive_apps import (
InteractiveApplicationConfiguration,
InteractiveAppResult,
build_command,
run,
)
Expand Down Expand Up @@ -58,6 +59,22 @@ async def test_run_invalid_payload(
await run(job_dir, payload, app_config)


@pytest.mark.anyio
async def test_run_exit42(
job_dir: Path,
app_config: InteractiveApplicationConfiguration,
) -> None:
payload = {"input_file": "input.txt", "output_file": "output.txt"}
app_config.command_template = "echo -n hi && exit 42 && echo bye"
result = await run(job_dir, payload, app_config)
expected = InteractiveAppResult(
returncode=42,
stdout="hi",
stderr="",
)
assert result == expected


@pytest.mark.parametrize(
"payload, expected",
[
Expand Down

0 comments on commit 9646064

Please sign in to comment.