Safe Production Setup
Run synthetic tests in production without affecting real data.
The is_synthetic_test Pattern
Add a flag to your database to mark test-generated data:
ALTER TABLE users ADD COLUMN is_synthetic_test BOOLEAN DEFAULT FALSE;
ALTER TABLE orders ADD COLUMN is_synthetic_test BOOLEAN DEFAULT FALSE;
-- Add to any table your tests will write to
Create a Test Account
- Create a dedicated test account (e.g.,
dinho-monitor@yourapp.com) - Add cleanup logic in your app for synthetic data:
// Example: cleanup middleware
if (session.user.isSyntheticTest) {
// Skip sending real emails
// Skip charging real payment methods
// Mark created records with is_synthetic_test=true
}
Store Credentials in Dinho
Dinho has an AES-256-GCM encrypted credentials store. Use it to store your test account credentials — they become available in the script as credentials.<LABEL>.
Via MCP (recommended): ask your agent to create the credentials:
Create test credentials for the project: EMAIL and PASSWORD
The agent will call dinho_create_credentials, create the placeholders, and return the dashboard link for you to fill in the values.
Via dashboard: go to Dashboard → Project → Credentials and add manually.
In the script, access them like this:
// In dinho_create_test playwrightScript:
await page.goto("https://myapp.com/login");
await page.fill('[name="email"]', credentials.EMAIL);
await page.fill('[name="password"]', credentials.PASSWORD);
What NOT to Test in Production
- Payment flows that charge real cards
- Email sequences that notify real users
- Destructive operations (delete account, etc.)
Use the is_synthetic_test flag to skip these paths when running from Dinho.