Exercise target adapter against supported S3 peers

This commit is contained in:
ms2k 2026-07-17 02:54:27 +09:00
commit be651d559c
5 changed files with 113 additions and 1 deletions

View file

@ -122,6 +122,29 @@ COPY crates crates
COPY --from=kind-credentials-build /tmp/remora-credentials-tests.tar.zst /tests/remora-credentials-tests.tar.zst COPY --from=kind-credentials-build /tmp/remora-credentials-tests.tar.zst /tests/remora-credentials-tests.tar.zst
CMD ["bash", "-ec", "test -s /run/remora-fixture/profile.env && test -n \"$DATABASE_URL\" && test -n \"$REMORA_VAULT_ADDR\" && test -n \"$REMORA_VAULT_TOKEN\" && test -n \"$REMORA_VAULT_PATH\" && export REMORA_CREDENTIALS_REQUIRE=1 && cargo-nextest nextest run --archive-file /tests/remora-credentials-tests.tar.zst --workspace-remap /workspace"] CMD ["bash", "-ec", "test -s /run/remora-fixture/profile.env && test -n \"$DATABASE_URL\" && test -n \"$REMORA_VAULT_ADDR\" && test -n \"$REMORA_VAULT_TOKEN\" && test -n \"$REMORA_VAULT_PATH\" && export REMORA_CREDENTIALS_REQUIRE=1 && cargo-nextest nextest run --archive-file /tests/remora-credentials-tests.tar.zst --workspace-remap /workspace"]
FROM rust-tools AS kind-target-build
WORKDIR /workspace
COPY Cargo.toml Cargo.lock rust-toolchain.toml ./
COPY .config .config
COPY contracts contracts
COPY crates crates
COPY docs/api docs/api
RUN cargo nextest archive \
--package remora-target \
--features test-utils \
--build-jobs 4 \
--locked \
--archive-file /tmp/remora-target-tests.tar.zst
FROM rust-tools AS kind-target-runner
WORKDIR /workspace
COPY Cargo.toml ./
COPY crates crates
COPY --from=kind-target-build /tmp/remora-target-tests.tar.zst /tests/remora-target-tests.tar.zst
# Non-version cases first; version matrix enables bucket versioning and purges
# versions afterward. Serial threads avoid concurrent writes during that window.
CMD ["bash", "-ec", "test -s /run/remora-fixture/profile.env && test -n \"$REMORA_TARGET_ENDPOINT\" && test -n \"$REMORA_TARGET_BUCKET\" && test -n \"$REMORA_TARGET_ACCESS_KEY\" && test -n \"$REMORA_TARGET_SECRET_KEY\" && case $REMORA_TARGET_PROVIDER in garage|versitygw) ;; *) exit 1 ;; esac && export REMORA_TARGET_REQUIRE=1 && cargo-nextest nextest run --archive-file /tests/remora-target-tests.tar.zst --workspace-remap /workspace --test-threads=1 -E 'not test(version_addressed_and_stale_version_matrix)' && cargo-nextest nextest run --archive-file /tests/remora-target-tests.tar.zst --workspace-remap /workspace --test-threads=1 -E 'test(version_addressed_and_stale_version_matrix)'"]
FROM ${NODE_IMAGE} AS node-runtime FROM ${NODE_IMAGE} AS node-runtime
FROM ${PLAYWRIGHT_IMAGE} AS web-dependencies FROM ${PLAYWRIGHT_IMAGE} AS web-dependencies

View file

@ -1,4 +1,4 @@
.PHONY: check-dependencies check-fixture-lib check-kind-sample check-durable check-coordination check-identity check-credentials check-stream check-fast check-full check-fast-host check-full-host rust-check web-install web-check web-test-fast web-test-full .PHONY: check-dependencies check-fixture-lib check-kind-sample check-durable check-coordination check-identity check-credentials check-stream check-target check-fast check-full check-fast-host check-full-host rust-check web-install web-check web-test-fast web-test-full
CONTAINER_ENGINE ?= nerdctl CONTAINER_ENGINE ?= nerdctl
CONTAINER_RUN_FLAGS ?= --memory=16g --memory-swap=24g --cpus=4 CONTAINER_RUN_FLAGS ?= --memory=16g --memory-swap=24g --cpus=4
@ -73,3 +73,6 @@ check-stream:
cargo clippy --package remora-stream --all-targets --all-features -- -D warnings cargo clippy --package remora-stream --all-targets --all-features -- -D warnings
cargo nextest run --package remora-stream --all-features cargo nextest run --package remora-stream --all-features
cargo test --package remora-stream --doc cargo test --package remora-stream --doc
check-target:
./tests/kind/run-target-job.sh

View file

@ -1025,6 +1025,7 @@ write_lane_profile() {
"REMORA_TARGET_ACCESS_KEY=$target_access_key" \ "REMORA_TARGET_ACCESS_KEY=$target_access_key" \
"REMORA_TARGET_SECRET_KEY=$target_secret_key" \ "REMORA_TARGET_SECRET_KEY=$target_secret_key" \
"REMORA_TARGET_REGION=$target_region" \ "REMORA_TARGET_REGION=$target_region" \
"REMORA_TARGET_EXCLUSIVE_WRITER=true" \
"REMORA_VAULT_ADDR=http://vault:8200" \ "REMORA_VAULT_ADDR=http://vault:8200" \
"REMORA_VAULT_TOKEN=synthetic-vault-token" \ "REMORA_VAULT_TOKEN=synthetic-vault-token" \
"REMORA_VAULT_PATH=$vault_path" \ "REMORA_VAULT_PATH=$vault_path" \
@ -1057,6 +1058,7 @@ write_lane_profile() {
--from-literal="REMORA_TARGET_ACCESS_KEY=$target_access_key" \ --from-literal="REMORA_TARGET_ACCESS_KEY=$target_access_key" \
--from-literal="REMORA_TARGET_SECRET_KEY=$target_secret_key" \ --from-literal="REMORA_TARGET_SECRET_KEY=$target_secret_key" \
--from-literal="REMORA_TARGET_REGION=$target_region" \ --from-literal="REMORA_TARGET_REGION=$target_region" \
--from-literal=REMORA_TARGET_EXCLUSIVE_WRITER=true \
--from-literal=REMORA_VAULT_ADDR=http://vault:8200 \ --from-literal=REMORA_VAULT_ADDR=http://vault:8200 \
--from-literal=REMORA_VAULT_TOKEN=synthetic-vault-token \ --from-literal=REMORA_VAULT_TOKEN=synthetic-vault-token \
--from-literal="REMORA_VAULT_PATH=$vault_path" \ --from-literal="REMORA_VAULT_PATH=$vault_path" \

50
tests/kind/run-target-job.sh Executable file
View file

@ -0,0 +1,50 @@
#!/usr/bin/env bash
set -euo pipefail
ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
source "$ROOT/tests/kind/lib.sh"
USER_KUBECONFIG_BEFORE="$(user_kubeconfig_digest)"
SUCCEEDED=false
OWNS_FIXTURE=false
cleanup() {
local status=$?
trap - EXIT INT TERM
if [[ "${REMORA_TESTBED_RETAIN:-0}" = 1 ]] && [[ "$SUCCEEDED" != true ]]; then
printf 'retained kubeconfig: %s\n' "$KUBECONFIG_PATH"
printf 'retained context: %s\n' "$CONTEXT"
exit "$status"
fi
if [[ "$OWNS_FIXTURE" = true ]]; then
destroy_fixture || status=1
fi
if [[ "$(user_kubeconfig_digest)" != "$USER_KUBECONFIG_BEFORE" ]]; then
printf 'user kubeconfig changed unexpectedly\n' >&2
status=1
fi
exit "$status"
}
trap cleanup EXIT
trap 'exit 130' INT
trap 'exit 143' TERM
acquire_fixture_lock
REMORA_REAL_NERDCTL="$(command -v nerdctl)"
export REMORA_REAL_NERDCTL
"$REMORA_REAL_NERDCTL" --namespace default build \
--file "$ROOT/Dockerfile.test" \
--target kind-target-runner \
--tag remora-kind-target:local \
"$ROOT"
OWNS_FIXTURE=true
setup_fixture target
load_local_image remora-kind-target:local
run_job_matrix \
target-adapter \
"$TESTBED/target-job.yaml.in" \
remora-kind-target:local \
target
SUCCEEDED=true
printf 'target storage adapter package test Job passed\n'

View file

@ -0,0 +1,34 @@
apiVersion: batch/v1
kind: Job
metadata:
name: @@JOB_NAME@@
namespace: remora-testbed
spec:
activeDeadlineSeconds: 900
backoffLimit: 0
ttlSecondsAfterFinished: 300
template:
spec:
automountServiceAccountToken: false
enableServiceLinks: false
restartPolicy: Never
containers:
- name: tests
image: @@TEST_IMAGE@@
imagePullPolicy: Never
envFrom:
- configMapRef: {name: @@PROFILE_NAME@@}
env:
- name: REMORA_TARGET_REQUIRE
value: "1"
volumeMounts:
- {name: fixture-profile, mountPath: /run/remora-fixture, readOnly: true}
resources:
requests: {cpu: 250m, memory: 512Mi}
limits: {cpu: "2", memory: 2Gi}
volumes:
- name: fixture-profile
configMap:
name: @@PROFILE_NAME@@-file
items:
- {key: profile.env, path: profile.env}