Skip to content

Commit

Permalink
Merge branch 'master' into dynamic-schedule
Browse files Browse the repository at this point in the history
  • Loading branch information
mtreinish authored Oct 29, 2019
2 parents 5d6fa6b + 46de174 commit 8933610
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 8 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ matrix:
env: TOXENV=py35
- python: "3.6"
env: TOXENV=py36
- os: linux
python: 3.8
env: TOXENV=py38
- os: linux
dist: xenial
python: 3.7
Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ jobs:
pip install -U tox
displayName: 'Install dependencies'
- script: tox -e py
displayName: 'Run Tox'
displayName: 'Run Tox'
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ classifier =
Programming Language :: Python :: 3.5
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Topic :: Software Development :: Testing
Topic :: Software Development :: Quality Assurance
project_urls =
Expand Down
7 changes: 4 additions & 3 deletions stestr/repository/memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

from extras import try_import

OrderedDict = try_import('collections.OrderedDict', dict)
from io import BytesIO
from operator import methodcaller

Expand All @@ -23,6 +22,8 @@

from stestr.repository import abstract as repository

OrderedDict = try_import('collections.OrderedDict', dict)


class RepositoryFactory(repository.AbstractRepositoryFactory):
"""A factory that can initialise and open memory repositories.
Expand Down Expand Up @@ -152,8 +153,8 @@ def _handle_test(self, test_dict):
duration_delta = stop - start
duration_seconds = (
(duration_delta.microseconds + (
duration_delta.seconds + duration_delta.days
* 24 * 3600) * 10 ** 6) / 10.0 ** 6)
duration_delta.seconds +
duration_delta.days * 24 * 3600) * 10 ** 6) / 10.0 ** 6)
self._repository._times[test_dict['id']] = duration_seconds

def stopTestRun(self):
Expand Down
5 changes: 4 additions & 1 deletion stestr/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ def partition_tests(test_ids, concurrency, repository, group_callback,
:return: A list where each element is a distinct subset of test_ids,
and the union of all the elements is equal to set(test_ids).
"""
def noop(_):
return None

_group_callback = group_callback
partitions = [list() for i in range(concurrency)]
timed_partitions = [[0.0, partition] for partition in partitions]
Expand All @@ -123,7 +126,7 @@ def partition_tests(test_ids, concurrency, repository, group_callback,
# Group tests: generate group_id -> test_ids.
group_ids = collections.defaultdict(list)
if _group_callback is None:
group_callback = lambda _: None
group_callback = noop
else:
group_callback = _group_callback
for test_id in test_ids:
Expand Down
4 changes: 2 additions & 2 deletions test-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
# of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later.

hacking<0.12,>=0.11.0 # Apache-2.0
hacking<1.2.0,>=1.1.0
sphinx!=1.6.6,!=1.6.7,<2.0.0;python_version=='2.7' # BSD
sphinx!=1.6.6,!=1.6.7,!=2.1.0;python_version>='3.4' # BSD
mock>=2.0 # BSD
subunit2sql>=1.8.0
coverage>=4.0 # Apache-2.0
ddt>=1.0.1 # MIT
doc8>=0.8.0 # Apache-2.0
doc8>=0.8.0 # Apache-2.0
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tox]
minversion = 1.6
envlist = py37,py36,py35,py34,py27,pep8
envlist = py38,py37,py36,py35,py34,py27,pep8
skipsdist = True

[testenv]
Expand Down

0 comments on commit 8933610

Please sign in to comment.