---
title: Testing Execution
summary: How to run backend, frontend, contract, browser, and documentation checks locally and interpret their results.
owners:
  - architecture-enabling-team
badges:
  - content: How-to Guide
    backgroundColor: green
    textColor: green
---

Use this guide to execute checks and diagnose their results. For the test-layer inventory, dependencies, and CI triggers, see [[doc|development/008-testing-matrix]].

## Run backend tests

<Steps>
<Step title="Run unit and architecture tests">

Run the unit and architecture suites during backend iteration:

```bash
mise run test:unit
```

To run one project directly, replace `<test-project>` with the relevant test project in `dotnet test <test-project>`. Backend tests use TUnit on Microsoft.Testing.Platform.

</Step>
<Step title="Run message contract tests">

Run consumer generation followed by provider verification:

```bash
mise run test:contracts
```

The task runs the consumer phase before the provider phase. Do not run provider verification against stale or missing consumer contracts.

</Step>
<Step title="Run the backend suite">

Run unit, architecture, and contract tasks together:

```bash
mise run test
```

For coverage, run `mise run test:coverage`.

</Step>
<Step title="Filter a test run">

Use the Microsoft.Testing.Platform tree-node filter rather than VSTest's `--filter`:

```bash
dotnet test <test-project> --treenode-filter '<filter-expression>'
```

Replace the placeholders with the relevant test project and filter. For Pact tests, category filters look like `/*/*/*/*[Category=PactConsumer]` or `/*/*/*/*[Category=PactProvider]`. Select a test by its test-tree path when iterating on a single case.

</Step>
</Steps>

## Frontend, browser, and documentation checks

Run Bun commands from the frontend workspace:

```bash
bun run boundaries
bun run check-types
bun run lint
bun run test
```

For browser journeys, install the Playwright browser once with `bunx turbo run playwright:install`, ensure the target application is already available, then run `bun run e2e`. The browser suite is not part of the shared pull-request test job; see [[doc|development/008-testing-matrix]].

Run documentation checks from the documentation workspace:

```bash
bun run check
bun run fitness
bun run build
```

## Understand results

- A passing run exits successfully with **zero failed tests**. Review skipped tests and ensure they were intentionally skipped.
- TUnit reports the discovered, passed, failed, and skipped test counts. Use the failed test name and assertion output to locate the first failure.
- If provider verification reports a missing or outdated contract, rerun `mise run test:contracts` so consumer contracts are generated first.
- CI publishes test and coverage reports as artifacts when the corresponding workflow produces them.
- No backend `.IntegrationTests` projects currently exist. Do not treat the absence of that layer as a failed or skipped suite.

<Admonition type="info" title="Container requirement">
	Backend unit, architecture, and message contract suites do not require Docker. Browser end-to-end
	checks require an available application environment; choose the appropriate test layer in
	[[doc|development/008-testing-matrix]].
</Admonition>

For frontend test scope and user-journey details, see [[doc|frontend/004-testing-and-quality-gates]]. For required pull-request checks, see [[doc|development/006-pull-request-process]].
