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.

install
source · Clone the upstream repo
git clone https://github.com/mastra-ai/mastra
Claude Code · Install into ~/.claude/skills/
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"
manifest: .claude/skills/mastra-smoke-test/SKILL.md
source content

Mastra Smoke Test

Comprehensive smoke testing for Mastra projects.

⚠️ Mandatory Test Checklist

Use

task_write
to track progress. Run ALL tests unless
--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.

#TestReferenceWhen Required
1Setup
references/tests/setup.md
Always
2Agents
references/tests/agents.md
--test agents
or full
3Tools
references/tests/tools.md
--test tools
or full
4Workflows
references/tests/workflows.md
--test workflows
or full
5Traces
references/tests/traces.md
--test traces
or full
6Scorers
references/tests/scorers.md
--test scorers
or full
7Memory
references/tests/memory.md
--test memory
or full
8MCP
references/tests/mcp.md
--test mcp
or full
9Errors
references/tests/errors.md
--test errors
or full
10Studio Deploy
references/tests/studio.md
--test studio
(cloud only)
11Server Deploy
references/tests/server.md
--test server
(cloud only)

Execution Flow

  1. Read the reference file for each test you're about to run
  2. Execute the steps in that reference file
  3. Mark the test complete before moving to the next

Partial Testing (
--test
)

If

--test
is provided:

  1. Always run Setup (step 1)
  2. Run only the specified test(s)
  3. 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:

EnvironmentConfig FileWhat Happens
LocalN/A
pnpm dev
→ localhost:4111
Staging
.mastra-project-staging.json
Deploys to staging.mastra.cloud
Production
.mastra-project.json
Deploys to mastra.cloud

See

references/tests/setup.md
for setup details.

Parameters

ParameterRequiredDefaultDescription
--env
Yes-
local
,
staging
,
production
--directory
*
~/mastra-smoke-tests
Parent dir for new project
--name
*-Project name
--existing-project
*-Path to existing project
--tag
No
latest
Version tag (e.g.,
alpha
)
--pm
No
pnpm
Package manager
--llm
No
openai
LLM provider
--db
No
libsql
Storage:
libsql
,
pg
,
turso
--test
No(full)Specific test(s) to run
--browser-agent
No
false
Add browser agent
--skip-browser
No
false
Curl-only (no browser UI)
--byok
No
false
Test bring-your-own-key

* Either

--directory
+
--name
OR
--existing-project
required

Test Options (
--test
)

OptionDescriptionEnvironments
agents
Agent page and chatAll
tools
Tools page and executionAll
workflows
Workflows page and runAll
traces
Observability/tracesAll
scorers
Evaluation/scorers pageAll
memory
Conversation persistenceAll
mcp
MCP servers pageAll
errors
Error handlingAll
studio
Studio deploy onlyCloud
server
Server deploy onlyCloud

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

FilePurpose
references/tests/*.md
Detailed steps for each test
references/local-setup.md
Local dev server setup
references/cloud-deploy.md
Cloud deploy details
references/cloud-advanced.md
BYOK, storage testing
references/common-errors.md
Troubleshooting
references/gcp-debugging.md
Infrastructure debugging
scripts/test-server.sh
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")