Unit Testing (Pro)
manage_tests gives you a lightweight unit-testing workflow for semantic models:
- define tests (stored by the MCP server),
- run them against the connected model,
- manage regression baselines (snapshots),
- export results in shareable formats.
You don’t need to know test schemas. Describe the intent (“assert this KPI”, “budget this query”, “lint metadata”), and the assistant will create and run the right tests.
What to ask the LLM (quick prompts)
“List available test packs and propose a baseline pack for this model.” “Create 3 measure assertion tests for our top KPIs, then run them.” “Run all enabled tests and export results as Markdown for a PR comment.” “Create a regression snapshot baseline and explain how to update it safely.” “Show environment test capabilities for this model (what test types are supported here).”What it's good for
- Catch regressions after refactors (measures, relationships, calc groups).
- Enforce modeling conventions (metadata compliance).
- Validate security behavior (RLS validation) and performance budgets.
- Provide a repeatable “definition of done” for model changes.
What you can test (test types)
The server supports six test types. The matrix below shows each type, what it checks, and the assertion operators available:
Test assertion matrix
Pick a test type quickly, understand what pass means, and copy starter prompts.
| Test type | Pass means... | Best used for | Prompt actions |
|---|---|---|---|
Measure assertion measure_assertion | The measure result matches the expected value (or tolerance) for the given filter context. | Use for KPI correctness checks after logic refactors or source changes. | |
RLS validation rls_validation | The evaluated role/user can only access allowed data and cannot see restricted slices. | Use when introducing or updating security roles and row filters. | |
Performance budget performance_budget | The query duration and resource usage remain below defined limits. | Use for critical dashboards where slow queries are release blockers. | |
Regression snapshot regression_snapshot | Current outputs stay within approved drift boundaries versus a known-good baseline. | Use after expected model/data changes to detect accidental behavior drift. | |
Referential integrity referential_integrity | No orphan keys or broken join assumptions are detected in monitored relationships. | Use after schema changes that affect keys, joins, or relationship direction. | |
Metadata compliance metadata_compliance | Model metadata meets governance rules such as naming, foldering, and descriptions. | Use to enforce documentation and semantic quality gates before release. |
Measure assertion
measure_assertionPass means: The measure result matches the expected value (or tolerance) for the given filter context.
Best for: Use for KPI correctness checks after logic refactors or source changes.
RLS validation
rls_validationPass means: The evaluated role/user can only access allowed data and cannot see restricted slices.
Best for: Use when introducing or updating security roles and row filters.
Performance budget
performance_budgetPass means: The query duration and resource usage remain below defined limits.
Best for: Use for critical dashboards where slow queries are release blockers.
Regression snapshot
regression_snapshotPass means: Current outputs stay within approved drift boundaries versus a known-good baseline.
Best for: Use after expected model/data changes to detect accidental behavior drift.
Referential integrity
referential_integrityPass means: No orphan keys or broken join assumptions are detected in monitored relationships.
Best for: Use after schema changes that affect keys, joins, or relationship direction.
Metadata compliance
metadata_compliancePass means: Model metadata meets governance rules such as naming, foldering, and descriptions.
Best for: Use to enforce documentation and semantic quality gates before release.
Measure assertion operators are expandable so non-technical users can keep the default view simple.
Each test type has a natural-language prompt style - just describe what you want to check:
"Assert[Total Sales] for Jan 2026 is within 0.5% of 12,345,678."
"Validate role SalesTeam can't see other regions' totals."
"Fail if our exec KPI query takes more than 2 seconds."
"Snapshot the KPI suite output and alert on drift beyond tolerance."
"Check for orphan CustomerId values in Sales vs Customers."
"Fail if any measure is missing a description or display folder."
Packs, baselines, and exports
For adopting tests gradually (packs), managing regression baselines, and exporting results, see the sub-pages:
Locked-down environments (mode behavior)
| Mode | Availability |
|---|---|
| Full mode | AvailableAvailable |
| Read-only mode | Not availableNot available |
| Browse-only mode | Not availableNot available |
Notes: Tests + baselines stored on server; exports may be saved to server disk.
If you’re locked down, ask for the fallback:
“Give me a manual validation checklist and the DAX queries to run after changes.”Troubleshooting
Ask for a lightweight alternative: a small set of saved validation queries + a manual checklist.
Ask:
“Summarize failures by severity and tell me whether this is logic regression vs data drift vs tolerance issue.”In masking-enabled environments, the server may hide sensitive spec/assert bodies unless explicitly allowed. Ask:
Ask:
“Show me thesaved_to path and confirm whether that path is on my machine or the server host. If needed, re-export to a path I can access.”This commonly happens in masking-enabled environments. Ask:
“Explain which snapshot mode is blocked and switch to a safe mode (hash/aggregate) unless explicitly approved otherwise.”