diff --git a/CHANGES.md b/CHANGES.md index 4116294..5eaa610 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,9 @@ ## Unreleased - MongoDB: Fixed BSON decoding of `{"$date": 1180690093000}` timestamps +- DynamoDB: Use CrateDB 5.8.3 for testing. 5.8.4 caught a regression with + `OBJECT(IGNORED)` columns: They no longer accept `ARRAY`s of varying + types. ## 2024/09/30 v0.0.20 - DynamoDB: Change CrateDB data model to use (`pk`, `data`, `aux`) columns diff --git a/tests/transform/conftest.py b/tests/transform/conftest.py index 8c33e84..2a7a61d 100644 --- a/tests/transform/conftest.py +++ b/tests/transform/conftest.py @@ -1,4 +1,7 @@ +from typing import Generator + import pytest +from cratedb_toolkit.testing.testcontainers.cratedb import CrateDBTestAdapter from commons_codec.transform.dynamodb import DynamoDBCDCTranslator, DynamoDBFullLoadTranslator from commons_codec.transform.dynamodb_model import PrimaryKeySchema @@ -9,13 +12,24 @@ ] +@pytest.fixture(scope="session") +def cratedb_custom_service() -> Generator[CrateDBTestAdapter, None, None]: + """ + Provide a CrateDB service instance to the test suite. + """ + db = CrateDBTestAdapter(crate_version="5.8.3") + db.start() + yield db + db.stop() + + @pytest.fixture(scope="function") -def cratedb(cratedb_service): +def cratedb(cratedb_custom_service): """ Provide a fresh canvas to each test case invocation, by resetting database content. """ - cratedb_service.reset(tables=RESET_TABLES) - yield cratedb_service + cratedb_custom_service.reset(tables=RESET_TABLES) + yield cratedb_custom_service @pytest.fixture