Skip to main content

E2E Smoke Testing Guide

Use this guide to verify the core path:

  1. create a job
  2. run the initial qualification attempt on 5 new items
  3. verify job enablement transitions around that initial run
  4. delete job and related analytics

One-Command Smoke Test

npm run e2e:smoke

The script:

  • validates required OpenRouter credentials exist
  • creates a temporary job in disabled state
  • runs the same initial-run orchestration used by job add
  • verifies the job is enabled after the initial run attempt and that a run row exists
  • deletes the job in cleanup

Implementation path:

  • src/scripts/e2eSmoke.ts

Prerequisites

Before running smoke test:

  • OpenRouter API key is configured either in snoopy settings (keychain available) or via SNOOPY_OPENROUTER_API_KEY
  • optional: configure Reddit OAuth fallback credentials for environments where unauthenticated Reddit JSON access is blocked

Check quickly:

snoopy doctor

Optional Environment Variables

  • SNOOPY_E2E_LIMIT default 5
  • SNOOPY_E2E_SUBREDDITS default startups,entrepreneur
  • SNOOPY_E2E_KEEP_JOB default false

Example:

SNOOPY_E2E_LIMIT=5 SNOOPY_E2E_SUBREDDITS=startups,entrepreneur npm run e2e:smoke

Keep job for inspection:

SNOOPY_E2E_KEEP_JOB=true npm run e2e:smoke

Manual Equivalent Flow

If you need full manual control:

  1. Create job:
snoopy job add
  1. Run 5-item test:
snoopy job run <jobRef> --limit 5
  1. Inspect history:
snoopy job runs <jobRef>
  1. Delete and cascade cleanup:
snoopy delete <jobRef>

What Good Output Looks Like

  • Run completes without errors.
  • Exactly 5 new items are processed when --limit 5 is used.
  • Qualification reasons are concise and aligned with job prompt.
  • No repeated fallback reason such as Model output invalid; marked unqualified.

Troubleshooting

If smoke test fails:

  1. Run snoopy doctor.
  2. Verify OpenRouter API key in settings or SNOOPY_OPENROUTER_API_KEY.
  3. If Reddit access is denied in your environment, configure Reddit OAuth fallback credentials in settings.
  4. Check daemon state if relevant (daemon status).
  5. Review logs at <root>/logs/snoopy.log.
  6. Re-run with SNOOPY_E2E_KEEP_JOB=true to inspect persisted data.