A library for inspecting push and task results in Mozilla's CI.
To install, run:
$ pip install mozciBasic 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.
Mozci uses poetry to manage the project. So first make sure that is installed. Then clone the repo and run:
$ poetry installThis 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, run:
$ poetry run pytest testsor
$ poetry shell
$ pytest testsThere are also some integration tests that hit live data sources. They are excluded from the default test run. If needed, you can run them locally via:
$ poetry run pytest -vv tests/test_integration.pyAdditionally, you can install the pre-commit hooks by running:
$ pre-commit installLinters and formatters will now run every time you commit.