MultiUpgrade(name='ProtoV4Upgrade_AllVersions_RandomPartitioner_EndsAt_Trunk_HEAD', version_metas=[current_2_2_x, current_3_0_x, indev_3_x], protocol_version=4, extra_config=( ('partitioner', 'org.apache.cassandra.dht.RandomPartitioner'), )), ) for upgrade in MULTI_UPGRADES: # if any version_metas are None, this means they are versions not to be tested currently if all(upgrade.version_metas): metas = upgrade.version_metas if not RUN_STATIC_UPGRADE_MATRIX: if metas[-1].matches_current_env_version_family: # looks like this test should actually run in the current env, so let's set the final version to match the env exactly oldmeta = metas[-1] newmeta = oldmeta.clone_with_local_env_version() debug("{} appears applicable to current env. Overriding final test version from {} to {}".format(upgrade.name, oldmeta.version, newmeta.version)) metas[-1] = newmeta create_upgrade_class(upgrade.name, [m for m in metas], protocol_version=upgrade.protocol_version, extra_config=upgrade.extra_config) for pair in build_upgrade_pairs(): create_upgrade_class( 'Test' + pair.name, [pair.starting_meta, pair.upgrade_meta], protocol_version=pair.starting_meta.max_proto_v, bootstrap_test=True )
topology_specs = [ { 'NODES': 3, 'RF': 3, 'CL': ConsistencyLevel.ALL }, { 'NODES': 2, 'RF': 1 }, ] specs = [ dict(s, UPGRADE_PATH=p, __test__=True) for s, p in itertools.product(topology_specs, build_upgrade_pairs()) ] for spec in specs: suffix = 'Nodes{num_nodes}RF{rf}_{pathname}'.format( num_nodes=spec['NODES'], rf=spec['RF'], pathname=spec['UPGRADE_PATH'].name) gen_class_name = TestThrift.__name__ + suffix assert_not_in(gen_class_name, globals()) upgrade_applies_to_env = RUN_STATIC_UPGRADE_MATRIX or spec[ 'UPGRADE_PATH'].upgrade_meta.matches_current_env_version_family globals()[gen_class_name] = skipUnless(upgrade_applies_to_env, 'test not applicable to env.')(type( gen_class_name, (TestThrift, ),
version_metas=[current_2_2_x, current_3_0_x, indev_3_x], protocol_version=4, extra_config=(('partitioner', 'org.apache.cassandra.dht.RandomPartitioner'), )), ) for upgrade in MULTI_UPGRADES: # if any version_metas are None, this means they are versions not to be tested currently if all(upgrade.version_metas): metas = upgrade.version_metas if not RUN_STATIC_UPGRADE_MATRIX: if metas[-1].matches_current_env_version_family: # looks like this test should actually run in the current env, so let's set the final version to match the env exactly oldmeta = metas[-1] newmeta = oldmeta.clone_with_local_env_version() debug( "{} appears applicable to current env. Overriding final test version from {} to {}" .format(upgrade.name, oldmeta.version, newmeta.version)) metas[-1] = newmeta create_upgrade_class(upgrade.name, [m for m in metas], protocol_version=upgrade.protocol_version, extra_config=upgrade.extra_config) for pair in build_upgrade_pairs(): create_upgrade_class('Test' + pair.name, [pair.starting_meta, pair.upgrade_meta], protocol_version=pair.starting_meta.max_proto_v, bootstrap_test=True)
_validate_sparse_thrift(client, cf='sparse_super_2') _validate_sparse_cql(cursor, cf='sparse_super_2') for is_upgraded, cursor in self.do_upgrade(cursor, row_factory=dict_factory, use_thrift=True): debug("Querying {} node".format("upgraded" if is_upgraded else "old")) client = get_thrift_client(host, port) _validate_sparse_thrift(client, cf='sparse_super_2') _validate_sparse_cql(cursor, cf='sparse_super_2') topology_specs = [ {'NODES': 3, 'RF': 3, 'CL': ConsistencyLevel.ALL}, {'NODES': 2, 'RF': 1}, ] specs = [dict(s, UPGRADE_PATH=p, __test__=True) for s, p in itertools.product(topology_specs, build_upgrade_pairs())] for spec in specs: suffix = 'Nodes{num_nodes}RF{rf}_{pathname}'.format(num_nodes=spec['NODES'], rf=spec['RF'], pathname=spec['UPGRADE_PATH'].name) gen_class_name = TestThrift.__name__ + suffix assert_not_in(gen_class_name, globals()) upgrade_applies_to_env = RUN_STATIC_UPGRADE_MATRIX or spec['UPGRADE_PATH'].upgrade_meta.matches_current_env_version_family globals()[gen_class_name] = skipUnless(upgrade_applies_to_env, 'test not applicable to env.')(type(gen_class_name, (TestThrift,), spec))