A library for inspecting push and task results in Mozilla's CI
Перейти к файлу
Marco Castelluccio 56dbdaa772 Add a basic integration test to make sure everything runs without exceptions
Fixes #17
2020-04-24 15:43:44 +02:00
docs docs: Re-organize regressions doc to contain definitions at the front (#106) 2020-04-22 15:58:25 -04:00
mozci Ignore skipped groups (from AD) 2020-04-22 21:27:52 +02:00
tests Add a basic integration test to make sure everything runs without exceptions 2020-04-24 15:43:44 +02:00
.flake8 Use black and pre-commit (#70) 2020-02-26 17:05:30 +01:00
.gitignore Add troubleshooting docs for some Windows issues (#97) 2020-04-22 16:18:27 -04:00
.isort.cfg Use black and pre-commit (#70) 2020-02-26 17:05:30 +01:00
.pre-commit-config.yaml Disable 'check-docstring-first' pre-commit hook 2020-03-25 09:58:31 -04: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 troubleshooting docs for some Windows issues (#97) 2020-04-22 16:18:27 -04:00
poetry.lock Bump responses from 0.10.12 to 0.10.14 (#164) 2020-04-21 12:19:31 +02:00
pyproject.toml Bump sphinx from 3.0.1 to 3.0.2 (#165) 2020-04-21 12:19:23 +02:00
requirements.readthedocs.txt Add some basic Sphinx documentation 2020-03-16 12:47:51 -04:00
tox.ini Remove wpt suites from the list of suites which are not generating manifest information 2020-04-22 23:38:18 +02: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