Allow splitting test groups into sub groups

When registering a new test group we
give it a group name and a list of tests to run.

    register(['foo'], [t1, t2, t3])

creates group 'foo' running tests t1, t2 and t3.

This method has been extended to allow passing a dict
of tests with keys used as group name suffixes.

    register(['foo'], sub1=[t1, t2], sub2=[t3])

creates group 'foo' running all tests t1, t2 and t3
and groups 'foo_sub1' running t1, t2
and group 'foo_sub2' running t3

The plan is to split long-running datastore tests
into multiple sub-groups that can run as separate jobs.

Generally, we will want to run replication and
clustering in one job separate from everything else.
I have registered a 'single' (tests on a single instance)
and 'multi' (tests woring on a set of instances) sub-groups
for all datastores (for consistency).

This does not change how the tests run.
It just creates '*_single' and '*_multi' sub-groups in addition
to the existing '<datastore>_supported' groups.
We will need to update the project config to run sub-jobs
for datastores that require it.

Change-Id: Iea2a996043b4c2d1889995e160891af33ffab5b6
This commit is contained in:
Petr Malik 2016-11-18 16:13:26 -05:00
parent 48dcbb6dcd
commit 93f1ae8f09

View File

@ -69,8 +69,20 @@ def build_group(*groups):
return out return out
def register(datastores, *test_groups): def register(group_names, *test_groups, **kwargs):
proboscis.register(groups=build_group(datastores), if kwargs:
register(group_names, kwargs.values())
for suffix, grp_set in kwargs.items():
# Recursively call without the kwargs
register([name + '_' + suffix for name in group_names], *grp_set)
return
# Do the actual registration here
proboscis.register(groups=build_group(group_names),
depends_on_groups=build_group(*test_groups))
# Now register the same groups with '-' instead of '_'
proboscis.register(groups=build_group(
[name.replace('_', '-') for name in group_names]),
depends_on_groups=build_group(*test_groups)) depends_on_groups=build_group(*test_groups))
black_box_groups = [ black_box_groups = [
@ -230,97 +242,111 @@ register(["user"], user_actions_groups)
# These should contain all functionality currently supported by the datastore. # These should contain all functionality currently supported by the datastore.
# Keeping them in alphabetical order may reduce the number of merge conflicts. # Keeping them in alphabetical order may reduce the number of merge conflicts.
register( register(
["db2_supported"], common_groups, ["db2_supported"],
configuration_groups, single=[common_groups,
database_actions_groups, configuration_groups,
user_actions_groups, database_actions_groups,
user_actions_groups, ],
multi=[]
) )
register( register(
["cassandra_supported"], common_groups, ["cassandra_supported"],
backup_groups, single=[common_groups,
database_actions_groups, backup_groups,
cluster_actions_groups, database_actions_groups,
configuration_groups, configuration_groups,
user_actions_groups, user_actions_groups, ],
multi=[cluster_actions_groups, ]
) )
register( register(
["couchbase_supported"], common_groups, ["couchbase_supported"],
backup_groups, single=[common_groups,
root_actions_groups, backup_groups,
root_actions_groups, ],
multi=[]
) )
register( register(
["couchdb_supported"], common_groups, ["couchdb_supported"],
backup_groups, single=[common_groups,
database_actions_groups, backup_groups,
root_actions_groups, database_actions_groups,
user_actions_groups, root_actions_groups,
user_actions_groups, ],
multi=[]
) )
register( register(
["postgresql_supported"], common_groups, ["postgresql_supported"],
backup_incremental_groups, single=[common_groups,
database_actions_groups, backup_incremental_groups,
configuration_groups, database_actions_groups,
replication_groups, configuration_groups,
root_actions_groups, root_actions_groups,
user_actions_groups, user_actions_groups, ],
multi=[replication_groups, ]
) )
register( register(
["mysql_supported", "percona_supported"], common_groups, ["mysql_supported", "percona_supported"],
backup_incremental_groups, single=[common_groups,
configuration_groups, backup_incremental_groups,
database_actions_groups, configuration_groups,
instance_upgrade_groups, database_actions_groups,
replication_promote_groups, instance_upgrade_groups,
root_actions_groups, root_actions_groups,
user_actions_groups, user_actions_groups, ],
multi=[replication_promote_groups, ]
) )
register( register(
["mariadb_supported"], common_groups, ["mariadb_supported"],
backup_incremental_groups, single=[common_groups,
cluster_actions_groups, backup_incremental_groups,
configuration_groups, configuration_groups,
database_actions_groups, database_actions_groups,
replication_promote_groups, root_actions_groups,
root_actions_groups, user_actions_groups, ],
user_actions_groups, multi=[replication_promote_groups,
cluster_actions_groups, ]
) )
register( register(
["mongodb_supported"], common_groups, ["mongodb_supported"],
backup_groups, single=[common_groups,
cluster_actions_groups, backup_groups,
configuration_groups, configuration_groups,
database_actions_groups, database_actions_groups,
root_actions_groups, root_actions_groups,
user_actions_groups, user_actions_groups, ],
multi=[cluster_actions_groups, ]
) )
register( register(
["pxc_supported"], common_groups, ["pxc_supported"],
backup_incremental_groups, single=[common_groups,
cluster_actions_groups, backup_incremental_groups,
configuration_groups, configuration_groups,
database_actions_groups, database_actions_groups,
root_actions_groups, root_actions_groups,
user_actions_groups, user_actions_groups, ],
multi=[cluster_actions_groups, ]
) )
register( register(
["redis_supported"], common_groups, ["redis_supported"],
backup_groups, single=[common_groups,
cluster_actions_groups, backup_groups, ],
replication_promote_groups, multi=[replication_promote_groups,
cluster_actions_groups, ]
) )
register( register(
["vertica_supported"], common_groups, ["vertica_supported"],
cluster_actions_groups, single=[common_groups,
configuration_groups, configuration_groups,
root_actions_groups, root_actions_groups, ],
multi=[cluster_actions_groups, ]
) )