Skip to content
Closed
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ test_results/
*.profraw
coverage-reports/

# The integration tests' default scratch root.
.test-scratch/

# API docs for local preview only.
_site/
_serve/
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,11 @@ PRESERVE_KERNELS ?= false
# Override with SCRATCH_ROOT=/your/path on the command line.
SCRATCH_ROOT ?= $(ROOT_DIR)/.test-scratch

# An editable build's images exist in no registry: init-block builds the
# init image before the data directory is cleared here, and a locally built
# builder image is in the same position. The recipe lands the tars from bin/
# after its own system start, into the store the tests actually see; absent
# a tar, the runtime pulls its documented default instead.
define RUN_INTEGRATION
@echo Ensuring apiserver stopped before the CLI integration tests...
@bin/container system stop && sleep 3 && scripts/ensure-container-stopped.sh
Expand All @@ -298,6 +303,14 @@ define RUN_INTEGRATION
CLITEST_LOG_ROOT=$(LOG_ROOT) && export CLITEST_LOG_ROOT ; \
CLITEST_SCRATCH_ROOT=$(SCRATCH_ROOT) && export CLITEST_SCRATCH_ROOT ; \
CONTAINER_CLI_PATH=$(ROOT_DIR)/bin/container && export CONTAINER_CLI_PATH ; \
if [ -f bin/init.tar ]; then \
echo "==> Loading the built init image" && \
bin/container i load -i bin/init.tar ; \
fi && \
if [ -f bin/builder.tar ]; then \
echo "==> Loading the built builder image" && \
bin/container i load -i bin/builder.tar ; \
fi && \
echo "==> Starting warmup tests" && \
$(SWIFT) test $(INTEGRATION_SWIFT_EXTRA) -c $(BUILD_CONFIGURATION) $(SWIFT_CONFIGURATION) --filter "$(WARMUP_FILTER)" && \
echo "==> Starting $(words $(CONCURRENT_TEST_SUITES)) test suites concurrently (width=$(PARALLEL_WIDTH))" && \
Expand Down
1 change: 1 addition & 0 deletions Sources/ContainerTestSupport/WarmupImage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public enum WarmupImage: String, CaseIterable, Sendable {
case alpine320 = "ghcr.io/linuxcontainers/alpine:3.20"
case alpine318 = "ghcr.io/linuxcontainers/alpine:3.18"
case busybox136 = "ghcr.io/containerd/busybox:1.36"
case pythonAlpine = "docker.io/library/python:alpine"
case kindestNodeV1_35_5 = "docker.io/kindest/node:v1.35.5@sha256:ce977ae6d65918d0b58a5f8b5e940429c2ce42fa3a5619ec2bbc60b949c0ac95"

/// Directory under app-root holding OCI tar archives of each warmup image.
Expand Down
13 changes: 9 additions & 4 deletions scripts/install-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,18 @@ if [ "${CONTAINERIZATION_VERSION}" == "unspecified" ] ; then
fi
echo "Creating InitImage"
make -C ${CONTAINERIZATION_PATH} init
${CONTAINERIZATION_PATH}/bin/cctl images save -o /tmp/init.tar ${IMAGE_NAME}
# The tar stays in bin/ so the integration recipe can land the image
# again into whichever store the tests run against.
${CONTAINERIZATION_PATH}/bin/cctl images save -o bin/init.tar ${IMAGE_NAME}

# Sleep because commands after stop and start are racy.
bin/container system stop
sleep 3
bin/container --debug system start "${START_ARGS[@]}"
# A start against a data directory with no configured kernel asks on
# stdin whether to install one, and this runs from make with no
# terminal, so the flag answers instead of a prompt, the way the
# integration recipe's own start does.
bin/container --debug system start --enable-kernel-install "${START_ARGS[@]}"
sleep 3
bin/container i load -i /tmp/init.tar
rm /tmp/init.tar
bin/container i load -i bin/init.tar
fi