Compare commits

...

6 Commits

Author SHA1 Message Date
Marc 'risson' Schmitt
3ee2e70f7b bigger pool
Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
2026-03-16 14:09:09 +01:00
Marc 'risson' Schmitt
3d1f28c6c0 fixup
Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
2026-03-12 18:13:37 +01:00
Marc 'risson' Schmitt
66d8c04404 fixup
Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
2026-03-12 17:58:09 +01:00
Marc 'risson' Schmitt
776f691c00 fixup
Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
2026-03-12 17:56:33 +01:00
Marc 'risson' Schmitt
c5f9a25a84 wip
Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
2026-03-12 17:47:30 +01:00
Marc 'risson' Schmitt
fa06af35e5 root: run tests with pgdog
Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
2026-03-12 17:40:01 +01:00
7 changed files with 69 additions and 13 deletions

View File

@@ -11,6 +11,13 @@ services:
ports:
- 5432:5432
restart: always
pgdog:
image: ghcr.io/pgdogdev/pgdog:latest
volumes:
- ./pgdog.toml:/pgdog/pgdog.toml:ro
ports:
- 127.0.0.1:6432:6432
restart: always
s3:
container_name: s3
image: docker.io/zenko/cloudserver

18
.github/actions/setup/pgdog.toml vendored Normal file
View File

@@ -0,0 +1,18 @@
[general]
host = "[::]"
port = 6432
passthrough_auth = "enabled_plain"
prepared_statements = "extended_anonymous"
pub_sub_channel_size = 8192
[admin]
password = "admin"
[[databases]]
host = "postgresql"
name = "postgres"
[[databases]]
host = "postgresql"
name = "authentik"
[[databases]]
host = "postgresql"
name = "test_authentik"

View File

@@ -128,7 +128,7 @@ jobs:
CI_RUN_ID: ${{ matrix.run_id }}
CI_TOTAL_RUNS: "5"
run: |
uv run make ci-test
make ci-test glob="authentik"
- uses: ./.github/actions/test-results
if: ${{ always() }}
with:
@@ -157,7 +157,7 @@ jobs:
CI_RUN_ID: ${{ matrix.run_id }}
CI_TOTAL_RUNS: "5"
run: |
uv run make ci-test
make ci-test glob="authentik"
- uses: ./.github/actions/test-results
if: ${{ always() }}
with:
@@ -173,8 +173,7 @@ jobs:
uses: helm/kind-action@ef37e7f390d99f746eb8b610417061a60e82a6cc # v1.14.0
- name: run integration
run: |
uv run coverage run manage.py test tests/integration
uv run coverage xml
make ci-test glob="tests/integration"
- uses: ./.github/actions/test-results
if: ${{ always() }}
with:
@@ -229,8 +228,7 @@ jobs:
npm run build:sfe
- name: run e2e
run: |
uv run coverage run manage.py test ${{ matrix.job.glob }}
uv run coverage xml
make ci-test glob="${{ matrix.job.glob }}"
- uses: ./.github/actions/test-results
if: ${{ always() }}
with:
@@ -272,8 +270,7 @@ jobs:
npm run build:sfe
- name: run conformance
run: |
uv run coverage run manage.py test ${{ matrix.job.glob }}
uv run coverage xml
make ci-test glob="${{ matrix.job.glob }}"
- uses: ./.github/actions/test-results
if: ${{ always() }}
with:

View File

@@ -126,17 +126,22 @@ install: node-install docs-install core-install ## Install all requires depende
dev-drop-db:
$(eval pg_user := $(shell $(UV) run python -m authentik.lib.config postgresql.user 2>/dev/null))
$(eval pg_pass := $(shell $(UV) run python -m authentik.lib.config postgresql.password 2>/dev/null))
$(eval pg_host := $(shell $(UV) run python -m authentik.lib.config postgresql.host 2>/dev/null))
$(eval pg_name := $(shell $(UV) run python -m authentik.lib.config postgresql.name 2>/dev/null))
dropdb -U ${pg_user} -h ${pg_host} ${pg_name} || true
PGPASSWORD="${pg_pass}" psql -U ${pg_user} -h ${pg_host} postgres -c "SELECT pg_terminate_backend(pg_stat_activity.pid) FROM pg_stat_activity WHERE pg_stat_activity.datname = '${pg_name}'"
PGPASSWORD="${pg_pass}" dropdb -U ${pg_user} -h ${pg_host} ${pg_name} || true
# Also remove the test-db if it exists
dropdb -U ${pg_user} -h ${pg_host} test_${pg_name} || true
PGPASSWORD="${pg_pass}" psql -U ${pg_user} -h ${pg_host} postgres -c "SELECT pg_terminate_backend(pg_stat_activity.pid) FROM pg_stat_activity WHERE pg_stat_activity.datname = 'test_${pg_name}'"
PGPASSWORD="${pg_pass}" dropdb -U ${pg_user} -h ${pg_host} test_${pg_name} || true
dev-create-db:
$(eval pg_user := $(shell $(UV) run python -m authentik.lib.config postgresql.user 2>/dev/null))
$(eval pg_pass := $(shell $(UV) run python -m authentik.lib.config postgresql.password 2>/dev/null))
$(eval pg_host := $(shell $(UV) run python -m authentik.lib.config postgresql.host 2>/dev/null))
$(eval pg_name := $(shell $(UV) run python -m authentik.lib.config postgresql.name 2>/dev/null))
createdb -U ${pg_user} -h ${pg_host} ${pg_name}
PGPASSWORD="${pg_pass}" createdb -U ${pg_user} -h ${pg_host} ${pg_name} || true
PGPASSWORD="${pg_pass}" createdb -U ${pg_user} -h ${pg_host} test_${pg_name} || true
dev-reset: dev-drop-db dev-create-db migrate ## Drop and restore the Authentik PostgreSQL instance to a "fresh install" state.
@@ -352,7 +357,7 @@ ci-bandit: ci--meta-debug
ci-pending-migrations: ci--meta-debug
$(UV) run ak makemigrations --check
ci-test: ci--meta-debug
$(UV) run coverage run manage.py test --keepdb authentik
ci-test: ci--meta-debug dev-create-db
$(UV) run coverage run manage.py test --keepdb $(glob)
$(UV) run coverage report
$(UV) run coverage xml

View File

@@ -12,6 +12,14 @@ services:
ports:
- 127.0.0.1:5432:5432
restart: always
pgdog:
container_name: pgdog
image: ghcr.io/pgdogdev/pgdog:latest
volumes:
- ./pgdog.toml:/pgdog/pgdog.toml:ro
ports:
- 127.0.0.1:6432:6432
restart: always
s3:
container_name: s3
image: docker.io/zenko/cloudserver

View File

@@ -18,6 +18,7 @@ def generate_local_config() -> dict[str, Any]:
"secret_key": generate_id(),
"postgresql": {
"user": "postgres",
"port": 6432,
},
"outposts": {
"container_image_base": "ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)s",

20
scripts/pgdog.toml Normal file
View File

@@ -0,0 +1,20 @@
[general]
host = "[::]"
port = 6432
auth_type = "trust"
passthrough_auth = "enabled_plain"
prepared_statements = "extended_anonymous"
pub_sub_channel_size = 8192
[admin]
password = "admin"
[[databases]]
host = "postgresql"
name = "postgres"
[[databases]]
host = "postgresql"
name = "authentik"
pool_size = 8
[[databases]]
host = "postgresql"
name = "test_authentik"