From 1bba21bf1b861b800b256b5a0f30d5d6b8aae242 Mon Sep 17 00:00:00 2001 From: Radoslav Dimitrov Date: Tue, 4 Feb 2025 15:34:32 +0200 Subject: [PATCH] Exit with non-zero if 1 or more tests failed (#905) * Exit with non-zero if 1 or more tests failed Signed-off-by: Radoslav Dimitrov * Run make format Signed-off-by: Radoslav Dimitrov --------- Signed-off-by: Radoslav Dimitrov --- src/codegate/api/v1.py | 2 +- tests/integration/integration_tests.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/codegate/api/v1.py b/src/codegate/api/v1.py index 8ba47ef9..cf565300 100644 --- a/src/codegate/api/v1.py +++ b/src/codegate/api/v1.py @@ -2,7 +2,6 @@ from uuid import UUID import requests -from codegate.pipeline.base import AlertSeverity import structlog from fastapi import APIRouter, Depends, HTTPException, Response from fastapi.responses import StreamingResponse @@ -12,6 +11,7 @@ from codegate import __version__ from codegate.api import v1_models, v1_processing from codegate.db.connection import AlreadyExistsError, DbReader +from codegate.pipeline.base import AlertSeverity from codegate.providers import crud as provendcrud from codegate.workspaces import crud diff --git a/tests/integration/integration_tests.py b/tests/integration/integration_tests.py index 28830af6..96ebcdfc 100644 --- a/tests/integration/integration_tests.py +++ b/tests/integration/integration_tests.py @@ -291,6 +291,10 @@ async def main(): ) all_tests_passed = all_tests_passed and provider_tests_passed + # Exit with status code 1 if any tests failed + if not all_tests_passed: + sys.exit(1) + if __name__ == "__main__": asyncio.run(main())