Skip to content

Commit ef73192

Browse files
committed
Remove tox.ini; update testing docs
1 parent 7e9b86b commit ef73192

File tree

5 files changed

+17
-100
lines changed

5 files changed

+17
-100
lines changed

.github/workflows/python-package.yml

-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ jobs:
6565
sudo apt install -y libsnappy-dev libzstd-dev
6666
python -m pip install --upgrade pip
6767
pip install -r requirements-dev.txt
68-
pip install tox-gh-actions
6968
- name: Pylint
7069
run: pylint --recursive=y --errors-only --exit-zero kafka test
7170
- name: Setup java

docs/tests.rst

+15-49
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@ Tests
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

1414
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.
1517

1618
The test suite includes unit tests that mock network interfaces, as well as
1719
integration tests that setup and teardown kafka broker (and zookeeper)
@@ -21,66 +23,30 @@ fixtures for client / consumer / producer testing.
2123
Unit 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.

pytest.ini

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[pytest]
2+
log_format = %(created)f %(filename)-23s %(threadName)s %(message)s

requirements-dev.txt

-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,5 @@ pytest-pylint
1313
python-snappy
1414
Sphinx
1515
sphinx-rtd-theme
16-
tox
1716
xxhash
1817
zstandard

tox.ini

-49
This file was deleted.

0 commit comments

Comments
 (0)