Skip to content

Latest commit

 

History

History
86 lines (61 loc) · 3.19 KB

CONTRIBUTING.md

File metadata and controls

86 lines (61 loc) · 3.19 KB

Contributing to aws-kinesis-consumer

First, thanks for taking interest in contributing to this application ! This is highly appreciated ! 🤗

You will find here some guidelines to help you start contributing to aws-kinesis-consumer.

Install

To run the application, the machine needs to have the following being installed :

  1. Git
  2. Docker
  3. Python (version 3.6 or greater)
  4. Pipenv

After all the requirements have been installed, the source code of aws-kinesis-consumer can be downloaded and initialised :

git checkout https://github.com/thinow/aws-kinesis-consumer.git

cd aws-kinesis-consumer

# install the dependencies of aws-kinesis-consumer
pipenv sync --dev

Congrats! From now on, you are able to run the tests and the application from your machine.

Run the tests

Run the following command. Here is an example of the expected output :

$ pipenv run invoke test

Starting aws-kinesis-consumer_kinesis_1 ... done
============================= test session starts ==============================
platform darwin -- Python 3.7.3, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /some/path
cachedir: .pytest_cache
rootdir: /some/path
plugins: snapshot-0.4.2, asyncio-0.14.0
collecting ... collected 46 items

tests/configuration/test_configuration_factory.py::test_help PASSED      [  2%]
tests/configuration/test_configuration_factory.py::test_version PASSED   [  4%]
[... many other tests ...]

============================== 46 passed in 0.64s ==============================
Stopping aws-kinesis-consumer_kinesis_1 ... done
Removing aws-kinesis-consumer_kinesis_1 ... done
Removing network aws-kinesis-consumer_default

This command will run all the tests on top of a docker container to simulate an AWS Kinesis Stream ( see docker-compose.yml).

Demo: produce and consume mock records

In order to see how the application behaves, the demo command can help to produce dummy records, and also to run aws-kinesis-consumer to consume those dummy records from a mocked AWS Kinesis Stream running in a docker container.

# first start the producer...
pipenv run invoke demo produce

In another terminal, run the following command to start consuming by using the source code of aws-kinesis-consumer :

# ...then start the consumer
pipenv run invoke demo consume

Other commands

All the following commands can be triggered using pipenv run invoke <COMMAND>. See the invoke project.

Command Description
build Builds the application to all supported packages (e.g. pip, Docker).
deploy Deploys the previously built packages to PyPi and DockerHub. This is usually done from Travis CI.
assertnotodos Verifies if there is any missing todos in the code, otherwise fails the build in Travis CI.
snapshots Updates the Pytest snapshots (see pytest-snapshot).