Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/scripts/infra_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
" done; supervisorctl -c /etc/supervisor/supervisord.conf status; exit 1"],
"agentenv-ubuntu-24.04-browser": [
"docker", "run", "--rm", "--entrypoint", "sh", "{image}", "-c",
"start-computer & for _ in $(seq 60); do sleep 1;"
"start-computer init & for _ in $(seq 60); do sleep 1;"
" s=$(supervisorctl -c /etc/supervisor/supervisord.conf status);"
" echo \"$s\" | grep -q ' RUNNING ' && ! echo \"$s\" | grep -qv ' RUNNING ' && exit 0;"
" done; supervisorctl -c /etc/supervisor/supervisord.conf status; exit 1"],
Expand Down
12 changes: 12 additions & 0 deletions tst/unit/test_infra_build_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import configparser
import hashlib
import json
import re
import subprocess
import sys
from pathlib import Path
Expand Down Expand Up @@ -65,6 +66,17 @@ def test_its_images_are_the_ones_agent_env_ships(script):
assert script.DISK_ARGS == {image.name: {arg: built.name for arg, built in image.args} for image in DISK_IMAGES}



@pytest.mark.parametrize("name", ["agentenv-ubuntu-24.04", "agentenv-ubuntu-24.04-browser"])
def test_a_base_computers_smoke_starts_it_as_its_image_does(script, name):
"""A base's smoke starts it with its image's own CMD, so a change to that start can't leave the release's smoke,
which no pull request runs, starting it another way."""
dockerfile = (REPO / script.IMAGES[name]).read_text()
command = json.loads(re.search(r"^CMD (\[.*\])$", dockerfile, re.MULTILINE).group(1))
start = " ".join([Path(command[0]).name, *command[1:]])

assert script._SMOKES[name][-1].startswith(f"{start} & "), script._SMOKES[name][-1]

def test_check_accepts_every_image_the_plan_lists(script, monkeypatch, capsys):
plan = load_script("infra_images.py")

Expand Down
Loading