mirror of
https://github.com/ceph/ceph
synced 2025-02-19 17:08:05 +00:00
suite: schedule a list of collections for running instead of a single suite directory
This commit is contained in:
parent
23aae67aff
commit
044a88ce59
@ -10,6 +10,7 @@ import time
|
||||
import yaml
|
||||
|
||||
from teuthology import misc as teuthology
|
||||
from teuthology import safepath
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
@ -17,15 +18,12 @@ def main():
|
||||
parser = argparse.ArgumentParser(description="""
|
||||
Run a suite of ceph integration tests.
|
||||
|
||||
A suite is a directory containing a subdirectory collections/
|
||||
containing collections.
|
||||
A suite is a set of collections.
|
||||
|
||||
A collection is a directory containing facets.
|
||||
|
||||
A facet is a directory containing config snippets.
|
||||
|
||||
Running the suite means running teuthology for every collection.
|
||||
|
||||
Running a collection means running teuthology for every configuration
|
||||
combination generated by taking one config snippet from each facet.
|
||||
|
||||
@ -38,20 +36,21 @@ combination, and will override anything in the suite.
|
||||
help='be more verbose',
|
||||
)
|
||||
parser.add_argument(
|
||||
'--suite',
|
||||
metavar='DIR',
|
||||
help='suite of tests to run',
|
||||
'--name',
|
||||
help='name for this suite',
|
||||
required=True,
|
||||
)
|
||||
parser.add_argument(
|
||||
'--collections',
|
||||
metavar='DIR',
|
||||
nargs='+',
|
||||
required=True,
|
||||
help='the collections to run',
|
||||
)
|
||||
parser.add_argument(
|
||||
'--owner',
|
||||
help='job owner',
|
||||
)
|
||||
parser.add_argument(
|
||||
'--name',
|
||||
help='name for this suite',
|
||||
required=True,
|
||||
)
|
||||
parser.add_argument(
|
||||
'--email',
|
||||
help='address to email test failures to',
|
||||
@ -84,19 +83,6 @@ combination, and will override anything in the suite.
|
||||
level=loglevel,
|
||||
)
|
||||
|
||||
collection_dir = os.path.join(args.suite,'collections')
|
||||
print collection_dir
|
||||
if os.path.exists(collection_dir) and os.path.isdir(collection_dir):
|
||||
collections = [
|
||||
(os.path.join(collection_dir, f), f)
|
||||
for f in sorted(os.listdir(collection_dir))
|
||||
if not f.startswith('.')
|
||||
and os.path.isdir(os.path.join(collection_dir, f))
|
||||
]
|
||||
else:
|
||||
# degenerate case; 'suite' is actually a single collection
|
||||
collections = [(args.suite, 'none')]
|
||||
|
||||
base_arg = [
|
||||
os.path.join(os.path.dirname(sys.argv[0]), 'teuthology-schedule'),
|
||||
'--name', args.name,
|
||||
@ -106,6 +92,17 @@ combination, and will override anything in the suite.
|
||||
if args.owner:
|
||||
base_arg.extend(['--owner', args.owner])
|
||||
|
||||
for collection in args.collections:
|
||||
if not os.path.isdir(collection):
|
||||
print >>sys.stderr, 'Collection %s is not a directory' % collection
|
||||
sys.exit(1)
|
||||
|
||||
collections = [
|
||||
(collection,
|
||||
os.path.basename(safepath.munge(collection)))
|
||||
for collection in args.collections
|
||||
]
|
||||
|
||||
for collection, collection_name in sorted(collections):
|
||||
log.info('Collection %s in %s' % (collection_name, collection))
|
||||
facets = [
|
||||
@ -136,7 +133,6 @@ combination, and will override anything in the suite.
|
||||
])
|
||||
arg.extend(path for facet, name, path in configs)
|
||||
arg.extend(args.config)
|
||||
print arg
|
||||
subprocess.check_call(
|
||||
args=arg,
|
||||
)
|
||||
@ -148,7 +144,7 @@ combination, and will override anything in the suite.
|
||||
if args.timeout:
|
||||
arg.extend(['--timeout', args.timeout])
|
||||
subprocess.check_call(
|
||||
args=arg
|
||||
args=arg,
|
||||
)
|
||||
|
||||
def ls():
|
||||
|
Loading…
Reference in New Issue
Block a user