Skip to content

Commit cfdf625

Browse files
committed
WIP: run conformance tests from docker
Signed-off-by: Evan Lezar <elezar@nvidia.com>
1 parent 4c31c98 commit cfdf625

1 file changed

Lines changed: 39 additions & 5 deletions

File tree

‎e2e/rust/e2e-docker.sh‎

Lines changed: 39 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,50 @@
99
set -euo pipefail
1010

1111
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
12-
E2E_TEST="${OPENSHELL_E2E_DOCKER_TEST:-smoke}"
12+
E2E_TEST="${OPENSHELL_E2E_DOCKER_TEST:-}"
1313
E2E_FEATURES="${OPENSHELL_E2E_DOCKER_FEATURES:-e2e-docker}"
1414
DEFAULT_WORKLOAD_MANIFEST="${ROOT}/e2e/gpu/images/.build/workloads.yaml"
15+
RUN_WITH_GATEWAY_COMMAND="__openshell_run_docker_e2e"
16+
17+
run_conformance() {
18+
local conformance_bin="${OPENSHELL_CONFORMANCE_BIN:-${ROOT}/target/debug/openshell-conformance}"
19+
20+
if [ -z "${OPENSHELL_CONFORMANCE_BIN:-}" ]; then
21+
cargo build -p openshell-conformance-cli
22+
fi
23+
24+
if [ ! -x "${conformance_bin}" ]; then
25+
echo "ERROR: openshell conformance binary is not executable: ${conformance_bin}" >&2
26+
exit 1
27+
fi
28+
29+
echo "==> Running standalone CLI conformance against the Docker gateway"
30+
"${conformance_bin}" run smoke \
31+
--openshell-bin "${OPENSHELL_BIN}" \
32+
--output json
33+
}
34+
35+
run_e2e() {
36+
run_conformance
37+
local cargo_args=(
38+
cargo test --manifest-path "${ROOT}/e2e/rust/Cargo.toml"
39+
--features "${E2E_FEATURES}"
40+
)
41+
if [[ -n "${E2E_TEST}" ]]; then
42+
cargo_args+=(--test "${E2E_TEST}")
43+
fi
44+
cargo_args+=(-- --nocapture)
45+
"${cargo_args[@]}"
46+
}
1547

1648
if [ "${E2E_TEST}" = "gpu" ] && [ -z "${OPENSHELL_E2E_WORKLOAD_MANIFEST:-}" ] && [ ! -f "${DEFAULT_WORKLOAD_MANIFEST}" ]; then
1749
echo "note: running GPU e2e without a workload manifest; workload validation will log an explicit skip. Build one with 'mise run e2e:workloads:build' or set OPENSHELL_E2E_WORKLOAD_MANIFEST."
1850
fi
1951

52+
if [ "${1:-}" = "${RUN_WITH_GATEWAY_COMMAND}" ]; then
53+
run_e2e
54+
exit 0
55+
fi
56+
2057
exec "${ROOT}/e2e/with-docker-gateway.sh" \
21-
cargo test --manifest-path "${ROOT}/e2e/rust/Cargo.toml" \
22-
--features "${E2E_FEATURES}" \
23-
--test "${E2E_TEST}" \
24-
-- --nocapture
58+
bash "${BASH_SOURCE[0]}" "${RUN_WITH_GATEWAY_COMMAND}"

0 commit comments

Comments
 (0)