diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index ad4600764249e1fc1f4406a1b409a9f8f2750301..5f44b667d17707c50d832e22368b89cd6734d27e 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -17,35 +17,41 @@ stages:
   - test
   - build
 
-variables:
-  POSTGRES_PASSWORD: postgres
-  POSTGRES_DB: funkwhale_network
-
 pre-commit:
   extends: [.pre-commit]
 
-#tests:
-#  stage: test
-#  services:
-#    - name: timescale/timescaledb:latest-pg11
-#     alias: db
-#  image: python:3.9-alpine3.15
-#  before_script:
-#    - apk add python3-dev build-base curl libpq-dev
-#    - curl -sSL https://install.python-poetry.org | python3 -
-#    - export PATH="/root/.local/bin:$PATH"
-#    - poetry install
-#  script:
-#    - poetry run pytest --cov-report xml --cov-report term-missing:skip-covered --cov=funkwhale_network --junitxml=report.xml tests/
-#  variables:
-#    DB_DSN: user=postgres password=postgres dbname=funkwhale_network host=db
-#  artifacts:
-#    expire_in: 2 weeks
-#    reports:
-#      junit: report.xml
-#      coverage_report:
-#        coverage_format: cobertura
-#        path: coverage.xml
+tests:
+  stage: test
+
+  image: $CI_REGISTRY/funkwhale/ci/python:3.9
+  services:
+    - name: timescale/timescaledb:latest-pg11
+      alias: db
+  variables:
+    POSTGRES_PASSWORD: postgres
+    POSTGRES_DB: funkwhale_network
+    DB_DSN: user=postgres password=postgres dbname=funkwhale_network host=db
+  before_script:
+    - |
+      DEBIAN_FRONTEND=noninteractive apt-get update
+      DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
+        libpq-dev
+    - poetry install
+  script:
+    - >
+      poetry run pytest
+        --cov=funkwhale_network
+        --cov-report=xml
+        --cov-report=term-missing:skip-covered
+        --junitxml=report.xml
+        tests/
+  artifacts:
+    expire_in: 2 weeks
+    reports:
+      junit: report.xml
+      coverage_report:
+        coverage_format: cobertura
+        path: coverage.xml
 
 build:
   stage: build