Project sqrail docs

Markdown

Testing architecture

Test layers, workflow placement, sanitizers, fuzzing, and checks for the website and Agent Skill.

sqrail separates native product tests from Python-based integration and research tooling. A contributor can build and test the C++ product without a Python interpreter, while the full CMake workflow presets and release builds exercise every layer.

Test layers

Layer CMake option Runtime Responsibility
native unit SQRAIL_BUILD_TESTS C++20 + Catch2 CLI parsing, limits, query normalization, strict JSON, timeouts
CLI integration SQRAIL_BUILD_INTEGRATION_TESTS Python 3; Bash on Unix real processes, files, signals, races, limits, platform behavior
agent evaluation SQRAIL_BUILD_AGENT_TESTS Python 3 blinded experiment runner, oracle, reports, environment capture
release tools SQRAIL_BUILD_RELEASE_TOOL_TESTS Python 3 deterministic archives, SPDX SBOMs, install layout, completion

SQRAIL_BUILD_TESTS defaults to ON. The three Python-backed layers default to OFF, so an ordinary source configure does not require a Python interpreter.

Catch2 v3.16.1 is fetched at an immutable commit when native tests are enabled. It is a build-only dependency: neither the sqrail executable nor release archives contain the test framework.

Workflows

Run only native product tests:

cmake --workflow --preset core

Run the full developer suite:

cmake --workflow --preset dev

The dev, release, strict, sanitize, thread, system, and Windows presets inherit the full test configuration executed locally and in the multi-platform release workflow (.github/workflows/release.yml), while pull request CI (.github/workflows/ci.yml) runs fast repository hygiene and documentation/site verification. The fuzz preset turns off every other test layer and builds only the two libFuzzer targets.

The execution-control unit test links the embedded DuckDB engine. Trees built with whole-program optimization, such as release and the presets derived from it, skip that test instead of repeating the engine’s slowest link step.

For a production-only build, disable native tests too:

cmake -S . -B out/build/product -G Ninja \
  -DCMAKE_BUILD_TYPE=Release \
  -DSQRAIL_BUILD_TESTS=OFF
cmake --build out/build/product --target sqrail

Placement rules

  • Put deterministic functions and parser behavior in a Catch2 test under tests/*.cpp.
  • Put portable executable-level behavior in cross_platform_test.py.
  • Put POSIX signal, permission, pipe, and spill cleanup behavior in smoke.sh.
  • Put tests for benchmarks/*.py beside the existing agent-evaluation test group.
  • Put release archive and SBOM checks in package_tools_test.py.

CTest remains the single entry point for all configured layers. Test names use stable sqrail- prefixes so a preset or CI job can select a responsibility without depending on source-file layout.

Website and Agent Skill

The static website and public Agent Skill use the pinned Node.js development tooling:

npm ci
npm run docs:build
npm run site:check

For website interaction changes, install the pinned Chromium browser and run the Playwright suite (also run by pull request CI):

npx playwright install --with-deps chromium
npm run site:test

The suite serves the local site/ files, blocks external requests, and checks installer platform selection, keyboard navigation, exact clipboard contents, live copy feedback, and progressive enhancement at 390 px and 1280 px. Clipboard tests run serially because pages share the clipboard.

Human-readable reference pages under site/docs/ are generated from the repository Markdown by tools/build-docs.mjs; site:check fails when a generated page is stale. In addition to formatting, HTML, JavaScript, and Cloudflare checks, it validates the Agent Skills frontmatter, OpenAI interface metadata, stable web bootstrap, canonical repository links, and the absence of remote download-to-shell instructions. Before publishing a release, also run gh skill publish --dry-run with GitHub CLI 2.90 or newer to validate ecosystem discovery. Run agy plugin validate . to validate the native AGY/Antigravity route. AGY print mode executes in a private scratch project, so evaluation runners must share their isolated workspace with --add-dir and pass the task with --prompt; --print PROMPT is not equivalent in AGY 1.1.8.