Unit Testing (Pro): Baselines and Exports
This page covers regression snapshot baselines and how test run results are exported (including where files are written).
Baselines (regression snapshots)
Regression snapshot tests capture “expected” outputs and alert on drift. Treat baselines like code:
- update baselines intentionally (after expected data changes),
- review baseline diffs before accepting,
- keep tolerances realistic (avoid flaky tests).
Prompt:
“Create a regression snapshot baseline for our KPI suite. Explain when we should update the baseline and how to review changes safely.”Masking note (common in governed environments):
- If your environment has PII/numeric masking enabled, some snapshot modes are intentionally restricted. If “full row capture” or “top-N capture” is blocked, ask the assistant to switch to a safe baseline mode (hash/aggregate) or to explain what governance setting is enforcing the restriction.
What baseline management supports today:
- list saved baselines for a test,
- capture a new baseline,
- delete an old baseline.
Prompt:
“List baselines formonthly-sales-snapshot, capture a new one, then keep only the current baseline.”
Exporting results (shareable formats)
Ask for the format that fits your workflow:
- Markdown (PR comments / tickets)
- JUnit (CI systems)
- HTML (readable reports)
- JSON (automation)
Prompts:
“Run all enabled tests and export results as Markdown suitable for a PR comment.” “Export the last test run as JUnit for CI.”Where exports go (and what “content omitted” means)
Test results can be returned inline in chat, or written to a file on the machine running the MCP server.
Two common cases write to disk:
- You explicitly ask to save the export to a file (recommended for PR artifacts).
- The export is too large to return inline; the server automatically saves it and returns a file path instead of the content.
Important:
- If the MCP server runs remotely (or in a container), the file is saved on the server host, not your laptop.
- Relative paths are interpreted on the server. In many setups, the default export root is
./test-resultsunder the server’s working directory. If you need a predictable location, ask for an absolute path or ask an admin to set a fixed export root.
Copy/paste prompts:
“Export the last test run as Markdown and save it to./test-results/kpi-suite.md. Then summarize.”
“If the export is too large to return inline, save it to a file and tell me the path.”