Mastra mastra-smoke-test
Smoke test Mastra projects locally or deploy to staging/production. Tests Studio UI, agents, tools, workflows, traces, memory, and more. Supports both local development and cloud deployments.
git clone https://github.com/mastra-ai/mastra
T=$(mktemp -d) && git clone --depth=1 https://github.com/mastra-ai/mastra "$T" && mkdir -p ~/.claude/skills && cp -r "$T/.claude/skills/mastra-smoke-test" ~/.claude/skills/mastra-ai-mastra-mastra-smoke-test && rm -rf "$T"
.claude/skills/mastra-smoke-test/SKILL.mdMastra Smoke Test
Comprehensive smoke testing for Mastra projects.
⚠️ Mandatory Test Checklist
Use
to track progress. Run ALL tests unless task_write
--test specifies otherwise.
Do not skip tests unless you hit an actual blocker. "Seemed complex" or "wasn't sure" are not valid reasons. Attempt everything - only stop a test when you literally cannot proceed. Report what you tried and what blocked you.
| # | Test | Reference | When Required |
|---|---|---|---|
| 1 | Setup | | Always |
| 2 | Agents | | or full |
| 3 | Tools | | or full |
| 4 | Workflows | | or full |
| 5 | Traces | | or full |
| 6 | Scorers | | or full |
| 7 | Memory | | or full |
| 8 | MCP | | or full |
| 9 | Errors | | or full |
| 10 | Studio Deploy | | (cloud only) |
| 11 | Server Deploy | | (cloud only) |
Execution Flow
- Read the reference file for each test you're about to run
- Execute the steps in that reference file
- Mark the test complete before moving to the next
Partial Testing (--test
)
--testIf
--test is provided:
- Always run Setup (step 1)
- Run only the specified test(s)
- Skip other tests
Example:
--test agents,traces → Run steps 1, 2, and 5 only.
Usage
# Full smoke test smoke test --env local --existing-project ~/my-app smoke test --env staging -d ~/projects -n test-app # Partial testing smoke test --env local --existing-project ~/my-app --test agents smoke test --env production --existing-project ~/my-app --test studio,server,traces # Multi-environment: same project, different targets smoke test --env staging --existing-project ~/my-app # Uses .mastra-project-staging.json smoke test --env production --existing-project ~/my-app # Uses .mastra-project.json
Multi-Environment Support
One project can target all environments using separate config files:
| Environment | Config File | What Happens |
|---|---|---|
| Local | N/A | → localhost:4111 |
| Staging | | Deploys to staging.mastra.cloud |
| Production | | Deploys to mastra.cloud |
See
references/tests/setup.md for setup details.
Parameters
| Parameter | Required | Default | Description |
|---|---|---|---|
| Yes | - | , , |
| * | | Parent dir for new project |
| * | - | Project name |
| * | - | Path to existing project |
| No | | Version tag (e.g., ) |
| No | | Package manager |
| No | | LLM provider |
| No | | Storage: , , |
| No | (full) | Specific test(s) to run |
| No | | Add browser agent |
| No | | Curl-only (no browser UI) |
| No | | Test bring-your-own-key |
* Either
--directory + --name OR --existing-project required
Test Options (--test
)
--test| Option | Description | Environments |
|---|---|---|
| Agent page and chat | All |
| Tools page and execution | All |
| Workflows page and run | All |
| Observability/traces | All |
| Evaluation/scorers page | All |
| Conversation persistence | All |
| MCP servers page | All |
| Error handling | All |
| Studio deploy only | Cloud |
| Server deploy only | Cloud |
Prerequisites
All environments:
- Node.js + package manager
- LLM API key in env or
.env
Local (
):--env local
- Browser tools enabled (
)/browser on
Cloud (
):--env staging/production
- Mastra platform account
Quick Start Flow
1. Setup → Read references/tests/setup.md, create/verify project 2. Start → `pnpm run dev` (local) or deploy (cloud) 3. Test → For each test, read its reference file and execute 4. Verify → Check all items in reference file's checklist 5. Report → Summarize pass/fail for each test
References
| File | Purpose |
|---|---|
| Detailed steps for each test |
| Local dev server setup |
| Cloud deploy details |
| BYOK, storage testing |
| Troubleshooting |
| Infrastructure debugging |
| Server API test script |
Platform Dashboards
- Production:
https://projects.mastra.ai - Staging:
https://projects.staging.mastra.ai
For Gateway API testing (memory, threads, BYOK via gateway), use
.platform-smoke-test
Result Reporting
After testing, provide:
## Smoke Test Results **Environment**: local/staging/production **Project**: <name> | Test | Status | Notes | | ------ | ------ | ----- | | Setup | ✅/❌ | | | Agents | ✅/❌ | | | Tools | ✅/❌ | | | ... | | | **Issues Found**: (list any) **Warnings**: (list any deploy/runtime warnings) **Skipped Tests**: (list with reason - e.g., "Server Deploy - not applicable in local environment")