Skip to content

Commit

Permalink
Testing: Add page about software testing with CrateDB (Java and Python)
Browse files Browse the repository at this point in the history
- native: Python unittest, using cr8
- native: pytest-crate, using cr8
- testcontainers: Testcontainers for Java
- testcontainers: Testcontainers for Python (pytest and unittest)
  • Loading branch information
amotl committed Feb 12, 2024
1 parent 1d68543 commit aa1bc95
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,15 @@ Integrations with machine learning frameworks.
:::


:::{grid-item-card} {material-outlined}`model_training;2em` Software Testing
:link: testing
:link-type: ref

Test frameworks and libraries that support software integration testing with
CrateDB.
:::


::::


Expand Down Expand Up @@ -179,6 +188,7 @@ System Metrics <integrate/metrics>
Data Visualization <integrate/visualize>
Business Intelligence <integrate/bi>
Machine Learning <integrate/ml>
Software Testing <integrate/testing>
```

```{toctree}
Expand Down
56 changes: 56 additions & 0 deletions docs/integrate/testing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
(testing)=
# Software Testing with CrateDB

This documentation section lists Java- and Python-based test frameworks
and libraries that support software integration testing with CrateDB.


(python-pytest)=
## Python pytest

The popular [pytest] framework makes it easy to write small tests, yet
scales to support complex functional testing for applications and libraries.
The [pytest-crate] package manages CrateDB instances for running integration
tests against them. It is based on [cr8](#cr8), and provides the `crate`,
`crate_execute`, and `crate_cursor` pytest fixtures on top.

- [Using "pytest-crate" with CrateDB and pytest]


(cr8)=
(python-unittest)=
## Python unittest

[cr8], a collection of tools for CrateDB developers, provides primitives to
manage CrateDB single-node and multi-node instances through its [run-crate]
subsystem, that can be used to create test layers for Python's built-in
[unittest] framework.

- [Using "cr8" test layers with CrateDB and unittest]


(testcontainers)=
## Testcontainers

[Testcontainers] is an open source framework for providing throwaway,
lightweight instances of databases, message brokers, web browsers, or
just about anything that can run in a Docker container.

CrateDB provides Testcontainers implementations for both Java and Python.

- [Using "Testcontainers for Java" with CrateDB]
- [Using "Testcontainers for Python" with CrateDB and pytest]
- [Using "Testcontainers for Python" with CrateDB and unittest]


[cr8]: https://pypi.org/project/cr8/
[pytest]: https://docs.pytest.org/
[pytest-crate]: https://pypi.org/project/pytest-crate/
[run-crate]: https://pypi.org/project/cr8/#run-crate
[Testcontainers]: https://testcontainers.com/
[unittest]: https://docs.python.org/3/library/unittest.html
[Using "cr8" test layers with CrateDB and unittest]: https://github.com/crate/cratedb-examples/tree/main/testing/native/python-unittest
[Using "pytest-crate" with CrateDB and pytest]: https://github.com/crate/cratedb-examples/tree/main/testing/native/python-pytest
[Using "Testcontainers for Java" with CrateDB]: https://github.com/crate/cratedb-examples/tree/main/testing/testcontainers/java
[Using "Testcontainers for Python" with CrateDB and pytest]: https://github.com/crate/cratedb-examples/tree/main/testing/testcontainers/python-pytest
[Using "Testcontainers for Python" with CrateDB and unittest]: https://github.com/crate/cratedb-examples/tree/main/testing/testcontainers/python-unittest

0 comments on commit aa1bc95

Please sign in to comment.