Create a test for |mach try chooser|
Categories
(Developer Infrastructure :: Try, enhancement)
Tracking
(firefox67 fixed)
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.
Assignee | ||
Comment 1•5 years ago
|
||
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.
Assignee | ||
Comment 2•5 years ago
|
||
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
Assignee | ||
Comment 3•5 years ago
|
||
Depends on D22785
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
Comment 5•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/203ed6d898c1
https://hg.mozilla.org/mozilla-central/rev/8a144ea41396
https://hg.mozilla.org/mozilla-central/rev/e6c8edad26bf
Updated•5 years ago
|
Updated•2 years ago
|
Description
•