From ee6d8bdf2ab05ea48308177dc915bcc7e5f326ec Mon Sep 17 00:00:00 2001
From: PAPERMAN Charles <charles.paperman@inria.fr>
Date: Thu, 12 Oct 2023 16:11:07 +0000
Subject: [PATCH] integrate doctest to CI

---
 .gitlab-ci.yml                                   | 16 +++++++++++++++-
 readme_doctests.py => doctest/readme_doctests.py |  0
 2 files changed, 15 insertions(+), 1 deletion(-)
 rename readme_doctests.py => doctest/readme_doctests.py (100%)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 1c83ae1f..d5a5513d 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -13,6 +13,8 @@ build:
     - docker login -u gitlab-ci-token -p "$CI_JOB_TOKEN" "$CI_REGISTRY"
     - docker push "$CI_REGISTRY_IMAGE/qbcontainer"
 
+
+
 lint:
   stage: test
   tags:
@@ -32,11 +34,23 @@ type-checking:
     - python3 -m mypy --install-types --non-interactive querybuilder/ 
 
 test:
+  services:
+    - postgres
+  variables:
+    POSTGRES_DB: custom_db
+    POSTGRES_USER: custom_user
+    POSTGRES_PASSWORD: custom_pass
+  image: postgres
+  script:
   stage: test
   tags:
     - ci.inria.fr
     - medium
   image: "$CI_REGISTRY_IMAGE/qbcontainer"
   script:
-    - pytest --doctest-modules --cov=querybuilder querybuilder
+    - export PGPASSWORD=$POSTGRES_PASSWORD
+    - export PGHOST="postgres"
+    - export PGDATABASE=$POSTGRES_DB
+    - export PGUSER=$POSTGRES_USER
+    - pytest --doctest-modules --cov=querybuilder
   coverage: '/TOTAL.*\s+(\d+%)$/'
diff --git a/readme_doctests.py b/doctest/readme_doctests.py
similarity index 100%
rename from readme_doctests.py
rename to doctest/readme_doctests.py
-- 
GitLab