Skip to content

Commit 62a3a62

Browse files
committed
Chore: Fix software tests
1 parent 649feba commit 62a3a62

File tree

10 files changed

+19
-15
lines changed

10 files changed

+19
-15
lines changed

.github/workflows/mongodb.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ jobs:
7070
pip install "setuptools>=64" --upgrade
7171
7272
# Install package in editable mode.
73-
pip install --use-pep517 --prefer-binary --editable=.[mongodb,test-mongodb,develop]
73+
pip install --use-pep517 --prefer-binary --upgrade --editable=.[mongodb,test-mongodb,develop]
7474
7575
- name: Downgrade pymongo on MongoDB 2
7676
if: matrix.mongodb-version == '2'

cratedb_toolkit/api/model.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class ClientBundle:
1818

1919
adapter: DatabaseAdapter
2020
dbapi: crate.client.connection.Connection
21-
sqlalchemy: sa.Engine
21+
sqlalchemy: sa.engine.Engine
2222

2323

2424
class ClusterBase(abc.ABC):

cratedb_toolkit/testing/testcontainers/minio.py

-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ def __init__(self, *args, **kwargs):
3737
image = "quay.io/minio/minio:latest"
3838
kwargs.setdefault("image", image)
3939
super().__init__(*args, **kwargs)
40-
self.port_to_expose = self.port
4140

4241
@wait_container_is_ready()
4342
def list_object_names(self, bucket_name: str) -> t.List[str]:

cratedb_toolkit/testing/testcontainers/util.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ def get_real_host_address(self) -> str:
4444
Provide Docker-internal full endpoint address `<host>:<port>` of the service.
4545
For example, `172.17.0.4:9000`.
4646
"""
47-
return f"{self.get_real_host_ip()}:{self.port_to_expose}"
47+
port = getattr(self, "port", getattr(self, "port_to_expose", None))
48+
if port is None:
49+
raise ValueError("Unable to discover port number")
50+
return f"{self.get_real_host_ip()}:{port}"
4851

4952

5053
class KeepaliveContainer(DockerContainer):

doc/install.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ which is an extremely fast Python package and project manager.
66

77
Install package with only [fundamental dependencies].
88
```shell
9-
uv pip install --upgrade 'cratedb-toolkit'
9+
uv pip install --upgrade 'cratedb-toolkit' --prerelease=allow
1010
```
1111

1212
Install package including [full dependencies] and [all subsystems].
1313
```shell
14-
uv pip install --upgrade 'cratedb-toolkit[all]'
14+
uv pip install --upgrade 'cratedb-toolkit[all]' --prerelease=allow
1515
```
1616

1717
Verify installation.

doc/sandbox.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ source .venv/bin/activate
1818

1919
Install project in sandbox mode.
2020
```shell
21-
pip install --editable='.[all,develop,docs,test]'
21+
uv pip install --upgrade --editable='.[all,develop,docs,test]' --prerelease=allow
2222
```
2323

2424
Run tests. `TC_KEEPALIVE` keeps the auxiliary service containers running, which

pyproject.toml

+4-3
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ optional-dependencies.kinesis = [
163163
"lorrystream[carabas]>=0.0.6",
164164
]
165165
optional-dependencies.mongodb = [
166-
"commons-codec[mongodb,zyp]>=0.0.21",
166+
"commons-codec[mongodb,zyp]>=0.0.22",
167167
"cratedb-toolkit[io]",
168168
"orjson>=3.3.1,<4",
169169
"pymongo>=3.10.1,<4.10",
@@ -194,8 +194,8 @@ optional-dependencies.test = [
194194
"httpx<0.29",
195195
"ipywidgets<9",
196196
"notebook<8",
197-
"pueblo[dataframe,notebook,testing]",
198-
"pytest<9",
197+
"pueblo[dataframe,notebook]>=0.0.11",
198+
"pytest>=8,<9",
199199
"pytest-cov<7",
200200
"pytest-mock<4",
201201
"responses<0.26",
@@ -329,6 +329,7 @@ show_missing = true
329329
[tool.mypy]
330330
packages = [ "cratedb_toolkit" ]
331331
exclude = [
332+
"cratedb_toolkit/adapter/pymongo/",
332333
]
333334
check_untyped_defs = true
334335
ignore_missing_imports = true

tests/cluster/test_examples_python.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
import pytest
66
import responses
7-
from pytest_notebook.nb_regression import NBRegressionFixture
87

98
import cratedb_toolkit
109

@@ -92,6 +91,7 @@ def test_example_cloud_import_notebook(mocker, mock_cloud_cluster_exists):
9291
"""
9392
Verify the Jupyter Notebook example works.
9493
"""
94+
from pytest_notebook.nb_regression import NBRegressionFixture
9595

9696
# Synthesize a valid environment.
9797
mocker.patch.dict(

tests/io/dynamodb/__init__.py

-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +0,0 @@
1-
import pytest
2-
3-
pytest.importorskip("boto3", reason="Skipping DynamoDB tests because 'boto3' package is not installed")

tests/io/dynamodb/conftest.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1+
# ruff: noqa: E402
12
import logging
23
import time
34
import typing
45

5-
import botocore
66
import pytest
7+
8+
pytest.importorskip("boto3", reason="Skipping DynamoDB tests because 'boto3' package is not installed")
9+
10+
import botocore
711
from yarl import URL
812

913
from cratedb_toolkit.io.dynamodb.adapter import DynamoDBAdapter

0 commit comments

Comments
 (0)