ignas / nose_xunitmp Goto Github PK
View Code? Open in Web Editor NEWnosetest xunit plugin multiprocessor support
nosetest xunit plugin multiprocessor support
In scope of migration project to Py3 I've noticed that tests/support.py
uses print
statement and fails on Py3. Using print function in unit test makes test to be able run on 2 and 3 python version.
Add more Python classifiers to setup.py
to show to compatibility tools e.g. caniusepython3 that project compatible with Py3.
Build universal bdist_wheel. Project's code can be run on python 2 and 3.
I created a local branch with changes. Code was tested on 2.7 and 3.7 versions.
I can create a PR for that. Does it sound reasonable?
I'm running
nosetests -w tests/ --verbosity=3 --debug --debug-log=tests/logs/debug.log --xunitmp-file $CIRCLE_TEST_REPORTS/nose/junit.xml --with-flaky --processes=4 --process-timeout=500 --process-restartworker
And see all 4 tests start initially (selenium tests, so they launch instances of Chrome) but after most tests finish, all but one chrome instance close.
After a few moments, only a single browser is running, and the tests continue in serial.
What's going on?
I am trying to run some unit tests using the nose_xunitmp plugin and multiprocessing, but I cannot get it to work. The tests run correctly but nothing gets added to the xml file.
System information:
Operating System: Windows 8
Python Version: Python 2.7.7
nose==1.3.3
nose-xunitmp==0.3.2
I installed the nose_xunitmp plugin. This is the list of plugins installed in my system:
Plugin xunitmp
Plugin capture
Plugin failuredetail
Plugin xunit
Plugin deprecated
Plugin skip
Plugin multiprocess
Plugin logcapture
Plugin coverage
Plugin rednose
Plugin attributeselector
Plugin doctest
Plugin profile
Plugin id
Plugin allmodules
Plugin collect-only
Plugin isolation
Plugin pdb
This is the nose command I am running:
(my_virtual_env) C:\My_path>nosetests -v -a type=smoke --logging-level=INFO --with-xunitmp --xunitmp-file=test-results.xml --processes=2 --process-timeout=5400
Four tests were executed:
My Test 1. ... ok
My Test 2. ... ok
My Test 3. ... ok
My Test 4. ... ok
Ran 4 tests in 272.909s
OK
But this is the content of the test-results.xml file:
Locally, it works fine.
On my build server, I get:
Unable to load plugin xunitmp = nose_xunitmp:XunitMP: cannot import name force_unicode
Which then causes my test command:
nosetests -w tests/ --verbosity=3 --debug --debug-log=tests/logs/debug.log --with-xunitmp --xunitmp-file $CIRCLE_TEST_REPORTS/nose/junit.xml --with-flaky --no-success-flaky-report --force-flaky --max-runs=3 --processes=4 --process-timeout=780 --process-restartworker
to fail with:
nosetests: error: no such option: --with-xunitmp
Running sudo pip install -r requirements.txt; [test command]
my full output is:
The directory '/home/ubuntu/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/ubuntu/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting selenose (from -r requirements.txt (line 1))
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:315: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#snimissingwarning.
SNIMissingWarning
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:120: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
Downloading selenose-1.3.tar.gz
Requirement already satisfied (use --upgrade to upgrade): requests in /usr/lib/python2.7/dist-packages (from -r requirements.txt (line 2))
Collecting flaky (from -r requirements.txt (line 3))
Downloading flaky-3.1.1-py2.py3-none-any.whl
Collecting nose-parallel (from -r requirements.txt (line 4))
Downloading nose_parallel-0.2.0-py2-none-any.whl
Collecting nose-xunitmp (from -r requirements.txt (line 5))
Downloading nose_xunitmp-0.4.0.tar.gz
Requirement already satisfied (use --upgrade to upgrade): nose>=1.1.2 in /usr/lib/python2.7/dist-packages (from selenose->-r requirements.txt (line 1))
Collecting selenium>=2.25.0 (from selenose->-r requirements.txt (line 1))
Downloading selenium-2.53.6-py2.py3-none-any.whl (884kB)
100% |████████████████████████████████| 890kB 1.3MB/s
Installing collected packages: selenium, selenose, flaky, nose-parallel, nose-xunitmp
Running setup.py install for selenose ... -� �\� �done
Running setup.py install for nose-xunitmp ... -� �done
Successfully installed flaky-3.1.1 nose-parallel-0.2.0 nose-xunitmp-0.4.0 selenium-2.53.6 selenose-1.3
You are using pip version 8.1.1, however version 8.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
/usr/lib/python2.7/dist-packages/nose/plugins/manager.py:383: RuntimeWarning: Unable to load plugin xunitmp = nose_xunitmp:XunitMP: cannot import name force_unicode
RuntimeWarning)
Usage: nosetests [options]
nosetests: error: no such option: --with-xunitmp
Couldn't find anything in google (just similar sounding issues with django with no solution)
I'm also sending this to CircleCI support. Will relay back if they have a solution.
Thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.