A library for inspecting push and task results in Mozilla's CI
Перейти к файлу
Marco Castelluccio b4d25bc532 Bump to 1.10.0 2020-11-05 20:39:05 +01:00
.github Create Dependabot config file (#242) 2020-07-14 18:38:10 +02:00
docs docs: Re-organize regressions doc to contain definitions at the front (#106) 2020-04-22 15:58:25 -04:00
mozci Improve the logging in the **post_init** function of the TestTask class 2020-11-05 19:36:43 +01:00
tests Assume a commit was not backed-out if the 'backedoutby' field is not present in json-automationrelevance (#343) 2020-11-05 17:07:50 +01:00
.flake8 Use black and pre-commit (#70) 2020-02-26 17:05:30 +01:00
.gitignore Add '.vim' to .gitignore 2020-08-14 10:54:07 -04:00
.isort.cfg Implement the concept of data sources 2020-08-14 10:54:07 -04:00
.pre-commit-config.yaml Update pre-commit repositories 2020-10-15 19:20:01 +02:00
.travis.yml Use black and pre-commit (#70) 2020-02-26 17:05:30 +01:00
LICENSE Initial commit 2019-11-28 15:53:22 -05:00
README.md Add closing parenthesis to Usage example (#238) 2020-07-07 17:11:57 -04:00
poetry.lock Bump boto3 from 1.16.5 to 1.16.9 (#337) 2020-11-02 11:34:05 +01:00
pyproject.toml Bump to 1.10.0 2020-11-05 20:39:05 +01:00
requirements.readthedocs.txt Add some basic Sphinx documentation 2020-03-16 12:47:51 -04:00
tox.ini Don't require 'MOZCI_CONFIG_PATH' to be set in integration tests 2020-10-22 15:30:58 -04:00

README.md

Build Status PyPI version Docs

mozci

A library for inspecting push and task results in Mozilla's CI.

Installation

To install, run:

$ pip install mozci

Usage

Basic usage is to instantiate a Push object then start accessing properties and call methods. For example:

from mozci.push import Push

push = Push("79041cab0cc2", branch="autoland")
print("\n".join([t.label for t in push.tasks if t.failed]))

This will print all the failing tasks from a given push. See the documentation for more usage details and API docs.

Contributing

Mozci uses poetry to manage the project. So first make sure that is installed. Then clone the repo and run:

$ poetry install

This will create a virtualenv and install both project and dev dependencies in it. See the poetry documentation to learn how to work within the project.

To execute tests and linters, run:

$ tox

This should run successfully prior to submitting PRs (unless you need help figuring out the problem).

There are also some integration tests that will hit live data sources. These are run in a cron task and are excluded from the default test run. But if needed, you can run them locally via:

$ tox -e integration

Since tox installs packages on every invocation, it's much faster to run tests directly with pytest:

$ poetry run pytest tests

or

$ poetry shell
$ pytest tests

Additionally, you can install the pre-commit hooks by running:

$ pre-commit install

Linters and formatters will now run every time you commit.

Troubleshooting

poetry install locks up on Windows (upstream issue)

This can potentially be worked around like this:

python -m pip install virtualenv
python -m virtualenv .venv                   # IMPORTANT: Notice the dot in the name
.venv\Scripts\activate
pip install pip-tools
poetry export --dev --without-hashes -f requirements.txt > requirements.in
pip-compile --upgrade --generate-hashes --output-file requirements.txt requirements.in
pip install -r requirements.txt