This is an automated email from the ASF dual-hosted git repository. dcapwell pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/cassandra-dtest.git
The following commit(s) were added to refs/heads/trunk by this push: new 9dcd035 python upgrade tests include tests which are not impacted by the version under test (#106) 9dcd035 is described below commit 9dcd035ff6894bd135cce4fd2460ab72269ab970 Author: dcapwell <dcapw...@gmail.com> AuthorDate: Mon Dec 14 10:20:54 2020 -0800 python upgrade tests include tests which are not impacted by the version under test (#106) patch by David Capwell, Michael Semb Wever; reviewed by Marcus Eriksson, Michael Semb Wever for CASSANDRA-16328 --- conftest.py | 2 ++ run_dtests.py | 7 +++++++ upgrade_tests/upgrade_manifest.py | 17 ++++++++++++++--- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/conftest.py b/conftest.py index 51d2a58..486962e 100644 --- a/conftest.py +++ b/conftest.py @@ -89,6 +89,8 @@ def pytest_addoption(parser): help="Enable JaCoCo Code Coverage Support") parser.addoption("--upgrade-version-selection", action="store", default="indev", help="Specify whether to run indev, releases, or both") + parser.addoption("--upgrade-target-version-only", action="store_true", default=False, + help="When running upgrade tests, only run tests upgrading to the current version") def sufficient_system_resources_for_resource_intensive_tests(): diff --git a/run_dtests.py b/run_dtests.py index e239359..44969b2 100755 --- a/run_dtests.py +++ b/run_dtests.py @@ -104,6 +104,13 @@ class RunDTests(): logging.root.setLevel(logging.DEBUG) logger.setLevel(logging.DEBUG) + # cause logger to go to stdout + handler = logging.StreamHandler(sys.stdout) + handler.setLevel(logging.DEBUG) + formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s') + handler.setFormatter(formatter) + logging.root.addHandler(handler) + # Get dictionaries corresponding to each point in the configuration matrix # we want to run, then generate a config object for each of them. diff --git a/upgrade_tests/upgrade_manifest.py b/upgrade_tests/upgrade_manifest.py index 19e4624..be481a8 100644 --- a/upgrade_tests/upgrade_manifest.py +++ b/upgrade_tests/upgrade_manifest.py @@ -29,9 +29,13 @@ def is_same_family_current_to_indev(origin, destination): class VersionSelectionStrategies(Enum): """ + Allow all versions + """ + ALL=(lambda origin, destination: True,) + """ Test upgrading from indev -> indev, current -> current across versions, and current -> indev within a version """ - BOTH=(lambda origin, destination: (origin.variant == destination.variant) or is_same_family_current_to_indev(origin,destination)) + BOTH=(lambda origin, destination: (origin.variant == destination.variant) or is_same_family_current_to_indev(origin,destination),) """ Exclusively test in development branches so your bug fixes show up """ @@ -129,7 +133,7 @@ indev_2_2_x = VersionMeta(name='indev_2_2_x', family='2.2', variant='indev', ver current_2_2_x = VersionMeta(name='current_2_2_x', family='2.2', variant='current', version='2.2.13', min_proto_v=1, max_proto_v=4, java_versions=(7, 8)) indev_3_0_x = VersionMeta(name='indev_3_0_x', family='3.0', variant='indev', version='github:apache/cassandra-3.0', min_proto_v=3, max_proto_v=4, java_versions=(8,)) -current_3_0_x = VersionMeta(name='current_3_0_x', family='3.0', variant='current', version='3.0.17', min_proto_v=3, max_proto_v=4, java_versions=(8,)) +current_3_0_x = VersionMeta(name='current_3_0_x', family='3.0', variant='current', version='3.0.23', min_proto_v=3, max_proto_v=4, java_versions=(8,)) indev_3_11_x = VersionMeta(name='indev_3_11_x', family='3.11', variant='indev', version='github:apache/cassandra-3.11', min_proto_v=3, max_proto_v=4, java_versions=(8,)) current_3_11_x = VersionMeta(name='current_3_11_x', family='3.11', variant='current', version='github:apache/cassandra-3.11', min_proto_v=3, max_proto_v=4, java_versions=(8,)) @@ -151,7 +155,7 @@ MANIFEST = { indev_2_2_x: [indev_3_0_x, current_3_0_x, indev_3_11_x, current_3_11_x], current_2_2_x: [indev_2_2_x, indev_3_0_x, current_3_0_x, indev_3_11_x, current_3_11_x], - indev_3_0_x: [indev_3_11_x, current_3_11_x], + indev_3_0_x: [indev_3_11_x, current_3_11_x, indev_trunk], current_3_0_x: [indev_3_0_x, indev_3_11_x, current_3_11_x, indev_trunk], current_3_11_x: [indev_3_11_x, indev_trunk], @@ -194,6 +198,7 @@ def build_upgrade_pairs(): configured_strategy = CONFIG.getoption("--upgrade-version-selection").upper() version_select_strategy = VersionSelectionStrategies[configured_strategy].value[0] + filter_for_current_family = CONFIG.getoption("--upgrade-target-version-only") for origin_meta, destination_metas in list(manifest.items()): for destination_meta in destination_metas: @@ -208,6 +213,12 @@ def build_upgrade_pairs(): logger.debug("skipping class creation, no compatible protocol version between {} and {}".format(origin_meta.name, destination_meta.name)) continue + # if either origin or destination match version, then do the test + # the assumption is that a change in 3.0 could break upgrades to trunk, so include those tests as well + if filter_for_current_family and not origin_meta.matches_current_env_version_family and not destination_meta.matches_current_env_version_family: + logger.debug("skipping class creation, origin version {} and destination version {} do not match target version {}, and --upgrade-target-version-only was set".format(origin_meta.name, destination_meta.name, VERSION_FAMILY)) + continue + path_name = 'Upgrade_' + origin_meta.name + '_To_' + destination_meta.name if not (RUN_STATIC_UPGRADE_MATRIX or OVERRIDE_MANIFEST): --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org