Merge "Added support for the multiprocess library in all unittest runners"

This commit is contained in:
Jenkins 2016-05-06 15:30:42 +00:00 committed by Gerrit Code Review
commit 4519791020
3 changed files with 51 additions and 4 deletions

View File

@ -20,7 +20,6 @@ import unittest
import uuid
from importlib import import_module
from inspect import isclass
from multiprocessing import Process, Manager
from re import search
from traceback import print_exc
from cafe.common.reporting import cclogging
@ -31,6 +30,16 @@ from cafe.drivers.unittest.decorators import (
from cafe.drivers.unittest.parsers import SummarizeResults
from cafe.drivers.unittest.suite import OpenCafeUnittestTestSuite
# Support for the alternate dill-based multiprocessing library 'multiprocess'
# as an experimental workaround if you're having pickling errors.
try:
from multiprocess import Process, Manager
sys.stdout.write(
"\n\nUtilizing the pathos multiprocess library. "
"This feature is experimental\n\n")
except:
from multiprocessing import Process, Manager
def tree(directory, padding, print_files=False):
"""

View File

@ -12,18 +12,26 @@
# under the License.
from __future__ import print_function
import sys
# Support for the alternate dill-based multiprocessing library 'multiprocess'
# as an experimental workaround if you're having pickling errors.
try:
from multiprocess import Process, Queue
sys.stdout.write(
"\n\nUtilizing the pathos multiprocess library. "
"This feature is experimental\n\n")
except:
from multiprocessing import Process, Queue
from multiprocessing import Process, Queue
from StringIO import StringIO
from unittest.runner import _WritelnDecorator
import importlib
import logging
import os
import sys
import time
import traceback
import unittest
from cafe.common.reporting import cclogging
from cafe.common.reporting.reporter import Reporter
from cafe.configurator.managers import TestEnvManager

View File

@ -0,0 +1,30 @@
# Copyright 2015 Rackspace
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
"""
This plugin installs the pathos multiprocess package.
Since pathos multiprocess is still in Beta, this plugin is considered
experimental.
If installed, the cafe unittest runners will use multiprocess instead of
python's default multiprocessing library.
"""
from setuptools import setup
setup(
name='cafe_pathos_multiprocess_plugin',
version='0.0.1',
description='The Common Automation Framework Engine',
author='Rackspace Cloud QE',
author_email='cloud-cafe@lists.rackspace.com',
url='http://rackspace.com',
install_requires=['multiprocess'])