Skip to main content
Palyra utilizes a multi-layered testing strategy designed to ensure reliability across diverse environments (macOS, Linux, Windows) and maintain the integrity of its deterministic core. This infrastructure spans from low-level fuzzing of protocol parsers to high-level CLI smoke tests that validate the behavior of packaged binaries.

Deterministic Core and Soak Tests

The deterministic core tests ensure that the daemon’s internal state transitions, particularly those involving session management and authentication, remain predictable. These tests are orchestrated via scripts/test/run-deterministic-core.ps1 and its shell counterpart.

Core Test Execution

The suite executes a specific subset of tests that target high-risk state transitions:

Fixture Management

Deterministic tests often rely on JSON fixtures to compare expected vs. actual output. The system enforces fixture synchronization through scripts/test/check-deterministic-fixtures.ps1, which hashes crates/palyra-connector-core/tests/fixtures/channel_simulator_expected.json before and after a run to detect drift scripts/test/check-deterministic-fixtures.ps1#6-21. Sources: scripts/test/run-deterministic-core.ps1, scripts/test/check-deterministic-fixtures.ps1, scripts/test/run-deterministic-core.sh.

Workflow Regression Matrix

The workflow regression matrix ensures that complex multi-step operations (like the setup wizard or ACP shim) do not regress. These are typically executed via scripts/test/run-workflow-regression.sh.

Implementation Space Mapping

The following diagram maps the regression script components to the underlying test files they execute. Workflow Regression Mapping Sources: scripts/test/run-workflow-regression.sh:42-48](), scripts/test/run-workflow-regression.ps1:9-15]().

CLI Install Smoke Tests

The CLI smoke harness validates the behavior of the palyra binary in a post-install state. It uses a specialized harness to simulate a clean environment, overriding environment variables to point to temporary directories.

Smoke Harness Logic

The harness, implemented in scripts/test/run-cli-install-smoke.ps1, creates a ScenarioContext that isolates: The test runner crates/palyra-cli/tests/installed_smoke.rs then executes baseline commands like version, doctor --json, and config validate against the binary crates/palyra-cli/tests/installed_smoke.rs#69-92.

Help Snapshot Verification

A key part of the smoke test is ensuring CLI parity. The example emit_cli_install_smoke_inventory.rs parses the CliParityMatrix to generate an inventory of all help commands and their expected snapshots crates/palyra-cli/examples/emit_cli_install_smoke_inventory.rs#35-58. Sources: scripts/test/run-cli-install-smoke.ps1, crates/palyra-cli/tests/installed_smoke.rs, crates/palyra-cli/examples/emit_cli_install_smoke_inventory.rs.

Fuzz Testing Harness

Palyra uses cargo-fuzz to find edge cases in critical parsing logic, particularly for inputs coming from untrusted sources or complex protocols.

Fuzz Targets

The fuzzing infrastructure is located in the fuzz/ directory and includes:
  1. workspace_patch_parser: Fuzzes the parser responsible for handling file patches within the agent workspace fuzz/fuzz_targets/workspace_patch_parser.rs.
  2. process_runner_input_parser: Targets the ProcessRunnerInput struct in palyra-common, ensuring that command-line argument serialization and input piping are robust against malformed data fuzz/fuzz_targets/process_runner_input_parser.rs.

Data Flow for Fuzzing

Sources: fuzz/fuzz_targets/process_runner_input_parser.rs:1-10](), crates/palyra-common/src/process_runner_input.rs:1-20]().

CI Integration

The smoke and regression tests are integrated into GitHub Actions to gate releases.
WorkflowScript / CommandPurpose
CLI install smokerun-cli-install-smoke.ps1Validates binary on Ubuntu, macOS, Windows .github/workflows/cli-install-smoke.yml#27-46
CLI full regressionrun-workflow-regression.shComprehensive matrix of wizard and ACP flows
CIrun-deterministic-core.shCore logic and fixture verification
Sources: .github/workflows/cli-install-smoke.yml, .github/workflows/cli-full-regression.yml.