Closed Bug 1465887 Opened 6 years ago Closed 6 years ago

Ability to specify python version per test

Categories

(Testing :: Python Test, enhancement)

Version 3
enhancement
Not set
normal

Tracking

(firefox62 fixed)

RESOLVED FIXED
mozilla62
Tracking Status
firefox62 --- fixed

People

(Reporter: ahal, Assigned: davehunt)

References

Details

Attachments

(1 file)

Bug 1388013 is implementing the ability to run |mach python-test --three|, which will run the specified tests using python 3. This is great and will allow us to start adding tasks that run our tests with python 3!

But I'd like to take it a step further by allowing us to specify the python versions a test can run against in the manifest. E.g:

[DEFAULT]
py=2,3
[test_foo.py]
[test_bar.py]

This way, when you run |mach python-test --three|, we can filter out all the tests that don't work there yet. One could even imagine a world where running |mach python-test| will run tests against *both* 2 and 3 in the same invocation (similar to tox).
Assignee: nobody → ahal
Status: NEW → ASSIGNED
I already have a version of this in my patch series for bug 1428362.
Oh, ok. I can hold off if you like (though I also managed to get something minimal working). Heh, I should just stop working on things as you seem to be a step ahead :p.
(In reply to Andrew Halberstadt [:ahal] from comment #2)
> Oh, ok. I can hold off if you like (though I also managed to get something
> minimal working). Heh, I should just stop working on things as you seem to
> be a step ahead :p.

If you have something working then please go ahead and upload it for review, it shouldn't be blocked on my work. I can just rebase my patch series as needed.

In my patch I'm passing `py3=True` to manifest parser when Python 3 is in use, and then `skip-if = py3 == true` in the manifests for tests that are not yet ready for Python 3. My reasoning is that I'd like tests by default to run against Python 3, and require them to be explicitly skipped. This reduces the chance of us missing tests, and also makes it relatively easy to see how much work is remaining to by compatible with Python 3.

On IRC you mentioned using a python version instead of a boolean, something like `python=3` perhaps, so we would be able to skip using something like `skip-if = python == 3`. I like this idea too, as eventually we can have py3 only packages and skip the tests on py2.
It's ok, I'm in no rush to fix this and if you have a manifest solution implemented already then that's better than what I had. Feel free to resolve this a dupe if appropriate.
Blocks: 1466211
No longer blocks: 1466211
Depends on: 1466211
Unassigning myself to avoid stepping on Dave's toes.
Assignee: ahal → nobody
Status: ASSIGNED → NEW
Comment on attachment 8985187 [details]
Bug 1465887 - Allow test manifests to skip based on Python version;

https://reviewboard.mozilla.org/r/250836/#review257388
Attachment #8985187 - Flags: review?(ahal) → review+
Assignee: nobody → dave.hunt
Status: NEW → ASSIGNED
Pushed by dhunt@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/7a6d20e98283
Allow test manifests to skip based on Python version; r=ahal
https://hg.mozilla.org/mozilla-central/rev/7a6d20e98283
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla62
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: