Merge "Support running tests w/eventlet monkey patching"
This commit is contained in:
commit
f767d6df1b
@ -38,14 +38,23 @@
|
||||
- ^releasenotes/.*$
|
||||
- ^\.pre-commit-config\.yaml$
|
||||
|
||||
- job:
|
||||
name: oslo.log-tox-py312-eventlet-patched
|
||||
parent: openstack-tox-py312
|
||||
vars:
|
||||
tox_environment:
|
||||
OSLO_LOG_TEST_EVENTLET: 1
|
||||
|
||||
- project:
|
||||
check:
|
||||
jobs:
|
||||
- oslo.log-src-grenade
|
||||
- oslo.log-jsonformatter
|
||||
- oslo.log-tox-py312-eventlet-patched
|
||||
gate:
|
||||
jobs:
|
||||
- oslo.log-jsonformatter
|
||||
- oslo.log-tox-py312-eventlet-patched
|
||||
templates:
|
||||
- check-requirements
|
||||
- lib-forward-testing-python3
|
||||
|
@ -15,13 +15,15 @@
|
||||
|
||||
import errno
|
||||
import fcntl
|
||||
import os
|
||||
|
||||
import eventlet
|
||||
import eventlet.debug
|
||||
import eventlet.greenthread
|
||||
import eventlet.hubs
|
||||
|
||||
# We want the blocking APIs, because we set file descriptors to non-blocking.
|
||||
os = eventlet.patcher.original("os")
|
||||
|
||||
|
||||
class PipeMutex:
|
||||
"""Mutex using a pipe.
|
||||
|
@ -0,0 +1,5 @@
|
||||
import os
|
||||
|
||||
if os.environ.get("OSLO_LOG_TEST_EVENTLET") == "1":
|
||||
import eventlet
|
||||
eventlet.monkey_patch()
|
2
tox.ini
2
tox.ini
@ -7,9 +7,11 @@ ignore_basepython_conflict = true
|
||||
basepython = python3
|
||||
allowlist_externals =
|
||||
find
|
||||
env
|
||||
deps =
|
||||
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
||||
-r{toxinidir}/test-requirements.txt
|
||||
passenv = OSLO_LOG_TEST_EVENTLET
|
||||
commands =
|
||||
find . -type f -name "*.pyc" -delete
|
||||
stestr run {posargs}
|
||||
|
Loading…
Reference in New Issue
Block a user