Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Junit runner failing when `--extra-jvm-options` provided #7877

Merged

Conversation

Projects
None yet
2 participants
@Eric-Arellano
Copy link
Contributor

commented Jun 9, 2019

Problem

In Python 3, you cannot compare unlike types like list and tuple, whereas Python 2 allowed this. #7067 mostly fixed this, but got the types wrong for extra_jvm_options and extra_env_vars.

This was detected when running Twitter code with Pants using Python 3, which resulted in the exception:

Exception message: '<' not supported between instances of 'tuple' and 'list'

We did not encounter this error earlier because we never encountered the edge case of one target specifying extra_jvm_options and the other not specifying it, which would result in comparing a tuple to a list.

Solution

For these two fields, there is no None value ever. The values are always tuples, just sometimes empty tuples. So, we can remove the fallback value.

Result

The Twitter test now succeeds.

@Eric-Arellano Eric-Arellano added this to the 1.17.x milestone Jun 9, 2019

@Eric-Arellano Eric-Arellano requested review from stuhood and jsirois Jun 9, 2019

@Eric-Arellano Eric-Arellano self-assigned this Jun 9, 2019

@Eric-Arellano

This comment has been minimized.

Copy link
Contributor Author

commented Jun 9, 2019

@stuhood will we want to cherry-pick this into 1.16.x too? It impacts anyone using Py, so I would advocate including it even though it's a very particular edge case.

I'm not sure if we're doing another release candidate.

@Eric-Arellano Eric-Arellano changed the title Fix Junit runner failing when `--extra-jvm-options` provided Fix Junit runner failing when `--extra-jvm-options` provided and using Python 3 Jun 9, 2019

@Eric-Arellano Eric-Arellano changed the title Fix Junit runner failing when `--extra-jvm-options` provided and using Python 3 Fix Junit runner failing when `--extra-jvm-options` provided Jun 9, 2019

@jsirois

jsirois approved these changes Jun 9, 2019

@Eric-Arellano Eric-Arellano merged commit e727747 into pantsbuild:master Jun 10, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@Eric-Arellano Eric-Arellano deleted the Eric-Arellano:fix-junit-py3-sorting branch Jun 10, 2019

Eric-Arellano added a commit that referenced this pull request Jun 10, 2019

Fix Junit runner failing when `--extra-jvm-options` provided (#7877)
### Problem
In Python 3, you cannot compare unlike types like `list` and `tuple`, whereas Python 2 allowed this. #7067 mostly fixed this, but got the types wrong for `extra_jvm_options` and `extra_env_vars`.

This was detected when running Twitter code with Pants using Python 3, which resulted in the exception:

```python
Exception message: '<' not supported between instances of 'tuple' and 'list'
```

We did not encounter this error earlier because we never encountered the edge case of one target specifying `extra_jvm_options` and the other not specifying it, which would result in comparing a tuple to a list.

### Solution
For these two fields, there is no `None` value ever. The values are always tuples, just sometimes empty tuples. So, we can remove the fallback value.

### Result
The Twitter test now succeeds.

@Eric-Arellano Eric-Arellano removed this from the 1.17.x milestone Jun 13, 2019

cattibrie added a commit to cattibrie/pants that referenced this pull request Jun 19, 2019

Fix Junit runner failing when `--extra-jvm-options` provided (pantsbu…
…ild#7877)

### Problem
In Python 3, you cannot compare unlike types like `list` and `tuple`, whereas Python 2 allowed this. pantsbuild#7067 mostly fixed this, but got the types wrong for `extra_jvm_options` and `extra_env_vars`.

This was detected when running Twitter code with Pants using Python 3, which resulted in the exception:

```python
Exception message: '<' not supported between instances of 'tuple' and 'list'
```

We did not encounter this error earlier because we never encountered the edge case of one target specifying `extra_jvm_options` and the other not specifying it, which would result in comparing a tuple to a list.

### Solution
For these two fields, there is no `None` value ever. The values are always tuples, just sometimes empty tuples. So, we can remove the fallback value.

### Result
The Twitter test now succeeds.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.