feat: add integration tests against real database (#1247) - #1433
Conversation
- Create docker-compose.test.yml for isolated test Postgres (port 5433) and Redis (port 6380) - Add integration test setup with migration runner, database cleanup, and test isolation - Create test helpers for factory functions (users, tips, refunds, withdrawals, challenges) - Add comprehensive integration tests for auth flow: challenge creation, user registration with unique constraints, concurrent user creation, refresh token lifecycle, cascade deletes - Add integration tests for tips: txHash unique constraint, concurrent creation with P2002 handling, user relations, status transitions, queries, refund relationships - Add integration tests for refunds: tipId unique constraint, concurrent requests with P2002 (validates Akanimoh12#1249 fix), refund-tip relationships, status transitions, cascade deletes - Add integration tests for withdrawals: txHash unique constraint, concurrent submission, user relationships, status transitions, balance calculations - Add npm scripts: test:integration, test:integration:watch, test:db:up, test:db:down, test:db:reset - Create vitest.integration.config.ts for integration test configuration - Apply migrations at test suite start to verify schema validity - Document two-layer testing strategy in README.md with usage guide Note: GitHub Actions workflow will be added separately due to token scope requirements Closes Akanimoh12#1247
|
@ogunjobielijah09-cyber Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
|
| GitGuardian id | GitGuardian status | Secret | Commit | Filename | |
|---|---|---|---|---|---|
| - | - | Generic Password | 0b1841b | backend/docker-compose.test.yml | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secret safely. Learn here the best practices.
- Revoke and rotate this secret.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
Note: GitHub Actions workflow will be added separately due to token scope requirements
Closes #1247
Description
Closes #
Type of Change
Please mark the options that are relevant:
Changes Made
How to Test
Checklist
💻 Smart Contract Changes (if applicable)
cargo fmt -- --checkpasses successfully.cargo clippy -- -D warningsruns without any warnings.cargo test.🎨 Frontend Changes (if applicable)
npm run typecheckornpx tsc --noEmit).npm run lintshows no linting errors.npm run build.⚙️ General
console.logor debug code remains in production files.mainbranch.Screenshots / Demos (if applicable)