Skip to content

Latest commit

 

History

History
89 lines (62 loc) · 3.75 KB

CONTRIBUTING.md

File metadata and controls

89 lines (62 loc) · 3.75 KB

Contributing

The preferred way of contributing directly is by creating a GitHub Fork. You may setup and work on your fork according to the steps, respecting the following chapters of this guide. Once the contribution is ready, you may propose a GitHub Pull Request. The Pull Request will then be automatically checked agains every development policy automatically. Also the Pull Request has to be reviewed by the maintainer and may receive some feedback to consider. Once the Pull Request is successfully approved by the maintainer, it will be merged into the main branch.

Also here is a more general guide to making open source contributions, for first-timers and for veterans:
Open Source Guides

Package Management

If you want to add new dependencies to the project, make sure their license is compatible with the MIT license.

This Project uses Pipenv for managing Python Packages.
Install new dependencies from pypi via pipenv install <PACKAGE>. Add --dev flag for development dependencies.

Code Formatting and Style Guide

You may contribute to this Project using any IDE, Editor or Terminal you like, as long as your modifications obey the conventions defined by the Style Guide for Python Code (PEP8). The following commands will format your code accordingly:

  • format code: pipenv run black
  • sort imports: pipenv run isort src

Also make sure to check messages from the following linter commands before proposing:

  • pipenv run mypy src
  • pipenv run flake8
  • pipenv run pylint src

Testing

Test Modules

  • are named test_<module_name>.py
  • are run specifically via pipenv run ./src/manage.py <module>

Test Cases

  • are classes defined in a test module
  • are named Test<TestCaseName>
  • are run specifically via pipenv run ./src/manage.py <module>.<TestCase>

Tests

  • are methods or functions defined in test cases or test modules, respectively
  • are named test_<test_name>
  • are run specifically via pipenv run ./src/manage.py <module>.<TestCase>.<test>
  • are run collectively via pipenv run hbtest

Unit Tests

  • are isolated and do not connect to running components or external systems
  • are defined in the tests.unit subpackage of the related app
  • are defined in test cases that subclass django.test.TestCase
  • are run collectively via pipenv run hbunittest
Model Tests
  • are Unit Tests, that connect to the local database
  • are defined in test cases that subclass base.tests.base.ModelTestCase

Integration Tests

  • are not isolated and do connect to running components or external systems
  • are defined in the tests.integration subpackage of the related app
  • are defined in test cases that subclass base.tests.base.IntegrationTestCase
  • are run collectively via pipenv run hbintegrationtest

Browser Tests

  • are user centric and focus a single feature or functionality
  • are implemented with Selenium
  • are defined in the tests.browser subpackage of the related app
  • are defined in test cases that subclass base.tests.base.BrowserTestCase
  • are run collectively via pipenv run hbbrowsertest
    • install Firefox and add to PATH
    • install geckodriver and add to PATH
    • set Django setting BROWSER_TIMEOUT according to the processing and network power of the browser platform

Coverage

  • may be calculated by running tests via pipenv run hbcoverage
  • may be reported as HTML after calculation via pipenv run coverage html
  • may be reported as XML after calculation via pipenv run coverage xml