Skip to content

Commit

Permalink
Remove --resolve-jvm-capture-snapshots and --pytest-run-options (#8123)
Browse files Browse the repository at this point in the history
### Problem

Merged #8120 without letting travis finish.
That PR bumped the version, and that made two options deprecated. This means that almost all integration test shards fail in master. (e.g. https://travis-ci.org/pantsbuild/pants/jobs/565035360)

### Solution

Remove both options, and their usages.

### Result

Hopefully travis should be green. I tested the failing shards locally and they seem to work so far.
  • Loading branch information
blorente authored and stuhood committed Jul 29, 2019
1 parent 77463ce commit 0234ece
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 35 deletions.
2 changes: 1 addition & 1 deletion src/python/pants/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.19.0.0rc0
1.19.0rc0
12 changes: 0 additions & 12 deletions src/python/pants/backend/jvm/tasks/resolve_shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,6 @@
class JvmResolverBase(TaskBase):
"""Common methods for both Ivy and Coursier resolves."""

@classmethod
def register_options(cls, register):
"""Register an option to make capturing snapshots optional.
This class is intended to be extended by Jvm resolvers (coursier and ivy), and the option name should reflect that.
"""
super().register_options(register)
register('--capture-snapshots', type=bool, default=False,
removal_version='1.19.0.dev2',
removal_hint='Enabled by default.',
help='Enable capturing snapshots to add directory digests to dependency jars.'
'Note that this is necessary when hermetic execution is enabled.')

def add_directory_digests_for_jars(self, targets_and_jars):
"""For each target, get DirectoryDigests for its jars and return them zipped with the jars.
Expand Down
13 changes: 1 addition & 12 deletions src/python/pants/backend/python/tasks/pytest_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
from pants.util.memo import memoized_method, memoized_property
from pants.util.objects import datatype
from pants.util.process_handler import SubprocessProcessHandler
from pants.util.strutil import safe_shlex_join, safe_shlex_split
from pants.util.strutil import safe_shlex_join
from pants.util.xml_parser import XmlParser


Expand Down Expand Up @@ -108,14 +108,6 @@ def register_options(cls, register):
"it's best to use an absolute path to make it easy to find the subprocess "
"profiles later.")

# TODO(John Sirois): Remove this option. The cleanup work is tracked in:
# https://github.com/pantsbuild/pants/issues/7802
register('--options', type=list, fingerprint=True,
removal_version='1.19.0.dev2',
removal_hint='Use the `--passthrough-args` option instead. You my need to remove'
'some argument quoting when converting.',
help='Pass these options to pytest. You can also use pass-through args.')

register('--coverage', fingerprint=True,
help='Emit coverage information for specified packages or directories (absolute or '
'relative to the build root). The special value "auto" indicates that Pants '
Expand Down Expand Up @@ -629,9 +621,6 @@ def _run_pytest(self, fail_fast, test_targets, workdirs):
if self.get_options().colors:
args.extend(['--color', 'yes'])

if self.get_options().options:
for opt in self.get_options().options:
args.extend(safe_shlex_split(opt))
args.extend(self.get_passthru_args())

args.extend(test_args)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,6 @@ def populate_necessary_hermetic_options():
'incremental': False,
'use_classpath_jars': False,
})
if resolver == 'ivy':
resolver_scope = 'resolve.ivy'
else:
assert resolver == 'coursier'
resolver_scope = 'resolve.coursier'
config[resolver_scope] = {
'capture_snapshots': True,
}

execution_strategy.resolve_for_enum_variant({
'nailgun': lambda: None,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,7 @@ def test_passthrough_args_facility_plus_arg_style(self):

def test_passthrough_added_after_options(self):
with self.marking_tests() as (target, assert_test_run, assert_test_not_run):
self.run_tests([target], '-m', 'purple or red', options=['-k', 'two'])
self.run_tests([target], '-m', 'purple or red', '-k', 'two')
assert_test_not_run('test_one')
assert_test_run('test_two')
assert_test_not_run('test_three')
Expand All @@ -883,7 +883,7 @@ def test_passthrough_added_after_options(self):

def test_options_shlexed(self):
with self.marking_tests() as (target, assert_test_run, assert_test_not_run):
self.run_tests([target], options=["-m 'purple or red'"])
self.run_tests([target], "-m", "purple or red")
assert_test_not_run('test_one')
assert_test_run('test_two')
assert_test_not_run('test_three')
Expand Down

0 comments on commit 0234ece

Please sign in to comment.