A library for inspecting push and task results in Mozilla's CI
Перейти к файлу
EvaBardou 3a04662df2
Add an option on the classify command to print intermittent tasks (#548)
Co-authored-by: Eva Bardou <ebardou@teklia.com>
2021-11-10 15:57:44 +01:00
.github Update pre-commit repositories and add a few new checkers 2021-01-05 01:58:41 +01:00
docs Add better TRACE logging to data handler; Update docs for verbose 2021-10-18 10:41:41 -04:00
mozci Add an option on the classify command to print intermittent tasks (#548) 2021-11-10 15:57:44 +01:00
tests Allow to specify confidence thresholds and output path in classify command (#542) 2021-11-08 11:14:44 +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 Add a bare-bones CLI for mozci (#531) 2021-11-03 19:49:46 +01:00
.pre-commit-config.yaml Add a bare-bones CLI for mozci (#531) 2021-11-03 19:49:46 +01:00
.taskcluster.yml Switch to Taskcluster (#387) 2021-01-05 13:55:37 +01:00
LICENSE Initial commit 2019-11-28 15:53:22 -05:00
README.md Remove troubleshooting section from README 2021-03-03 13:59:35 -05:00
poetry.lock Bump boto3 from 1.19.7 to 1.19.12 (#544) 2021-11-10 13:37:30 +01:00
pyproject.toml Add a bare-bones CLI for mozci (#531) 2021-11-03 19:49:46 +01:00
requirements.readthedocs.txt Add some basic Sphinx documentation 2020-03-16 12:47:51 -04:00
tox.ini Import adr only when necessary and make it an optional dependency (#389) 2021-01-05 16:41:53 +01:00

README.md

Task 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.