From d00f23f381395fff2758767e5ba168452892a180 Mon Sep 17 00:00:00 2001 From: Michael Sesterhenn Date: Tue, 4 Dec 2018 17:50:44 -0600 Subject: [PATCH 1/8] Add import statement to ease importing. --- robotframework_pykafka/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/robotframework_pykafka/__init__.py b/robotframework_pykafka/__init__.py index e69de29..20547be 100644 --- a/robotframework_pykafka/__init__.py +++ b/robotframework_pykafka/__init__.py @@ -0,0 +1 @@ +from robotframework_pykafka import * From b0a78e33945d6598dc96156bad6f195658cb575e Mon Sep 17 00:00:00 2001 From: Michael Sesterhenn Date: Tue, 4 Dec 2018 17:50:52 -0600 Subject: [PATCH 2/8] Update imports. --- tests/json-produce-consume.robot | 8 +++++++- tests/text-produce-consume.robot | 6 +++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/tests/json-produce-consume.robot b/tests/json-produce-consume.robot index 636089b..a91544a 100644 --- a/tests/json-produce-consume.robot +++ b/tests/json-produce-consume.robot @@ -1,5 +1,11 @@ *** Settings *** -Library ../robotframework_pykafka/robotframework_pykafka.py +# For lib testing: +#Library ../robotframework_pykafka/robotframework_pykafka.py + +# Normal way to import when installed from pip: +Library robotframework_pykafka + +# Needed for JSON manipulation: Library JSONLibrary *** Test Cases *** diff --git a/tests/text-produce-consume.robot b/tests/text-produce-consume.robot index 89f0b08..9ada933 100644 --- a/tests/text-produce-consume.robot +++ b/tests/text-produce-consume.robot @@ -1,5 +1,9 @@ *** Settings *** -Library ../robotframework_pykafka/robotframework_pykafka.py +# For lib testing: +#Library ../robotframework_pykafka/robotframework_pykafka.py + +# Normal way to import when installed from pip: +Library robotframework_pykafka *** Test Cases *** Test Producing and Consuming a Message From 6d0e35683872e34cf1ee19990c5b88d640961d26 Mon Sep 17 00:00:00 2001 From: Michael Sesterhenn Date: Tue, 4 Dec 2018 17:51:14 -0600 Subject: [PATCH 3/8] Add dependency install info, how to run tests, and fix importing instructions. --- README.md | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f772a42..0f7aca5 100644 --- a/README.md +++ b/README.md @@ -12,16 +12,34 @@ Support is guaranteed for Python 2.7.X only at this time. It has not been teste ### Installing +#### Dependencies + +The following dependencies are required for robotframework-pykafka. + +``` +pip install [-U] [--user] \ + robotframework \ + robotframework-jsonlibrary \ + pykafka +``` + +Robotframework-jsonlibrary is not technically required for the library but the test examples use it, and it is recommended for JSON manipulation. + +#### Installing this library + ``` -pip install [-U --user] robotframework robotframework-pykafka +pip install [-U ] [--user] robotframework-pykafka + robotframework-pykafka ``` ### Importing To import this library use the following command: - ```Library robotframework_pykafka.robotframework_pykafka``` - +``` +Library robotframework_pykafka +``` + ### Kafka Version Support Support is guaranteed for 1.0.X only at this time. It has not been tested on anything else. @@ -79,6 +97,14 @@ For both the "Kafka Set Consumer Offset" keywords, the consumerGroupName is opti See the tests/ directory for some example tests of a kafka streams application. +### Running the tests + +``` +cd tests +OUTPUTDIR=testresults +robot -d $OUTPUTDIR ./text-produce-consume.robot ./json-produce-consume.robot +``` + ## TODO 1. Support for producing JSON (ie. use dict as argument that is converted internally to JSON string, "Kafka Produce JSON") From 33e7b7164497684b11c132cf99d5d4868a574488 Mon Sep 17 00:00:00 2001 From: Michael Sesterhenn Date: Thu, 13 Dec 2018 09:53:40 -0600 Subject: [PATCH 4/8] Fix lib import for local testing. --- .gitignore | 1 + README.md | 4 ++++ tests/json-produce-consume.robot | 2 +- tests/text-produce-consume.robot | 2 +- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index a70ff81..23dff20 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ *.pyc results/ +tests/testresults/ ### VirtualEnv template # Virtualenv diff --git a/README.md b/README.md index 0f7aca5..6c5d31d 100644 --- a/README.md +++ b/README.md @@ -97,8 +97,12 @@ For both the "Kafka Set Consumer Offset" keywords, the consumerGroupName is opti See the tests/ directory for some example tests of a kafka streams application. +They are meant to run against a simple kafka streaming app on github. + ### Running the tests +First get kafka and this app running: [https://github.com/invadergir/kafka-streams-scala-template](https://github.com/invadergir/kafka-streams-scala-template) + ``` cd tests OUTPUTDIR=testresults diff --git a/tests/json-produce-consume.robot b/tests/json-produce-consume.robot index a91544a..574ca84 100644 --- a/tests/json-produce-consume.robot +++ b/tests/json-produce-consume.robot @@ -1,6 +1,6 @@ *** Settings *** # For lib testing: -#Library ../robotframework_pykafka/robotframework_pykafka.py +#Library ../robotframework_pykafka/ # Normal way to import when installed from pip: Library robotframework_pykafka diff --git a/tests/text-produce-consume.robot b/tests/text-produce-consume.robot index 9ada933..a854e69 100644 --- a/tests/text-produce-consume.robot +++ b/tests/text-produce-consume.robot @@ -1,6 +1,6 @@ *** Settings *** # For lib testing: -#Library ../robotframework_pykafka/robotframework_pykafka.py +#Library ../robotframework_pykafka/ # Normal way to import when installed from pip: Library robotframework_pykafka From 6f96debe02d18b1a9997497b943a0e0fd21b7d1a Mon Sep 17 00:00:00 2001 From: Michael Sesterhenn Date: Mon, 17 Dec 2018 16:59:34 -0600 Subject: [PATCH 5/8] Updated requirements.txt to be >= for all. --- requirements.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index 57627ce..14a5b4c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ robotframework >= 3.0.4 -pykafka == 2.7.0 -robotframework-jsonlibrary == 0.2 \ No newline at end of file +pykafka >= 2.7.0 +robotframework-jsonlibrary >= 0.2 From 396453bffc2d3a08e27e71bab150c774aff4ae10 Mon Sep 17 00:00:00 2001 From: Michael Sesterhenn Date: Mon, 17 Dec 2018 17:20:44 -0600 Subject: [PATCH 6/8] Update README --- README.md | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 6c5d31d..0da51b7 100644 --- a/README.md +++ b/README.md @@ -14,27 +14,22 @@ Support is guaranteed for Python 2.7.X only at this time. It has not been teste #### Dependencies -The following dependencies are required for robotframework-pykafka. +This following dependencies are downloaded when you install robotframework-pykafka: -``` -pip install [-U] [--user] \ - robotframework \ - robotframework-jsonlibrary \ - pykafka -``` +* robotframework +* pykafka Robotframework-jsonlibrary is not technically required for the library but the test examples use it, and it is recommended for JSON manipulation. #### Installing this library ``` -pip install [-U ] [--user] robotframework-pykafka - robotframework-pykafka +pip install [-U ] [--user] robotframework-pykafka ``` ### Importing -To import this library use the following command: +To import this library into your robot test, use the following command: ``` Library robotframework_pykafka From f4b1639a37bdc5824409ddd047094ea695a83bc7 Mon Sep 17 00:00:00 2001 From: Michael Sesterhenn Date: Mon, 17 Dec 2018 17:20:56 -0600 Subject: [PATCH 7/8] jsonlibrary is not required. --- requirements.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 14a5b4c..0247696 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,2 @@ robotframework >= 3.0.4 pykafka >= 2.7.0 -robotframework-jsonlibrary >= 0.2 From a4e36172b9b35b0f8528196c71a5989899010437 Mon Sep 17 00:00:00 2001 From: Michael Sesterhenn Date: Mon, 17 Dec 2018 17:26:43 -0600 Subject: [PATCH 8/8] Update install_requires, download_url, version. --- setup.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 304a865..8416329 100644 --- a/setup.py +++ b/setup.py @@ -3,15 +3,16 @@ setup( name='robotframework_pykafka', packages=['robotframework_pykafka'], # this must be the same as the name above - version='0.0.9', + version='0.10', install_requires=[ - + 'robotframework >= 3.0.4', + 'pykafka >= 2.7.0' ], description='This is a robot framework wrapper around pykafka, the best python kafka library out there as of this writing, and the only one that supports kafka 1.0 and 1.1.', author='Michael Sesterhenn', author_email='invadergir@users.noreply.github.com', url='https://github.com/invadergir/robotframework-pykafka', - download_url='https://github.com/invadergir/robotframework_pykafka/tarball/0.0.2', + download_url='https://github.com/invadergir/robotframework_pykafka/tarball/0.10', keywords=['robotframework', 'kafka','testing'], classifiers=["Programming Language :: Python :: 2.7", "Topic :: Software Development :: Libraries :: Python Modules"]