From 3791455b24a5911624e30c96afd0f5f65f4c9cfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Gajdu=C5=A1ek?= Date: Mon, 3 Jun 2024 19:00:27 +0200 Subject: [PATCH] Enforce the Dynaconf validaton --- .github/workflows/pull_request.yml | 1 + robottelo/config/__init__.py | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 382a20b0e48..2bb3fafa235 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -9,6 +9,7 @@ env: PYCURL_SSL_LIBRARY: openssl ROBOTTELO_BUGZILLA__API_KEY: ${{ secrets.BUGZILLA_KEY }} ROBOTTELO_JIRA__API_KEY: ${{ secrets.JIRA_KEY }} + ROBOTTELO_ROBOTTELO__unit_test: true jobs: codechecks: diff --git a/robottelo/config/__init__.py b/robottelo/config/__init__.py index d761dd06e91..ab80f04cad1 100644 --- a/robottelo/config/__init__.py +++ b/robottelo/config/__init__.py @@ -40,10 +40,12 @@ def get_settings(): try: settings.validators.validate() except ValidationError as err: - logger.warning( - f'Dynaconf validation failed, continuing for the sake of unit tests\n{err}' - ) - + if settings.robottelo.get('unit_test'): + logger.warning( + f'Dynaconf validation failed, continuing for the sake of unit tests\n{err}' + ) + else: + raise err return settings