Something went wrong. Try again.
xburner is an experimental HTTP and gRPC load generator written in Zig.
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667#!/bin/shset -eu
. "$(dirname "$0")/common.sh"xburner_init
TMP_DIR=$(xburner_mktemp_dir workflow-template-matrix)
cleanup() { rm -rf "${TMP_DIR}"}trap cleanup EXIT INT TERM
if [ "${SKIP_ZIG_BUILD:-0}" != "1" ]; then zig build run -- version >/dev/nullelif [ ! -x "${XBURNER_BIN}" ]; then printf >&2 'missing %s; run `zig build run -- version` or unset SKIP_ZIG_BUILD\n' "${XBURNER_BIN}" exit 1fi
cat > "${TMP_DIR}/template.toml" <<EOF[scenario]name = "template-check"protocol = "http"target = "https://example.internal"wasm = "${TMP_DIR}/guest.wasm"
[execution]mode = "constant-vus"vus = 1duration = "1s"
[[http.requests]]id = 1name = "health"method = "GET"path = "/health"EOF
cp "${TMP_DIR}/template.toml" "${TMP_DIR}/template-rust.toml"cp "${TMP_DIR}/template.toml" "${TMP_DIR}/template-go.toml"python3 - <<'PY' "${TMP_DIR}/template-go.toml"from pathlib import Pathimport syspath = Path(sys.argv[1])text = path.read_text()text = text.replace('wasm = "', 'wasm_backend = "wasm3"\nwasm = "', 1)path.write_text(text)PY
sh "${ROOT_DIR}/scripts/build_workflow_wasm.sh" \ "${ROOT_DIR}/templates/workflow-guest.c" \ "${TMP_DIR}/guest.wasm""${XBURNER_BIN}" validate "${TMP_DIR}/template.toml" >/dev/null
sh "${ROOT_DIR}/scripts/build_workflow_rust_wasm.sh" \ "${ROOT_DIR}/templates/workflow-guest.rs" \ "${TMP_DIR}/guest.wasm""${XBURNER_BIN}" validate "${TMP_DIR}/template-rust.toml" >/dev/null
sh "${ROOT_DIR}/scripts/build_workflow_go_wasm.sh" \ "${ROOT_DIR}/templates/workflow-guest.go" \ "${TMP_DIR}/guest.wasm""${XBURNER_BIN}" validate --wasm-backend wasm3 "${TMP_DIR}/template-go.toml" >/dev/null
printf 'workflow template matrix passed\n'