# Testing Guide This document summarizes the repository test and validation entrypoints. ## Core Test Command ```sh zig build test ``` On Linux, the CI-equivalent entrypoint is: ```sh sh scripts/build_linux.sh sh scripts/test_linux_unit.sh ``` ## Ubuntu Docker Validation To reproduce the Linux CI toolchain locally with Docker: ```sh sh hacks/test_ubuntu_docker.sh ``` This builds [docker/ubuntu-ci.Dockerfile](../docker/ubuntu-ci.Dockerfile) and runs [scripts/test_linux_unit.sh](../scripts/test_linux_unit.sh) inside an Ubuntu container. By default it uses the host architecture, and you can force `linux/amd64` when you want closer parity with CI. Useful variants: ```sh sh hacks/test_ubuntu_docker.sh --rebuild sh hacks/test_ubuntu_docker.sh -- env SKIP_ZIG_BUILD=1 sh scripts/test_release_smoke.sh --profile linux sh hacks/test_ubuntu_docker.sh --platform linux/arm64 -- zig build test sh hacks/test_ubuntu_docker.sh --platform linux/amd64 -- zig build test ``` ## Local Setup Before most local validation flows: ```sh brew install grpc pkgconf go sh scripts/init.sh ``` ## Sample Guest Build To rebuild the workflow sample guest: ```sh sh scripts/build_workflow_sample_wasm.sh ``` ## Workflow Scaffold Check - [scripts/test_workflow_scaffold.sh](../scripts/test_workflow_scaffold.sh) ## Probe And Golden Checks - [scripts/test_golden_outputs.sh](../scripts/test_golden_outputs.sh) - [scripts/test_config_loader_suite.sh](../scripts/test_config_loader_suite.sh) - [scripts/test_config_loader_fixtures.sh](../scripts/test_config_loader_fixtures.sh) - [scripts/test_config_loader_summary.sh](../scripts/test_config_loader_summary.sh) - [scripts/test_workflow_probe_fixtures.sh](../scripts/test_workflow_probe_fixtures.sh) - [scripts/test_summary_golden.sh](../scripts/test_summary_golden.sh) - [scripts/test_release_package.sh](../scripts/test_release_package.sh) - [scripts/test_release_smoke.sh](../scripts/test_release_smoke.sh) These scripts validate: - deterministic probe JSON - combined config-loader fixture and summary coverage - include and `env_file` loading behavior - include and `env_file` behavior for normalized run summaries - include and `env_file` behavior for `abort_on_fail` threshold exits - workflow setup probe behavior - normalized run summary JSON - release package structure and `--version` smoke behavior - release smoke checks used by the release workflow `test_config_loader_suite.sh` also supports: - `all` - `fixtures` - `summary` ## Sample Integration - [hacks/sample_http_server.py](../hacks/sample_http_server.py) - [hacks/simple_fixture_server.py](../hacks/simple_fixture_server.py) - [hacks/workflow_fixture_server.py](../hacks/workflow_fixture_server.py) - [hacks/grpc_fixture_server.go](../hacks/grpc_fixture_server.go) - [hacks/combined_fixture_servers.sh](../hacks/combined_fixture_servers.sh) - [scripts/test_samples.sh](../scripts/test_samples.sh) - [scripts/test_grpc_unary.sh](../scripts/test_grpc_unary.sh) - [scripts/test_grpc_workflow.sh](../scripts/test_grpc_workflow.sh) - [scripts/test_grpc_setup_teardown.sh](../scripts/test_grpc_setup_teardown.sh) - [scripts/test_grpc_ramping_exporters.sh](../scripts/test_grpc_ramping_exporters.sh) - [scripts/test_grpc_hardening.sh](../scripts/test_grpc_hardening.sh) `test_samples.sh` supports: - `simple` - `workflow` - `grpc` - `all` ## Backend Matrix - [scripts/test_backend_matrix.sh](../scripts/test_backend_matrix.sh) This exercises the workflow sample against: - `wamr` - `wasm3` ## Manual TLS Regression Check - [scripts/test_manual_tls_keepalive.sh](../scripts/test_manual_tls_keepalive.sh) - [scripts/test_http2_transport.sh](../scripts/test_http2_transport.sh) - [scripts/test_workflow_template_matrix.sh](../scripts/test_workflow_template_matrix.sh) ## Release Smoke Profiles `test_release_smoke.sh` runs a common core on every platform and then uses `uname -s` to trim duplicate checks. You can also override the profile explicitly with `--profile darwin|linux|generic`, and skip optional buckets with flags such as `--skip-config-loader`, `--skip-manual-https`, `--skip-simple-sample`, and `--skip-workflow-sample`: - `Darwin`: manual HTTPS regression and workflow sample integration - `Linux`: simple sample integration ## CI The repository CI runs: - unit tests - probe golden checks - summary golden checks - workflow probe fixtures - workflow backend matrix checks - simple and workflow sample integrations The Ubuntu Docker flow above is intended to reproduce the Linux unit-test environment locally before pushing.