diff --git a/Makefile b/Makefile
index b770e718f9d65846cfe6196ae3805851386610f1..91a150aa3fef503546944d6c4bf257c41a6d604b 100644
--- a/Makefile
+++ b/Makefile
@@ -24,6 +24,7 @@ list:
 	@echo "  phpcs            > Run php code sniffer test suite"
 	@echo "  install_services > install services dependencies (virtualenv)"
 	@echo "  shell_services   > Shell into python services"
+	@echo "  test_services    > Starts the services unit tests"
 	@echo "  install_tasks    > install tasks dependencies (virtualenv)"
 	@echo "  shell_tasks      > Shell into python tasks"
 	@echo "  create-db        > Create a database for dev only (need token_enabled=0)"
@@ -95,6 +96,9 @@ install_services:
 shell_services:
 	@docker-compose exec services bash
 
+test_services:
+	@docker-compose exec services /bin/bash -c "source ./venv/bin/activate && pytest"
+
 install_tasks:
 	@docker run --init -it --rm --user $(UID):$(GID) -v $(CURDIR)/tasks:/project -w /project python:3.8 /bin/bash -c "python3 -m venv venv && source /project/venv/bin/activate && pip install -r requirements.txt"
 
diff --git a/services/.gitlab-ci.yml b/services/.gitlab-ci.yml
index 4bfe6473df99eef1ae1f2c6c0752f7ab3184c581..db67bb772e7ac6f85fc018137c5e39b7975df97d 100644
--- a/services/.gitlab-ci.yml
+++ b/services/.gitlab-ci.yml
@@ -1,4 +1,6 @@
 stages:
+    - test
+    - sonar
     - dockerize
     - deploy
 
@@ -6,6 +8,32 @@ variables:
     VERSION: "3.7"
     SONARQUBE_URL: https://sonarqube.lam.fr
 
+test:
+    image: python:3.8
+    stage: test
+    script:
+        - cd services
+        - export PYTHONPATH=/builds/anis/anis-next/services/src
+        - /bin/bash -c "python3 -m venv venv && source ./venv/bin/activate && pip install -r requirements.txt"
+        - /bin/bash -c "source ./venv/bin/activate && pytest --cov=src --cov-report xml:report/coverage.xml --junitxml=report/pytest.xml"
+    artifacts:
+        paths:
+            - services/report
+
+sonar_scanner:
+    image: sonarsource/sonar-scanner-cli:latest
+    stage: sonar
+    script:
+        - cd services
+        - sonar-scanner 
+            -Dsonar.projectKey=anis-services
+            -Dsonar.sources=src
+            -Dsonar.projectVersion=$VERSION
+            -Dsonar.host.url=$SONARQUBE_URL
+            -Dsonar.login=$SONAR_TOKEN_SERVICES
+            -Dsonar.python.coverage.reportPaths=report/coverage.xml
+            -Dsonar.python.xunit.reportPath=report/pytest.xml
+
 dockerize:
     image: docker:stable
     stage: dockerize
diff --git a/services/tests/anis_services/test_utils.py b/services/tests/anis_services/test_utils.py
new file mode 100644
index 0000000000000000000000000000000000000000..22ad5d31a6b5f49196e34416342f820b93f515af
--- /dev/null
+++ b/services/tests/anis_services/test_utils.py
@@ -0,0 +1,20 @@
+import os
+from unittest import mock
+from unittest.mock import call
+import pytest
+
+from anis_services.utils import *
+
+class Object(object):
+    pass
+
+class MockJWT:
+    def decode(self, *args):
+        pass
+
+class TestIfsctoolsUtils:
+
+    @mock.patch.dict(os.environ, {}, clear=True)
+    def test_check_config(self):
+        with pytest.raises(ConfigKeyNotFound):
+            check_config()