6
6
.. image :: https://travis-ci.org/dpkp/kafka-python.svg?branch=master
7
7
:target: https://travis-ci.org/dpkp/kafka-python
8
8
9
- Test environments are managed via tox. The test suite is run via pytest.
9
+ The test suite is run via pytest.
10
10
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!
13
13
14
14
For 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.
15
17
16
18
The test suite includes unit tests that mock network interfaces, as well as
17
19
integration tests that setup and teardown kafka broker (and zookeeper)
@@ -21,66 +23,30 @@ fixtures for client / consumer / producer testing.
21
23
Unit tests
22
24
------------------
23
25
24
- To run the tests locally, install tox :
26
+ To run the tests locally, install test dependencies :
25
27
26
28
.. code :: bash
27
29
28
- pip install tox
30
+ pip install -r requirements-dev.txt
29
31
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.
34
33
35
34
.. code :: bash
36
35
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
45
38
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
48
41
49
42
50
43
Integration tests
51
44
-----------------
52
45
53
46
.. code :: bash
54
47
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
72
49
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
84
50
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