Skip to content

Commit

Permalink
Merge pull request #4 from invadergir/fix-importing-update-readme
Browse files Browse the repository at this point in the history
Fix importing update readme
  • Loading branch information
invadergir committed Dec 17, 2018
2 parents 4ecf7cf + a4e3617 commit b650b8e
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 11 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,5 +1,6 @@
*.pyc
results/
tests/testresults/

### VirtualEnv template
# Virtualenv
Expand Down
33 changes: 29 additions & 4 deletions README.md
Expand Up @@ -12,16 +12,29 @@ Support is guaranteed for Python 2.7.X only at this time. It has not been teste

### Installing

#### Dependencies

This following dependencies are downloaded when you install robotframework-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 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
```

```Library robotframework_pykafka.robotframework_pykafka```

### Kafka Version Support

Support is guaranteed for 1.0.X only at this time. It has not been tested on anything else.
Expand Down Expand Up @@ -79,6 +92,18 @@ 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
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")
Expand Down
3 changes: 1 addition & 2 deletions requirements.txt
@@ -1,3 +1,2 @@
robotframework >= 3.0.4
pykafka == 2.7.0
robotframework-jsonlibrary == 0.2
pykafka >= 2.7.0
1 change: 1 addition & 0 deletions robotframework_pykafka/__init__.py
@@ -0,0 +1 @@
from robotframework_pykafka import *
7 changes: 4 additions & 3 deletions setup.py
Expand Up @@ -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"]
Expand Down
8 changes: 7 additions & 1 deletion tests/json-produce-consume.robot
@@ -1,5 +1,11 @@
*** Settings ***
Library ../robotframework_pykafka/robotframework_pykafka.py
# For lib testing:
#Library ../robotframework_pykafka/

# Normal way to import when installed from pip:
Library robotframework_pykafka

# Needed for JSON manipulation:
Library JSONLibrary

*** Test Cases ***
Expand Down
6 changes: 5 additions & 1 deletion tests/text-produce-consume.robot
@@ -1,5 +1,9 @@
*** Settings ***
Library ../robotframework_pykafka/robotframework_pykafka.py
# For lib testing:
#Library ../robotframework_pykafka/

# Normal way to import when installed from pip:
Library robotframework_pykafka

*** Test Cases ***
Test Producing and Consuming a Message
Expand Down

0 comments on commit b650b8e

Please sign in to comment.