Skip to content

Commit 8cb8f32

Browse files
committed
OPT: run integration tests as part of a pull request
1 parent 1d5e361 commit 8cb8f32

File tree

4 files changed

+21
-5
lines changed

4 files changed

+21
-5
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: Run integration tests
2+
on:
3+
pull_request:
4+
5+
jobs:
6+
integration_tests:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v4
10+
- run: cd integration_tests && make dctest

config.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,6 @@
5959
dbname=env('DB_DATABASE'),
6060
)
6161
elif env('DB_CONNECTION') == 'postgresql':
62-
63-
host = 'db' if env('INTEGRATION_TEST') else env('DB_HOST', 'localhost')
64-
6562
DATABASE_URL = "postgresql://{user}:{password}@{host}:{port}/{dbname}".format(
6663
user=env('DB_USERNAME', 'root'),
6764
password=env('DB_PASSWORD', ''),

docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
services:
22
db:
33
hostname: db
4-
image: postgres
4+
image: postgres:18
55
restart: always
66
environment:
77
POSTGRES_DB: elekto
88
POSTGRES_USER: root
99
POSTGRES_PASSWORD: root
1010
volumes:
11-
- pgdata:/var/lib/postgresql/data
11+
- pgdata:/var/lib/postgresql
1212
ports:
1313
- '5432:5432'
1414
healthcheck:

integration_tests/docker-compose.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,18 @@ services:
2626
- "8000:8000"
2727
environment:
2828
DB_CONNECTION: postgresql
29+
DB_HOST: db
2930
DB_PORT: 5432
31+
DB_PASSWORD: root
32+
DB_DATABASE: elekto
3033
INTEGRATION_TEST: true
3134
APP_PORT: 8000
35+
META_REPO: https://github.com/elekto-io/elekto.meta.test.git
36+
ELECTION_DIR: elections
37+
META_DEPLOYMENT: local
38+
META_PATH: meta
39+
META_BRANCH: main
40+
META_SECRET: xxx
3241
healthcheck:
3342
test: [ "CMD", "curl", "-f", "http://0.0.0.0:8000/app/" ]
3443
interval: 10s

0 commit comments

Comments
 (0)