pytest-kafkavents
PyTest Kafkavents is a plugin for real time streaming of test result events to a Kafka instance. Events can also be logged for batch replay of events via another utility (in the works).
Steps to use pytest-kafkavents
- Clone me (soon to be pip install me)
git clone https://github.com/grandcentralstation/pytest-kafkavents.git
To install for dev
pip install -e .
-
Create a Kafka instance on Red Hat OpenShift Streams for Apache Kafka
-
Download and install the client from the Apache Kafka client website.
SIDENOTE: Pytest-Kafkavent uses the Confluent Python Kafka library
On Fedora...
dnf info python3-confluent-kafka
pip show confluent-kafka
-
Copy and configure app-services.properties template to your local kafka client bin directory and fill-in info for your instance.
-
Setup env variables
export KV_BOOTSTRAP_SERVER=my-kafka-example.rhcloud.com:443
- Create topics (with the client command)
./kafka-topics.sh --create --topic kafkavent --bootstrap-server my-kafka-n--u-bvmxxe-dvgycp-axfjmaftyk.bf2.kafka.rhcloud.com:443 --command-config ../config/app-services.properties
./kafka-topics.sh --create --topic kafkavent-failed --bootstrap-server my-kafka-n--u-bvmxxe-dvgycp-axfjmaftyk.bf2.kafka.rhcloud.com:443 --command-config ../config/app-services.properties
./kafka-topics.sh --create --topic kafkavent-infra --bootstrap-server my-kafka-n--u-bvmxxe-dvgycp-axfjmaftyk.bf2.kafka.rhcloud.com:443 --command-config ../config/app-services.properties
- Start one consumer in one window to see pytest-kafkavent messages for all tests
./kafka-console-consumer.sh --bootstrap-server $KV_BOOTSTRAP_SERVER \
--consumer.config ../config/app-services.properties --from-beginning --topic kafkavents
- Start another consumer in another window to see pytest-kafkavent messages for failed tests only
./kafka-console-consumer.sh --bootstrap-server $KV_BOOTSTRAP_SERVER \
--consumer.config ../config/app-services.properties --from-beginning --topic kafkavents-failed
- Run the example pytest test scripts
pytest example_tests/ --junitxml=/tmp/kafkavent.xml --kv-topics my-other-topic
pytest example_tests/ -q --kv-conf examples/kafka_conf.json \
--kv-topics kafkavent --kv-topics-failed kafkavent-failed
- Or just pull the container from Quay.io :-)
TODO: create a container with all of this goodness in it, upload to Quay.io, and link here
Use the test generator...
pytest example_tests/ --kv-conf examples/kafka_conf.json \
--kv-topics kafkavent --kv-topics-failed kafkavent-failed \
--kv-eventlog=/tmp/kafkavent.log -k test_kafkavents --kv-test 4,1,1,1
Metadata
Release files for pytest-kafkavents 0.2.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pytest-kafkavents-0.2.2.1.tar.gz | 20.3 kB | Without provenance | Details for pytest-kafkavents-0.2.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pytest_kafkavents-0.2.2.1-py3-none-any.whl | Python 3 | none | any | Details for pytest_kafkavents-0.2.2.1-py3-none-any.whl |
Total release size: 38.9 kB
Release files / pytest-kafkavents-0.2.2.1.tar.gz
| Download URL | pytest-kafkavents-0.2.2.1.tar.gz |
|---|---|
| Size | 20.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
087103a49fc3a971d37782154be6b34857d8387fc8aea33e7763db0801120870
|
|
BLAKE2b-256 checksum How to use checksums |
942ac11de6c568d1313f3b5b2dc34f44954ccda17122ac8d96d3f03bae445830
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7
|
Release files / pytest_kafkavents-0.2.2.1-py3-none-any.whl
| Download URL | pytest_kafkavents-0.2.2.1-py3-none-any.whl |
|---|---|
| Size | 18.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
16010b20e30271a6995519fadeb7488f5687a27ac1e2c0977e7e1e87c1cf3219
|
|
BLAKE2b-256 checksum How to use checksums |
448b43586faecc0bf71dc8592d7b466e4b55f6530ad195a440370e9bfc4550a1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7
|
Security for pytest-kafkavents 0.2.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.