From Fedora Project Wiki

(add generic virtualenv instructions (per kparal, https://phab.qa.fedoraproject.org/D1124 ))
(rationalize tests and linting section)
Line 52: Line 52:
{{admon/note|Use the develop branch|When using gitflow, the current in-development branch is <code>develop</code>, not <code>master</code>. Be careful not to start developing against an older branch}}
{{admon/note|Use the develop branch|When using gitflow, the current in-development branch is <code>develop</code>, not <code>master</code>. Be careful not to start developing against an older branch}}


=== Tests ===
=== Tests and linting ===


Taskotron components usually have test suites built on [http://docs.pytest.org/en/latest/ Pytest]. Ensure you have {{package|pytest}} installed to run the tests.
Taskotron components usually have test suites built on [http://docs.pytest.org/en/latest/ Pytest], and run lint checks using [https://github.com/PyCQA/flake8 flake8]. To ensure you have these packages installed, run {{code|sudo dnf install pytest python2-flake8}}. When testing and submitting changes, remember to run {{code|arc diff}} inside your virtualenv to ensure the tests and lint run correctly.
 
=== Linting ===
 
As we are using code linting, you will also need the flake8 tool - run {{code|sudo dnf install python-flake8}} to install it.


=== General Thoughts and conventions ===
=== General Thoughts and conventions ===

Revision as of 15:24, 10 February 2017

Repositories

The repositories for the various components of Taskotron can be found on Pagure:

The repositories for the tasks developed alongside Taskotron itself are in the Fedora QA project on Bitbucket:

If you need team membership, send a message out to qa-devel or file an 'infrastructure' ticket in Phabricator.

Issue and code change tracking

Tracking of issues and code changes for all Taskotron projects happens in the Fedora QA instance of Phabricator. Please see this section of the page for general instructions on submitting issues and 'diffs' in Phabricator.

Taskotron-specific instructions

There are some specific considerations for contributing to Taskotron components.

virtualenv

For most Taskotron components, we recommend you submit diffs from within a virtualenv. This will ensure the tests and linter (see below) run correctly. If run directly from the host system, they may not do so. The general process for creating and entering a virtualenv is as follows:

dnf install python2-virtualenv python2-pip
virtualenv --system-site-packages env_somename/
source env_somename/bin/activate

somename is an arbitrary name for the virtualenv; it's customary to name it for the project, but you can call it anything. To exit the virtualenv, run deactivate. Usually, after entering the environment, this will install the requirements for testing (and, if appropriate, running a development instance of) the project, and install the project within the virtualenv in 'editable' mode so that changes you make to the source will be immediately reflected when running the code in the virtualenv:

pip install --ignore-installed -r requirements.txt
pip install -e .

Each project's own README file should usually contain more detailed instructions on this step for the specific project, so check that out too.

gitflow

Gitflow is a git branching strategy that has been used successfully in the blocker tracking app and several Fedora infra apps.

Note.png
Use the develop branch
When using gitflow, the current in-development branch is develop, not master. Be careful not to start developing against an older branch

Tests and linting

Taskotron components usually have test suites built on Pytest, and run lint checks using flake8. To ensure you have these packages installed, run sudo dnf install pytest python2-flake8. When testing and submitting changes, remember to run arc diff inside your virtualenv to ensure the tests and lint run correctly.

General Thoughts and conventions

  • Be smart
  • All code going into develop branches MUST be reviewed
  • All code should have good unit tests where appropriate
    • When in doubt, ask