From 675df356deb74b9b8c9a5225aad6d19bb52fc1ec Mon Sep 17 00:00:00 2001 From: YooSunyoung Date: Mon, 27 May 2024 17:24:43 +0200 Subject: [PATCH] Add simple instiatiation test. --- .github/workflows/integration.yml | 2 ++ config.20240405.json | 4 +--- src/scicat_ingestor.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 64ec7ba..58ce3e2 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -24,6 +24,8 @@ jobs: python-version: ${{ inputs.python-version }} - run: python -m pip install --upgrade pip - run: python -m pip install -r requirements/ci.txt + - run: python -m pip install -e . - run: docker-compose version - run: docker-compose -f tests/docker-compose-file-writer.yml up -d + - run: scicat_ingestor --verbose - run: docker-compose -f tests/docker-compose-file-writer.yml down diff --git a/config.20240405.json b/config.20240405.json index e4954af..bc58626 100644 --- a/config.20240405.json +++ b/config.20240405.json @@ -2,9 +2,7 @@ "kafka": { "topics": ["KAFKA_TOPIC_1","KAFKA_TOPIC_2"], "group_id": "GROUP_ID", - "bootstrap_servers": [ - "HOST:9092" - ], + "bootstrap_servers": "file-writer-kafka:9093", "enable_auto_commit": true, "auto_offset_reset": "earliest" }, diff --git a/src/scicat_ingestor.py b/src/scicat_ingestor.py index b9bf2c2..879de0c 100644 --- a/src/scicat_ingestor.py +++ b/src/scicat_ingestor.py @@ -7,12 +7,12 @@ from scicat_logging import build_logger -def quit(logger: logging.Logger) -> None: +def quit(logger: logging.Logger, unexpected: bool = True) -> None: """Log the message and exit the program.""" import sys logger.info("Exiting ingestor") - sys.exit() + sys.exit(1 if unexpected else 0) def main() -> None: