66.. image :: https://travis-ci.org/dpkp/kafka-python.svg?branch=master
77 :target: https://travis-ci.org/dpkp/kafka-python
88
9- Test environments are managed via tox. The test suite is run via pytest.
9+ The test suite is run via pytest.
1010
11- Linting is run via pylint, but is generally skipped on pypy due to pylint
12- compatibility / performance issues.
11+ Linting is run via pylint, but is currently skipped during CI/CD due to
12+ accumulated debt. We'd like to transition to ruff!
1313
1414For test coverage details, see https://coveralls.io/github/dpkp/kafka-python
15+ Coverage reporting is currently disabled as we have transitioned from travis
16+ to GH Actions and have not yet re-enabled coveralls integration.
1517
1618The test suite includes unit tests that mock network interfaces, as well as
1719integration tests that setup and teardown kafka broker (and zookeeper)
@@ -21,66 +23,30 @@ fixtures for client / consumer / producer testing.
2123Unit tests
2224------------------
2325
24- To run the tests locally, install tox :
26+ To run the tests locally, install test dependencies :
2527
2628.. code :: bash
2729
28- pip install tox
30+ pip install -r requirements-dev.txt
2931
30- For more details, see https://tox.readthedocs.io/en/latest/install.html
31-
32- Then simply run tox, optionally setting the python environment.
33- If unset, tox will loop through all environments.
32+ Then simply run pytest (or make test) from your preferred python + virtualenv.
3433
3534.. code :: bash
3635
37- tox -e py27
38- tox -e py35
39-
40- # run protocol tests only
41- tox -- -v test.test_protocol
42-
43- # re-run the last failing test, dropping into pdb
44- tox -e py27 -- --lf --pdb
36+ # run protocol tests only (via pytest)
37+ pytest test/test_protocol.py
4538
46- # see available (pytest) options
47- tox -e py27 -- --help
39+ # Run conn tests only (via make)
40+ PYTESTS=test/test_conn.py make test
4841
4942
5043 Integration tests
5144-----------------
5245
5346.. code :: bash
5447
55- KAFKA_VERSION=0.8.2.2 tox -e py27
56- KAFKA_VERSION=1.0.1 tox -e py36
57-
58-
59- Integration tests start Kafka and Zookeeper fixtures. This requires downloading
60- kafka server binaries:
61-
62- .. code :: bash
63-
64- ./build_integration.sh
65-
66- By default, this will install the broker versions listed in build_integration.sh's `ALL_RELEASES `
67- into the servers/ directory. To install a specific version, set the `KAFKA_VERSION ` variable:
68-
69- .. code :: bash
70-
71- KAFKA_VERSION=1.0.1 ./build_integration.sh
48+ KAFKA_VERSION=3.9.0 make test
7249
73- Then to run the tests against a specific Kafka version, simply set the `KAFKA_VERSION `
74- env variable to the server build you want to use for testing:
75-
76- .. code :: bash
77-
78- KAFKA_VERSION=1.0.1 tox -e py36
79-
80- To test against the kafka source tree, set KAFKA_VERSION=trunk
81- [optionally set SCALA_VERSION (defaults to the value set in `build_integration.sh `)]
82-
83- .. code :: bash
8450
85- SCALA_VERSION=2.12 KAFKA_VERSION=trunk ./build_integration.sh
86- KAFKA_VERSION=trunk tox -e py36
51+ Integration tests start Kafka and Zookeeper fixtures. Make will download
52+ kafka server binaries automatically if needed.
0 commit comments