Closed Bug 1533043 Opened 5 years ago Closed 5 years ago

Create a test for |mach try chooser|

Categories

(Developer Infrastructure :: Try, enhancement)

enhancement
Not set
normal

Tracking

(firefox67 fixed)

RESOLVED FIXED
mozilla67
Tracking Status
firefox67 --- fixed

People

(Reporter: ahal, Assigned: ahal)

Details

Attachments

(3 files)

The main problem that needs to be solved is the dependency on flask. This is currently installed by the |mach try chooser| command at runtime:
https://searchfox.org/mozilla-central/source/tools/tryselect/mach_commands.py#246

But since we won't be running the test through the mach command, we'll never install flask into the virtualenv. We should be pinning this and using hashes anyway.

Couple options:

A) Vendor flask
B) Create requirements.txt (with hashes) and add ability to install these to |mach python-test|
C) Do something with pipenv?

A would be the easiest, but I'm leaning towards B. Would be good to have this ability for other things as well.

Sometimes tools install pypi at runtime via mach (e.g self.install_pip_package
/ self.install_pip_requirements). It's difficult to test these modules with
pytest because we usually won't be going through mach.

This gives tests the ability to depend on external pypi packages the same way
they might get installed when running via mach.

Note, I only added support for requirements.txt here because
python/mozbuild/mozbuild/virtualenv.py's 'install_pip_package' function is
completely busted with modern pip. And the pip used with |mach python-test| is
more modern than the one used with the regular build venv due to pipenv. We'll
need to fix this eventually, but that's another bug for another day.

Not only is it best practice to pin dependencies and check hashes, but this
will allow tests to install these dependencies as well.

Depends on D22784

Pushed by ahalberstadt@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/203ed6d898c1
[python-test] Add ability for individual tests to have pypi dependencies, r=davehunt
https://hg.mozilla.org/integration/autoland/rev/8a144ea41396
[chooser] Use a requirements file to install |mach try chooser| dependencies, r=davehunt
https://hg.mozilla.org/integration/autoland/rev/e6c8edad26bf
[chooser] Add a test for |mach try chooser|, r=gbrown
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla67
Assignee: nobody → ahal
Product: Firefox Build System → Developer Infrastructure
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: