Default concurrency to 0 to avoid TypeError in stestr

The traceback would look like

Traceback (most recent call last):
  File ".../bin/ostestr", line 10, in <module>
    sys.exit(main())
  File ".../os_testr/ostestr.py", line 263, in main
    exit(ostestr(sys.argv[1:]))
  File ".../os_testr/ostestr.py", line 259, in ostestr
    return _select_and_call_runner(opts, regex, others)
  File ".../os_testr/ostestr.py", line 212, in _select_and_call_runner
    black_regex=opts.black_regex)
  File ".../os_testr/ostestr.py", line 167, in call_testr
    black_regex=black_regex)
  File ".../stestr/commands/run.py", line 334, in run_command
    concurrency = _to_int(concurrency)
  File ".../stestr/commands/run.py", line 39, in _to_int
    i = int(possible)
TypeError: int() argument must be a string or a number, not 'NoneType'

New enough stestr will tolerate it, but still write a warning to stderr.
See https://github.com/mtreinish/stestr/commit/ac8dac0

Change-Id: I70a3ed6c3edaafc8bb6269b1ae07bd46b06f4db4
This commit is contained in:
Tim Burke 2019-04-09 08:26:16 -07:00
parent a36d10a3e3
commit 595c06c5bc
1 changed files with 1 additions and 0 deletions

View File

@ -91,6 +91,7 @@ def get_parser(args):
parallel.add_argument('--serial', dest='parallel', action='store_false',
help='Run tests serially')
parser.add_argument('--concurrency', '-c', type=int, metavar='WORKERS',
default=0,
help='The number of workers to use when running in '
'parallel. By default this is the number of cpus')
parser.add_argument('--until-failure', action='store_true',