Skip to content

Commit

Permalink
Add pg options for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentAntoine committed Jan 14, 2025
1 parent 445c3a4 commit 0c3d038
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ dev-run-keycloak:

dev-run-infra:
@echo "Preparing database"
docker compose up -d db
docker compose -f docker-compose.yml -f docker-compose-test.yml up -d db
@echo "Waiting for TimescaleDB to be ready to accept connections"
@while [ -z "$$(docker logs monitorenv_database 2>&1 | grep -o "database system is ready to accept connections")" ]; \
do \
Expand Down Expand Up @@ -135,7 +135,7 @@ docker-push-app:
test-init-infra-env:
npm i @import-meta-env/[email protected] && npx import-meta-env-prepare -u -x ./.env.infra.example -p ./.env.test.defaults
test-run-infra-for-frontend:
export MONITORENV_VERSION=$(VERSION) && docker compose --profile=test up -d
export MONITORENV_VERSION=$(VERSION) && docker compose --profile=test -f docker-compose.yml -f docker-compose-test.yml up -d
test: test-back
cd frontend && CI=true npm run test:unit

Expand Down
43 changes: 43 additions & 0 deletions docker-compose-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
services:
db:
command:
- "-c"
- "shared_buffers=4096MB"
- "-c"
- "work_mem=5006kB"
- "-c"
- "maintenance_work_mem=1955MB"
- "-c"
- "effective_io_concurrency=200"
- "-c"
- "max_worker_processes=19"
- "-c"
- "max_parallel_workers_per_gather=4"
- "-c"
- "max_parallel_workers=8"
- "-c"
- "wal_buffers=16MB"
- "-c"
- "max_wal_size=1GB"
- "-c"
- "min_wal_size=512MB"
- "-c"
- "shared_preload_libraries=pg_stat_statements"
- "-c"
- "pg_stat_statements.max=10000"
- "-c"
- "pg_stat_statements.track=all"
- "-c"
- "max_connections=100"
- "-c"
- "checkpoint_completion_target=0.9"
- "-c"
- "random_page_cost=1.1"
- "-c"
- "effective_cache_size=11733MB"
- "-c"
- "default_statistics_target=500"
- "-c"
- "max_locks_per_transaction=128"
- "-c"
- "jit=off"

0 comments on commit 0c3d038

Please sign in to comment.