Merge pull request #917 from moreati/cleanups

Test and build improvements
pull/918/head
Alex Willmer 3 years ago committed by GitHub
commit af03b9a9b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -193,8 +193,6 @@ class Fold(object):
def __exit__(self, _1, _2, _3): pass def __exit__(self, _1, _2, _3): pass
os.environ.setdefault('ANSIBLE_STRATEGY',
os.environ.get('STRATEGY', 'mitogen_linear'))
GIT_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) GIT_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
# Used only when MODE=mitogen # Used only when MODE=mitogen
DISTRO = os.environ.get('DISTRO', 'debian9') DISTRO = os.environ.get('DISTRO', 'debian9')

@ -7,7 +7,7 @@ ci_lib.DISTROS = ['debian']
ci_lib.run_batches([ ci_lib.run_batches([
[ [
'pip install -qqq "debops[ansible]==2.1.2"', 'python -m pip --no-python-version-warning --disable-pip-version-check "debops[ansible]==2.1.2"',
], ],
[ [
'aws ecr-public get-login-password | docker login --username AWS --password-stdin public.ecr.aws', 'aws ecr-public get-login-password | docker login --username AWS --password-stdin public.ecr.aws',

@ -60,7 +60,7 @@ setup(
license = 'New BSD', license = 'New BSD',
url = 'https://github.com/mitogen-hq/mitogen/', url = 'https://github.com/mitogen-hq/mitogen/',
packages = find_packages(exclude=['tests', 'examples']), packages = find_packages(exclude=['tests', 'examples']),
python_requires='>=2.4, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, <4', python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*',
zip_safe = False, zip_safe = False,
classifiers = [ classifiers = [
'Environment :: Console', 'Environment :: Console',
@ -70,10 +70,6 @@ setup(
'Operating System :: MacOS :: MacOS X', 'Operating System :: MacOS :: MacOS X',
'Operating System :: POSIX', 'Operating System :: POSIX',
'Programming Language :: Python', 'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.4',
'Programming Language :: Python :: 2.5',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.6',

@ -11,9 +11,7 @@ import unittest2
import ansible.template import ansible.template
from ansible.errors import AnsibleError
from ansible.plugins.action import ActionBase from ansible.plugins.action import ActionBase
from ansible.module_utils.six import string_types
TEMPLATE_KWARGS = {} TEMPLATE_KWARGS = {}

@ -1,6 +1,5 @@
#!/usr/bin/env python #!/usr/bin/env python
import os import os
import subprocess
import sys import sys
os.environ['ANSIBLE_STRATEGY'] = 'mitogen_linear' os.environ['ANSIBLE_STRATEGY'] = 'mitogen_linear'
os.execlp( os.execlp(

@ -5,6 +5,12 @@ Measure latency of .fork() setup/teardown.
import mitogen import mitogen
import mitogen.core import mitogen.core
try:
xrange
except NameError:
xrange = range
@mitogen.main() @mitogen.main()
def main(router): def main(router):
t0 = mitogen.core.now() t0 = mitogen.core.now()
@ -12,4 +18,4 @@ def main(router):
t = mitogen.core.now() t = mitogen.core.now()
ctx = router.fork() ctx = router.fork()
ctx.shutdown(wait=True) ctx.shutdown(wait=True)
print '++', 1000 * ((mitogen.core.now() - t0) / (1.0+x)) print('++ %d' % 1000 * ((mitogen.core.now() - t0) / (1.0+x)))

@ -6,7 +6,6 @@ import sys
import time import time
import tempfile import tempfile
import mock
import unittest2 import unittest2
import mitogen.core import mitogen.core
@ -80,7 +79,7 @@ def close_proc(proc):
proc.stdin.close() proc.stdin.close()
proc.stdout.close() proc.stdout.close()
if proc.stderr: if proc.stderr:
prco.stderr.close() proc.stderr.close()
def wait_read(fp, n): def wait_read(fp, n):

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/env python
# I am a Python interpreter that sits idle until the connection times out. # I am a Python interpreter that sits idle until the connection times out.
import time import time

@ -2,15 +2,12 @@ import errno
import fcntl import fcntl
import os import os
import signal import signal
import subprocess
import sys import sys
import tempfile
import time import time
import mock import mock
import unittest2 import unittest2
import testlib import testlib
from testlib import Popen__terminate
import mitogen.core import mitogen.core
import mitogen.parent import mitogen.parent

@ -25,7 +25,7 @@ def burn():
mul = 1.5 mul = 1.5
count = int(mul * multiprocessing.cpu_count()) count = int(mul * multiprocessing.cpu_count())
print count print(count)
procs = [multiprocessing.Process(target=burn) procs = [multiprocessing.Process(target=burn)
for _ in range(count)] for _ in range(count)]

@ -1,7 +1,3 @@
import logging
import time
import unittest2 import unittest2
import mitogen.core import mitogen.core

@ -56,10 +56,10 @@ basepython =
deps = deps =
-r{toxinidir}/tests/requirements.txt -r{toxinidir}/tests/requirements.txt
mode_ansible: -r{toxinidir}/tests/ansible/requirements.txt mode_ansible: -r{toxinidir}/tests/ansible/requirements.txt
ansible2.3: ansible=2.3.3.0 ansible2.3: ansible==2.3.3.0
ansible2.4: ansible=2.4.6.0 ansible2.4: ansible==2.4.6.0
ansible2.8: ansible=2.8.3 ansible2.8: ansible==2.8.3
ansible2.9: ansible=2.9.6 ansible2.9: ansible==2.9.6
ansible2.10: ansible-base<2.10.14 ansible2.10: ansible-base<2.10.14
ansible2.10: ansible==2.10.0 ansible2.10: ansible==2.10.0
ansible3: ansible-base<2.10.14 ansible3: ansible-base<2.10.14
@ -67,7 +67,7 @@ deps =
ansible4: ansible==4.8.0 ansible4: ansible==4.8.0
ansible5: ansible==5.0.1 ansible5: ansible==5.0.1
install_command = install_command =
python -m pip --no-python-version-warning install {opts} {packages} python -m pip --no-python-version-warning --disable-pip-version-check install {opts} {packages}
commands_pre = commands_pre =
mode_ansible: {toxinidir}/.ci/ansible_install.py mode_ansible: {toxinidir}/.ci/ansible_install.py
mode_debops_common: {toxinidir}/.ci/debops_common_install.py mode_debops_common: {toxinidir}/.ci/debops_common_install.py
@ -85,6 +85,8 @@ passenv =
AWS_SECRET_ACCESS_KEY AWS_SECRET_ACCESS_KEY
HOME HOME
setenv = setenv =
ANSIBLE_SKIP_TAGS = requires_local_sudo,resource_intensive
ANSIBLE_STRATEGY = mitogen_linear
NOCOVERAGE_ERASE = 1 NOCOVERAGE_ERASE = 1
NOCOVERAGE_REPORT = 1 NOCOVERAGE_REPORT = 1
# Only applicable to MODE=mitogen # Only applicable to MODE=mitogen
@ -115,7 +117,7 @@ setenv =
mode_ansible: MODE=ansible mode_ansible: MODE=ansible
mode_debops_common: MODE=debops_common mode_debops_common: MODE=debops_common
mode_mitogen: MODE=mitogen mode_mitogen: MODE=mitogen
strategy_linear: STRATEGY=linear strategy_linear: ANSIBLE_STRATEGY=linear
whitelist_externals = whitelist_externals =
docker docker
docker-credential-secretservice docker-credential-secretservice

Loading…
Cancel
Save