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

PantsRequirementIntegrationTest breaks for pants dep changes #5519

Closed
jsirois opened this issue Feb 26, 2018 · 0 comments
Closed

PantsRequirementIntegrationTest breaks for pants dep changes #5519

jsirois opened this issue Feb 26, 2018 · 0 comments
Assignees
Labels

Comments

@jsirois
Copy link
Contributor

jsirois commented Feb 26, 2018

The test exercises the pants_requirement target on master where we maintain a pants version of, say 1.5.0.dev4 across many commits. If any of those commits mutates requirements for pantsbuild.pants then our resolution assumption that a version always resolves stably is broken. This leads to a broken test along these lines:

13:00:39 30:10       [run]
                     ============== test session starts ===============
                     platform linux2 -- Python 2.7.6, pytest-3.4.0, py-1.5.2, pluggy-0.6.0 -- /usr/bin/python2.7
                     cachedir: .pytest_cache
                     shard: 0 of 7 (0-based shard numbering)
                     rootdir: /home/travis/build/pantsbuild/pants, inifile:
                     plugins: timeout-1.2.1, cov-2.4.0
                     collecting ... collected 1 item
                     Only executing 1 of 1 total tests in shard 0 of 7
                     
                     tests/python/pants_test/backend/python/test_pants_requirement_integration.py::PantsRequirementIntegrationTest::test_pants_requirement <- .pants.d/pyprep/sources/13c9e1bcb297a687b3229a58e31e8fdf32ab7d93/pants_test/backend/python/test_pants_requirement_integration.py FAILED [100%]
                     
                      generated xml file: /home/travis/build/pantsbuild/pants/.pants.d/test/pytest/tests.python.pants_test.backend.python.integration/junitxml/TEST-tests.python.pants_test.backend.python.integration.xml 
                     ============ slowest 3 test durations ============
                     9.48s call     tests/python/pants_test/backend/python/test_pants_requirement_integration.py::PantsRequirementIntegrationTest::test_pants_requirement
                     0.00s setup    tests/python/pants_test/backend/python/test_pants_requirement_integration.py::PantsRequirementIntegrationTest::test_pants_requirement
                     0.00s teardown tests/python/pants_test/backend/python/test_pants_requirement_integration.py::PantsRequirementIntegrationTest::test_pants_requirement
                     ==================== FAILURES ====================
                      PantsRequirementIntegrationTest.test_pants_requirement 
                     
                     self = <pants_test.backend.python.test_pants_requirement_integration.PantsRequirementIntegrationTest testMethod=test_pants_requirement>
                     
                         def test_pants_requirement(self):
                           self.maxDiff = None
                         
                           tests_dir = 'testprojects/pants-plugins/tests/python/test_pants_plugin'
                           command = [
                             'test',
                             tests_dir,
                           ]
                         
                           tests_dir_absolute = os.path.join(get_buildroot(), tests_dir)
                           with self.file_renamed(tests_dir_absolute, 'TEST_BUILD', 'BUILD'):
                             pants_run = self.run_with_testproject_backend_pkgs(command)
                     >     self.assert_success(pants_run)
                     
                     .pants.d/pyprep/sources/13c9e1bcb297a687b3229a58e31e8fdf32ab7d93/pants_test/backend/python/test_pants_requirement_integration.py:47: 
                     _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
                     .pants.d/pyprep/sources/13c9e1bcb297a687b3229a58e31e8fdf32ab7d93/pants_test/pants_run_integration_test.py:373: in assert_success
                         self.assert_result(pants_run, self.PANTS_SUCCESS_CODE, expected=True, msg=msg)
                     .pants.d/pyprep/sources/13c9e1bcb297a687b3229a58e31e8fdf32ab7d93/pants_test/pants_run_integration_test.py:396: in assert_result
                         assertion(value, pants_run.returncode, error_msg)
                     E   AssertionError: /home/travis/build/pantsbuild/pants/pants --no-pantsrc --pants-workdir=/home/travis/build/pantsbuild/pants/.pants.d/tmp/tmp8OJCFa.pants.d --kill-nailguns --print-exception-stacktrace=True --pythonpath=+['/home/travis/build/pantsbuild/pants/testprojects/pants-plugins/src/python'] --backend-packages=+['test_pants_plugin'] --pants-test-infra-pants-requirement-target=testprojects/pants-plugins/3rdparty/python/pants --pants-test-infra-pants-test-infra-target=tests/python/pants_test:test_infra test testprojects/pants-plugins/tests/python/test_pants_plugin
                     E   returncode: 1
                     E   stdout:
                     E   	
                     E   	13:00:40 00:00 [main]
                     E   	               (To run a reporting server: ./pants server)
                     E   	13:00:40 00:00   [setup]
                     E   	13:00:42 00:02     [parse]
                     E   	               Executing tasks in goals: bootstrap -> imports -> unpack-jars -> deferred-sources -> gen -> jvm-platform-validate -> resolve -> resources -> compile -> pyprep -> test
                     E   	13:00:42 00:02   [bootstrap]
                     E   	13:00:42 00:02     [substitute-aliased-targets]
                     E   	13:00:42 00:02     [jar-dependency-management]
                     E   	13:00:42 00:02     [bootstrap-jvm-tools]
                     E   	13:00:42 00:02     [provide-tools-jar]
                     E   	13:00:42 00:02   [imports]
                     E   	13:00:42 00:02     [ivy-imports]
                     E   	13:00:42 00:02   [unpack-jars]
                     E   	13:00:42 00:02     [unpack-jars]
                     E   	13:00:42 00:02   [deferred-sources]
                     E   	13:00:42 00:02     [deferred-sources]
                     E   	13:00:42 00:02   [gen]
                     E   	13:00:42 00:02     [antlr-java]
                     E   	13:00:42 00:02     [antlr-py]
                     E   	13:00:42 00:02     [jaxb]
                     E   	13:00:42 00:02     [protoc]
                     E   	13:00:42 00:02     [ragel]
                     E   	13:00:43 00:03     [thrift-java]
                     E   	13:00:43 00:03     [thrift-py]
                     E   	13:00:43 00:03     [wire]
                     E   	13:00:43 00:03     [avro-java]
                     E   	13:00:43 00:03     [go-thrift]
                     E   	13:00:43 00:03     [jax-ws]
                     E   	13:00:43 00:03     [scrooge]
                     E   	13:00:43 00:03   [jvm-platform-validate]
                     E   	13:00:43 00:03     [jvm-platform-validate]
                     E   	13:00:43 00:03   [resolve]
                     E   	13:00:43 00:03     [ivy]
                     E   	13:00:43 00:03     [coursier]
                     E   	13:00:43 00:03     [go]
                     E   	13:00:43 00:03     [scala-js-compile]
                     E   	13:00:43 00:03     [scala-js-link]
                     E   	13:00:43 00:03     [node]
                     E   	13:00:43 00:03   [resources]
                     E   	13:00:43 00:03     [prepare]
                     E   	13:00:43 00:03     [services]
                     E   	13:00:43 00:03   [compile]
                     E   	13:00:43 00:03     [node]
                     E   	13:00:43 00:03     [compile-jvm-prep-command]
                     E   	13:00:43 00:03       [jvm_prep_command]
                     E   	13:00:43 00:03     [compile-prep-command]
                     E   	13:00:43 00:03     [compile]
                     E   	13:00:43 00:03     [zinc]
                     E   	13:00:43 00:03     [jvm-dep-check]
                     E   	13:00:43 00:03     [cpp]
                     E   	13:00:43 00:03     [errorprone]
                     E   	13:00:43 00:03     [findbugs]
                     E   	13:00:43 00:03     [go]
                     E   	13:00:43 00:03   [pyprep]
                     E   	13:00:43 00:03     [interpreter]
                     E   	13:00:46 00:06     [build-local-dists]
                     E   	13:00:46 00:06     [requirements]
                     E   	                   Invalidated 23 targets.
                     E   	               Waiting for background workers to finish.
                     E   	13:00:49 00:09   [complete]
                     E   	               FAILURE
                     E   stderr:
                     E   	
                     E   	Exception caught: (<class 'pex.resolver.Unsatisfiable'>)
                     E   	  File "/home/travis/build/pantsbuild/pants/src/python/pants/bin/pants_loader.py", line 73, in <module>
                     E   	    main()
                     E   	  File "/home/travis/build/pantsbuild/pants/src/python/pants/bin/pants_loader.py", line 69, in main
                     E   	    PantsLoader.run()
                     E   	  File "/home/travis/build/pantsbuild/pants/src/python/pants/bin/pants_loader.py", line 65, in run
                     E   	    cls.load_and_execute(entrypoint)
                     E   	  File "/home/travis/build/pantsbuild/pants/src/python/pants/bin/pants_loader.py", line 58, in load_and_execute
                     E   	    entrypoint_main()
                     E   	  File "/home/travis/build/pantsbuild/pants/src/python/pants/bin/pants_exe.py", line 36, in main
                     E   	    PantsRunner(exiter).run()
                     E   	  File "/home/travis/build/pantsbuild/pants/src/python/pants/bin/pants_runner.py", line 48, in run
                     E   	    options_bootstrapper=options_bootstrapper).run()
                     E   	  File "/home/travis/build/pantsbuild/pants/src/python/pants/bin/local_pants_runner.py", line 42, in run
                     E   	    self._run()
                     E   	  File "/home/travis/build/pantsbuild/pants/src/python/pants/bin/local_pants_runner.py", line 89, in _run
                     E   	    goal_runner_result = goal_runner.run()
                     E   	  File "/home/travis/build/pantsbuild/pants/src/python/pants/bin/goal_runner.py", line 252, in run
                     E   	    result = self._execute_engine()
                     E   	  File "/home/travis/build/pantsbuild/pants/src/python/pants/bin/goal_runner.py", line 241, in _execute_engine
                     E   	    result = engine.execute(self._context, self._goals)
                     E   	  File "/home/travis/build/pantsbuild/pants/src/python/pants/engine/legacy_engine.py", line 26, in execute
                     E   	    self.attempt(context, goals)
                     E   	  File "/home/travis/build/pantsbuild/pants/src/python/pants/engine/round_engine.py", line 226, in attempt
                     E   	    goal_executor.attempt(explain)
                     E   	  File "/home/travis/build/pantsbuild/pants/src/python/pants/engine/round_engine.py", line 49, in attempt
                     E   	    task.execute()
                     E   	  File "/home/travis/build/pantsbuild/pants/src/python/pants/backend/python/tasks/resolve_requirements.py", line 28, in execute
                     E   	    pex = self.resolve_requirements(interpreter, self.context.targets(has_python_requirements))
                     E   	  File "/home/travis/build/pantsbuild/pants/src/python/pants/backend/python/tasks/resolve_requirements_task_base.py", line 59, in resolve_requirements
                     E   	    dump_requirement_libs(builder, interpreter, req_libs, self.context.log)
                     E   	  File "/home/travis/build/pantsbuild/pants/src/python/pants/backend/python/tasks/pex_build_util.py", line 95, in dump_requirement_libs
                     E   	    dump_requirements(builder, interpreter, reqs, log, platforms)
                     E   	  File "/home/travis/build/pantsbuild/pants/src/python/pants/backend/python/tasks/pex_build_util.py", line 117, in dump_requirements
                     E   	    distributions = _resolve_multi(interpreter, deduped_reqs, platforms, find_links)
                     E   	  File "/home/travis/build/pantsbuild/pants/src/python/pants/backend/python/tasks/pex_build_util.py", line 159, in _resolve_multi
                     E   	    allow_prereleases=python_setup.resolver_allow_prereleases)
                     E   	  File "/home/travis/build/pantsbuild/pants/build-support/pants_dev_deps.venv/lib/python2.7/site-packages/pex/resolver.py", line 376, in resolve
                     E   	    return resolver.resolve(resolvables_from_iterable(requirements, builder))
                     E   	  File "/home/travis/build/pantsbuild/pants/build-support/pants_dev_deps.venv/lib/python2.7/site-packages/pex/resolver.py", line 196, in resolve
                     E   	    resolvable_set.merge(resolvable, packages, parent)
                     E   	  File "/home/travis/build/pantsbuild/pants/build-support/pants_dev_deps.venv/lib/python2.7/site-packages/pex/resolver.py", line 113, in merge
                     E   	    self._check()
                     E   	  File "/home/travis/build/pantsbuild/pants/build-support/pants_dev_deps.venv/lib/python2.7/site-packages/pex/resolver.py", line 107, in _check
                     E   	    resolved_packages.resolvable, self._synthesize_parents(name)))
                     E   	
                     E   	Exception message: Could not satisfy all requirements for pex==1.3.1:
                     E   	    pex==1.3.1, pex==1.2.16(from: pantsbuild.pants==1.5.0.dev4)
                     ============ 1 failed in 9.57 seconds ============
@jsirois jsirois added the bug label Feb 26, 2018
@jsirois jsirois self-assigned this Feb 26, 2018
jsirois added a commit to jsirois/pants that referenced this issue Feb 26, 2018
Previously changes to `pantsbuild.pants` requirements on master between
releases would leave to resolution conflicts in the
`test_pants_requirement` test. Make the test robust to these sort of
changes by producing and consuming a unique `pantsbuild.pants`
distribution for each run of the test.

Fixes pantsbuild#5519
jsirois added a commit to jsirois/pants that referenced this issue Feb 26, 2018
Previously changes to `pantsbuild.pants` requirements on master between
releases would lead to resolution conflicts in the
`test_pants_requirement` test. Make the test robust to these sort of
changes by producing and consuming a unique `pantsbuild.pants`
distribution for each run of the test.

Fixes pantsbuild#5519
jsirois added a commit that referenced this issue Feb 26, 2018
Previously changes to `pantsbuild.pants` requirements on master between
releases would lead to resolution conflicts in the
`test_pants_requirement` test. Make the test robust to these sort of
changes by producing and consuming a unique `pantsbuild.pants`
distribution for each run of the test.

Fixes #5519
jsirois added a commit to jsirois/pants that referenced this issue Mar 17, 2018
Previously, when the pants `VERSION` was bumped and before publishing
the `test_setup_py_unregistered_pants_plugin` test would fail to resolve
`pantsbuild.pants` at the new version on pypi. Update the test to use a
custom-produced `pantsbuild.pants` distribution and share this logic
with `PantsRequirementIntegrationTest`.

Similar to pantsbuild#5519
jsirois added a commit that referenced this issue Mar 17, 2018
Previously, when the pants `VERSION` was bumped and before publishing
the `test_setup_py_unregistered_pants_plugin` test would fail to resolve
`pantsbuild.pants` at the new version on pypi. Update the test to use a
custom-produced `pantsbuild.pants` distribution and share this logic
with `PantsRequirementIntegrationTest`.

Similar to #5519
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant