Closed Bug 1465785 Opened 6 years ago Closed 2 years ago

Convert the JS tests suites to Python 3.

Categories

(Core :: JavaScript Engine, enhancement, P3)

enhancement

Tracking

()

RESOLVED DUPLICATE of bug 1619475

People

(Reporter: nbp, Assigned: jgraham)

References

Details

Attachments

(1 file, 1 obsolete file)

As mach forced us to move to Python 3, I am not longer able to run any tests / jit-tests which still requires python 2.7 to run.

Converting the tests / jit-tests harness to python 3 should solve this issue.
This patch changes add decoding of bytes strings into strings, and uses io.open
instead of the open builtin such that this code can be used both with Python 2.7
and Python 3.

Note, I had to make the code compatible with Python 2.7 because I do not know
how to run python 3 from mach_commands.py testing commands.
Attachment #8982548 - Flags: review?(sphink)
Comment on attachment 8982548 [details] [diff] [review]
Convert JS tests suites to Python 3.

Review of attachment 8982548 [details] [diff] [review]:
-----------------------------------------------------------------

::: js/src/tests/lib/tests.py
@@ +59,5 @@
>          return kwargs['none']
>      return JITFLAGS[variant]
>  
>  def valid_jitflags():
> +    return [ x for x in JITFLAGS.keys() ]

`list(JITFLAGS.keys())` will likely work as well.
(In reply to :Ms2ger (⌚ UTC+1/+2) from comment #2)
> ::: js/src/tests/lib/tests.py
> >  def valid_jitflags():
> > +    return [ x for x in JITFLAGS.keys() ]
> 
> `list(JITFLAGS.keys())` will likely work as well.

Tested locally, works with both Python 3.5 and 2.7.
Comment on attachment 8982548 [details] [diff] [review]
Convert JS tests suites to Python 3.

Review of attachment 8982548 [details] [diff] [review]:
-----------------------------------------------------------------

lgtm. The Queue case thing is kind of crazy. Thank you!
Attachment #8982548 - Flags: review?(sphink) → review+
One last thing reported by Try on Windows: sys.maxint --> sys.maxsize, which should also work as expected on both python 2 and 3.

https://treeherder.mozilla.org/#/jobs?repo=try&revision=2f729e22888574313f2a5a0e1764a559e97dd538
The attached patch is no longer sufficient, since the ref test test suite now depends on a HUGE amount of python code which would have to be converted as well.

Giving up on this task for the moment.
Status: ASSIGNED → NEW
Assignee: nicolas.b.pierron → nobody

There's a r+ patch which didn't land and no activity in this bug for 2 weeks.
:nbp, could you have a look please?

Flags: needinfo?(nicolas.b.pierron)

(In reply to Release mgmt bot [:sylvestre / :calixte] from comment #7)

There's a r+ patch which didn't land and no activity in this bug for 2 weeks.
:nbp, could you have a look please?

See comment 6.

Someone else added a new dependency preventing this simple patch from applying. Therefore dropping the ownership of this bug. If someone else want to continue from my patch, then are free to do so, but I am not giving more time to this issue.

Flags: needinfo?(nicolas.b.pierron)

Depends on D32485

Depends on: 1556670
Depends on: 1557307
Blocks: 1556670
No longer depends on: 1556670
No longer blocks: 1556670
Depends on: 1556670
Attachment #9069110 - Attachment description: Bug 1465785 - Bug#1465785 - Convert the JS tests suites to Python 3. → Bug 1557307 - Bug#1465785 - Convert the JS tests suites to Python 3.

It looks like this ended up happening mostly in bug 1619475. There may be something left in this patch that's still useful, but given that we're running the tests under python3 all the time now, it would be minor.

Status: NEW → RESOLVED
Closed: 2 years ago
Flags: needinfo?(hamzah18051)
Resolution: --- → DUPLICATE
Assignee: nobody → james
Attachment #9069110 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: