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
Exclude Antlr test from testprojects to avoid interpreter conflict #6944
Exclude Antlr test from testprojects to avoid interpreter conflict #6944
Conversation
Question for reviewers to make sure we aren't losing any test coverage.
$ ./pants run testprojects/src/python/antlr:eval-bin --run-py-args="123 * 321"
$ ./pants gen testprojects/src/antlr/python/test:antlr_failure This is compared to ./pants --no-pantsrc --pants-workdir=./.pants.d/tmp/tmpkgjg0twx.pants.d --kill-nailguns --print-exception-stacktrace=True test testprojects/src/python/antlr:eval testprojects/src/python/antlr:eval-bin --jvm-platform-default-platform=java7 --gen-protoc-import-from-root Are |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there is 0 coverage lost.
Because this exclusion changed what each shard has, shard 43 is now failing from this command:
I think this is expected behavior, right? Ideas on how to not have the two tests run in the same shard? Is the only solution to exclude one of them? Edit: e6137eb should fix this. |
Fixes the error `FAILURE: The name 'asdf-cpp' was used for two shared libraries` when python_distribution/ctypes and python_distribution/ctypes_with_extra_compiler_flags are run at the same time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
Problem
Antlr 3 only works with Python 2, so we have to constrain that part to only using Python 2, as done in #6924.
However, this results in one of the
testprojects
shards failing when using Python 3 due to mixing a Py2-only constraint with a Py3-only constraint.We can get Antlr to evaluate correctly when there are no other targets, but
test_testprojects_integration.py
works by running multiple targets with one single command so this does not help.Solution
Exclude the Antlr testproject from
projects/testprojects
. The code is already covered by the tests inbackend/codegen/antlr/test_antlr_py_gen_integration.py
.This is a much simpler solution than trying to come up with logic in
test_testprojects_integration.py
to handle interpreter conflicts like this, e.g. putting Python 2 only targets in one dedicated shard.Also fixes duplicate .so binary names
By removing the antlr test, the shards were redistributed in
test_testprojects_integration.py
. This led topython_distribution/ctypes
andpython_distribution/ctypes_with_extra_compiler_flags
running at the same time, which resulted in the errorFAILURE: The name 'asdf-cpp' was used for two shared libraries
.We fix this by making the
asdf-cpp
name unique for all of the 3 uses.