Skip to content

Commit 0321de4

Browse files
chore: add just recipes for local container runtime e2e tests
- just test-e2e-docker: builds Dockerfile.e2e, runs tests via host Docker socket - just test-e2e-podman: builds Dockerfile.e2e-podman, runs --privileged (Podman-in-Docker) - just test-e2e: runs both in sequence Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 7b73302 commit 0321de4

1 file changed

Lines changed: 46 additions & 1 deletion

File tree

Justfile

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,52 @@ refresh-icons:
5959
[group('diagrams')]
6060
diagrams:
6161
just _run-likec4 .
62-
# ── Internal helpers ──────────────────────────────────────────────────────────
62+
# ── Container runtime tests ───────────────────────────────────────────────────
63+
64+
_e2e_docker_image := "aspirec4-e2e-docker"
65+
_e2e_podman_image := "aspirec4-e2e-podman"
66+
_e2e_dockerfile_docker := "tests/Docker/Dockerfile.e2e"
67+
_e2e_dockerfile_podman := "tests/Docker/Dockerfile.e2e-podman"
68+
69+
# Build and run integration tests inside a Docker container (uses host Docker socket)
70+
[group('container-tests')]
71+
test-e2e-docker configuration=config_default: (_e2e-build _e2e_docker_image _e2e_dockerfile_docker)
72+
docker run --rm \
73+
-v /var/run/docker.sock:/var/run/docker.sock \
74+
-v "{{ justfile_directory() }}:/workspace" \
75+
-w /workspace \
76+
-e CONFIGURATION={{ configuration }} \
77+
{{ _e2e_docker_image }} \
78+
dotnet test \
79+
--project src/tests/AspireC4.IntegrationTests \
80+
--no-build \
81+
--verbosity normal \
82+
--configuration {{ configuration }}
83+
84+
# Build and run integration tests inside a Podman container (rootful Podman-in-Docker, requires --privileged)
85+
[group('container-tests')]
86+
test-e2e-podman configuration=config_default: (_e2e-build _e2e_podman_image _e2e_dockerfile_podman)
87+
docker run --rm --privileged \
88+
-v "{{ justfile_directory() }}:/workspace" \
89+
-w /workspace \
90+
-e CONFIGURATION={{ configuration }} \
91+
{{ _e2e_podman_image }} \
92+
dotnet test \
93+
--project src/tests/AspireC4.IntegrationTests \
94+
--no-build \
95+
--verbosity normal \
96+
--configuration {{ configuration }}
97+
98+
# Build both e2e test images and run integration tests for Docker and Podman
99+
[group('container-tests')]
100+
test-e2e configuration=config_default: (test-e2e-docker configuration) (test-e2e-podman configuration)
101+
102+
[private]
103+
_e2e-build image dockerfile:
104+
just build
105+
docker build -f {{ dockerfile }} -t {{ image }} .
106+
107+
63108

64109
[private]
65110
_run-likec4 path=justfile_dir():

0 commit comments

Comments
 (0)