From: Zack Cerza Date: Thu, 12 Jun 2014 16:25:30 +0000 (-0500) Subject: Only allow scheduling one suite per call. X-Git-Tag: 1.1.0~1396 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=43505b2ace60a3a7b9f32b014fe6860e8a2f7db3;p=teuthology.git Only allow scheduling one suite per call. Also remove all traces of the extra and confusing term 'collection' Signed-off-by: Zack Cerza --- diff --git a/schedule_suite.sh b/schedule_suite.sh index 94955c2080..0c0581be50 100755 --- a/schedule_suite.sh +++ b/schedule_suite.sh @@ -205,7 +205,7 @@ echo "name $name" ./virtualenv/bin/teuthology-suite -v $fn \ --base ~/src/ceph-qa-suite/suites \ - --collections $suite \ + --suite $suite \ --email $email \ --timeout 36000 \ $limitline \ diff --git a/scripts/suite.py b/scripts/suite.py index b8a9cb5011..cbbd9fd643 100644 --- a/scripts/suite.py +++ b/scripts/suite.py @@ -4,15 +4,15 @@ import teuthology.suite doc = """ usage: teuthology-suite [-h] - teuthology-suite --name --collections ... [options] - teuthology-suite -n -c ... [options] [...] + teuthology-suite --name --suite [options] + teuthology-suite -n -s [options] [...] -Run a suite of ceph integration tests. A suite is a set of collections. A -collection is a directory containing facets. A facet is a directory containing -config snippets. Running a collection means running teuthology for every -configuration combination generated by taking one config snippet from each -facet. Any config files passed on the command line will be used for every -combination, and will override anything in the suite. +Run a suite of ceph integration tests. A suite is a directory containing +facets. A facet is a directory containing config snippets. Running a suite +means running teuthology for every configuration combination generated by +taking one config snippet from each facet. Any config files passed on the +command line will be used for every combination, and will override anything in +the suite. positional arguments: Optional extra job yaml to include @@ -22,9 +22,10 @@ optional arguments: -v, --verbose Be more verbose --dry-run Do a dry run; do not schedule anything -n, --name Name for this suite - --base Base directory for the collection(s) - -c , --collections - The collections to run + --base Base directory for the suite + e.g. ~/src/ceph-qa-suite/suites + -s , --suite + The suite to run --owner Job owner --email When tests finish or time out, send an email to this address. diff --git a/teuthology/suite.py b/teuthology/suite.py index 399f4661c6..49a219791c 100644 --- a/teuthology/suite.py +++ b/teuthology/suite.py @@ -26,7 +26,7 @@ def main(args): worker = args['--worker'] owner = args['--owner'] base = args['--base'] - collections = args['--collections'] + suite = args['--suite'] email = args['--email'] timeout = args['--timeout'] base_yaml_paths = args[''] @@ -50,24 +50,18 @@ def main(args): if owner: base_args.extend(['--owner', owner]) - collections = [ - (os.path.join(base, collection), collection) - for collection in collections - ] + suite_path = os.path.join(base, suite) num_jobs = 0 - for collection, collection_name in sorted(collections): - num_created = schedule_collection(name=collection_name, - collection=collection, - base_yamls=base_yaml_paths, - base_args=base_args, - arch=arch, - machine_type=machine_type, - limit=limit, - offset=num_jobs, - dry_run=dry_run, - ) - num_jobs += num_created + schedule_suite(name=suite, + path=suite_path, + base_yamls=base_yaml_paths, + base_args=base_args, + arch=arch, + machine_type=machine_type, + limit=limit, + dry_run=dry_run, + ) if num_jobs: arg = copy.deepcopy(base_args) @@ -84,30 +78,29 @@ def main(args): ) -def schedule_collection(name, - collection, - base_yamls, - base_args, - arch, - machine_type, - limit=0, - offset=0, - dry_run=True, - ): +def schedule_suite(name, + path, + base_yamls, + base_args, + arch, + machine_type, + limit=0, + dry_run=True, + ): """ - schedule one collection. + schedule one suite. returns number of jobs scheduled """ count = 0 - log.debug('Collection %s in %s' % (name, collection)) + log.debug('Suite %s in %s' % (name, path)) configs = [(combine_path(name, item[0]), item[1]) for item in - build_matrix(collection)] + build_matrix(path)] job_count = len(configs) - log.info('Collection %s in %s generated %d jobs' % ( - name, collection, len(configs))) + log.info('Suite %s in %s generated %d jobs' % ( + name, path, len(configs))) for description, config in configs: - if limit > 0 and (count + offset) >= limit: + if limit > 0 and count >= limit: log.info( 'Stopped after {limit} jobs due to --limit={limit}'.format( limit=limit))