Closed Bug 1533043 Opened 2 years ago Closed 2 years ago

Create a test for |mach try chooser|


(Firefox Build System :: Try, enhancement)

Not set


(firefox67 fixed)

Tracking Status
firefox67 --- fixed


(Reporter: ahal, Assigned: ahal)



(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:

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/'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
[python-test] Add ability for individual tests to have pypi dependencies, r=davehunt
[chooser] Use a requirements file to install |mach try chooser| dependencies, r=davehunt
[chooser] Add a test for |mach try chooser|, r=gbrown
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla67
You need to log in before you can comment on or make changes to this bug.