crate / crate/cratedb-toolkit

[TESTING] Make "Testcontainers for Python" implementation cluster-ready

Open
#57 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
10
Forks
5
Avg merge
7d 5h
Merged PRs (30d)
7

Description

## Introduction

We are aiming to provide canonical "Testcontainers" implementations for Java and Python, per [testcontainers-java](https://github.com/testcontainers/testcontainers-java) and [testcontainers-python](https://github.com/testcontainers/testcontainers-python).

- At [Testcontainers for Java and CrateDB](https://github.com/crate/cratedb-examples/tree/main/testing/testcontainers/java), we demonstrate how to run integration tests of Java applications with CrateDB, based on [Testcontainers for Java](https://github.com/testcontainers/testcontainers-java), see https://github.com/testcontainers/testcontainers-java/pull/6790.
- https://github.com/crate/cratedb-examples/issues/72 needs to be resolved by working through the backlog.

## About

At the spots enumerated below, we added the first version of a corresponding Python implementation, originally conceived at https://github.com/daq-tools/lorrystream/pull/47.

- Implementation: [cratedb_toolkit/testing/testcontainers/cratedb.py](https://github.com/crate-workbench/cratedb-toolkit/blob/77a2ebc/cratedb_toolkit/testing/testcontainers/cratedb.py)
- pytest fixtures: [tests/conftest.py](https://github.com/crate-workbench/cratedb-toolkit/blob/77a2ebc/tests/conftest.py)
- test case: [tests/testing/test_cratedb_sqlalchemy.py](https://github.com/crate-workbench/cratedb-toolkit/blob/77a2ebc/tests/testing/test_cratedb_sqlalchemy.py)

## Backlog

- [ ] Add documentation
- [ ] GH-53
- [x] GH-58
- [ ] Currently, the adapter and test layer is being exercised using an SQLAlchemy connection and corresponding test case. It makes sense to also exercise and demonstrate a pure DBAPI-based variant of the same thing.
- [ ] It will be nice to have a modern test layer which forms a cluster, for both Java and Python. I think cr8 has it already?
- [ ] Cherry-pick CrateDB invocation options from cr8: `'-Cdiscovery.initial_state_timeout=0', '-Cnetwork.host=127.0.0.1', '-Cudc.enabled=false', '-Ccluster.name=cr8-tests'`
- [ ] Revisit downstream issues https://github.com/crate/cratedb-examples/issues/72 and https://github.com/crate/cratedb-examples/issues/282.
- [ ] Upstream to [testcontainers-python](https://github.com/testcontainers/testcontainers-python).

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.