Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 41 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,31 @@ pnpm test -- --coverage src/__tests__/features.test.ts

### Integration Tests

Integration tests require the following environment variables to be set in your `.env` file:
Integration tests require Redis to be running. You can start Redis using Docker Compose:

```bash
docker compose -f docker-compose.test.yml up -d
```

Then run the integration tests:

```bash
pnpm test:integration
```

Alternatively, you can run integration tests manually with Redis running:

```bash
pnpm test -- --testPathPattern='integration|simulate'
```

When finished, stop Redis:

```bash
docker compose -f docker-compose.test.yml down
```

**Environment variables required:**

- `STELLAR_HORIZON_URL` — URL to Stellar Horizon server (e.g., `https://horizon.stellar.org`)
- `STELLAR_RPC_URL` — URL to Stellar RPC endpoint (e.g., `https://soroban-testnet.stellar.org`)
Expand Down Expand Up @@ -219,6 +243,22 @@ type(scope): short description
| `test` | Adding or updating tests |
| `chore` | Maintenance, dependency updates |

### Scopes

All commits **must** include a scope from this list:

| Scope | Purpose |
|---|---|
| `api` | API endpoints and controllers |
| `services` | Business logic and service layer |
| `middleware` | Middleware (auth, logging, caching, etc.) |
| `config` | Configuration and environment setup |
| `utils` | Utility functions and helpers |
| `docs` | Documentation and guides |
| `infra` | Infrastructure, deployment, Docker, Kubernetes |
| `tests` | Test suite and test infrastructure |
| `dx` | Developer experience (tooling, build, linting) |

### Examples

```
Expand Down
7 changes: 7 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
module.exports = {
extends: ["@commitlint/config-conventional"],
rules: {
'scope-enum': [
2,
'always',
['api', 'services', 'middleware', 'config', 'utils', 'docs', 'infra', 'tests', 'dx'],
],
},
};
22 changes: 22 additions & 0 deletions docker-compose.test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Docker Compose for integration tests
# Usage: docker compose -f docker-compose.test.yml up -d
# Then run: pnpm test:integration

services:
redis:
image: redis:7-alpine
ports:
- "6379:6379"
restart: unless-stopped
networks:
- test_net
command: redis-server --appendonly no
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 5

networks:
test_net:
driver: bridge
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"solhint": "solhint 'contracts/**/*.sol'",
"test": "jest",
"test:coverage": "jest --coverage",
"test:integration": "docker compose -f docker-compose.test.yml up -d && jest --testPathPattern='integration|simulate' && docker compose -f docker-compose.test.yml down",
"prepare": "husky",
"load-test": "node scripts/load-test.js"
},
Expand Down
Loading