unit test repairs
All checks were successful
Deploy to Test Environment / deploy-to-test (push) Successful in 17m42s

This commit is contained in:
2026-01-12 11:51:48 -08:00
parent 87d75d0571
commit 7a1bd50119
2 changed files with 34 additions and 1 deletions

View File

@@ -628,6 +628,37 @@ pm2 restart all
### Step 13: Test Error Tracking
You can test Bugsink is working before configuring the flyer-crawler application.
Switch to the bugsink user and open a Python shell:
```bash
sudo su - bugsink
source venv/bin/activate
bugsink-manage shell
```
In the Python shell, send a test message using the **backend DSN** from Step 11:
```python
import sentry_sdk
sentry_sdk.init("https://YOUR_BACKEND_KEY@bugsink.yourdomain.com/1")
sentry_sdk.capture_message("Test message from Bugsink setup")
exit()
```
Exit back to root:
```bash
exit
```
Check the Bugsink UI - you should see the test message appear in the `flyer-crawler-backend` project.
### Step 14: Test from Flyer-Crawler Application (After App Setup)
Once the flyer-crawler application is installed and configured with the DSNs from Step 12:
```bash
cd /opt/flyer-crawler
npx tsx scripts/test-bugsink.ts

View File

@@ -3,6 +3,8 @@ import { mockLogger } from '../utils/mockLogger';
// Globally mock the logger service so individual test files don't have to.
// This ensures 'import { logger } from ...' always returns the mock.
// IMPORTANT: Must also export createScopedLogger as it's used by aiService.server.ts
vi.mock('../../services/logger.server', () => ({
logger: mockLogger,
}));
createScopedLogger: vi.fn(() => mockLogger),
}));