Hello community, here is the log from the commit of package python-oslotest for openSUSE:Factory checked in at 2015-06-17 16:16:15 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-oslotest (Old) and /work/SRC/openSUSE:Factory/.python-oslotest.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-oslotest" Changes: -------- --- /work/SRC/openSUSE:Factory/python-oslotest/python-oslotest.changes 2014-09-28 19:54:46.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.python-oslotest.new/python-oslotest.changes 2015-06-17 16:16:17.000000000 +0200 @@ -1,0 +2,41 @@ +Tue Apr 7 15:24:05 UTC 2015 - [email protected] + +- update to 1.5.1 + +------------------------------------------------------------------- +Tue Feb 24 15:37:38 UTC 2015 - [email protected] + +- update to 1.5.0: + * Restore missing module for pre-release test script + * Updated from global requirements + * Set a higher default for maxDiff + * Move the script for running pre-releases into oslotest + * Update docs for new script name + * Publish cross-test runner as part of oslotest + * Fix for mktemp failure on osx + * Activate pep8 check that _ is imported + * Workflow documentation is now in infra-manual + * Fix the URL for reporting bugs in the README + * Updated from global requirements + * Add pbr to installation requirements + * Clean up the docs for oslo_debug_helper +- Adjust Requires according to requirements.txt +- Add oslo_run_cross_tests oslo_run_pre_release_tests to /usr/bin/ + + +------------------------------------------------------------------- +Tue Oct 28 09:06:07 UTC 2014 - [email protected] + +- update to 1.2.0: + * Updated from global requirements + * Set install_command in tox to avoid pre-releases + * Add an extra parameter for test directory in debugger script + * Handle tempfile content encoding + * Work toward Python 3.4 support and testing + * Add links to best practices video and etherpad + * Updated from global requirements + * Drop .sh extension from oslo_debug_helper.sh + * Add history/changelog to docs + * fix typo and formatting in contributing docs + +------------------------------------------------------------------- Old: ---- oslotest-1.1.0.tar.gz New: ---- _service oslotest-1.5.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-oslotest.spec ++++++ --- /var/tmp/diff_new_pack.YA0hi8/_old 2015-06-17 16:16:18.000000000 +0200 +++ /var/tmp/diff_new_pack.YA0hi8/_new 2015-06-17 16:16:18.000000000 +0200 @@ -1,7 +1,7 @@ # # spec file for package python-oslotest # -# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: python-oslotest -Version: 1.1.0 +Version: 1.5.1 Release: 0 Summary: OpenStack test framework License: Apache-2.0 @@ -37,12 +37,12 @@ BuildRequires: python-testtools >= 0.9.34 Requires: python-fixtures >= 0.3.14 Requires: python-mock >= 1 -Requires: python-mox3 >= 0.7.0 +Requires: python-mox3 >= 0.7 Requires: python-python-subunit >= 0.0.18 -Requires: python-six +Requires: python-six >= 1.9 Requires: python-testrepository >= 0.0.18 Requires: python-testscenarios >= 0.4 -Requires: python-testtools >= 0.9.34 +Requires: python-testtools >= 0.9.36 BuildRoot: %{_tmppath}/%{name}-%{version}-build %if 0%{?suse_version} && 0%{?suse_version} <= 1110 BuildRequires: python-discover @@ -69,7 +69,10 @@ %files %defattr(-,root,root,-) %doc ChangeLog README.rst LICENSE AUTHORS -%{_bindir}/oslo_debug_helper.sh +%{_bindir}/oslo_debug_helper +%{_bindir}/oslo_run_cross_tests +%{_bindir}/oslo_run_pre_release_tests + %{python_sitelib}/* %changelog ++++++ _service ++++++ <services> <service mode="disabled" name="download_files"> <param name="changesgenerate">enable</param> </service> <service mode="disabled" name="set_version"> <param name="basename">oslotest</param> </service> <service name="refresh_patches" mode="disabled"> <param name="changesgenerate">enable</param> </service> <service name="python_requires" mode="disabled"> </service> </services> ++++++ oslotest-1.1.0.tar.gz -> oslotest-1.5.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslotest-1.1.0/AUTHORS new/oslotest-1.5.1/AUTHORS --- old/oslotest-1.1.0/AUTHORS 2014-09-18 14:15:35.000000000 +0200 +++ new/oslotest-1.5.1/AUTHORS 2015-03-09 15:36:13.000000000 +0100 @@ -1,6 +1,8 @@ Alessio Ababilov <[email protected]> +Alex Meade <[email protected]> Alexander Gorodnev <[email protected]> Angus Salkeld <[email protected]> +Ben Nemec <[email protected]> Chang Bo Guo <[email protected]> Christian Berendt <[email protected]> Chuck Short <[email protected]> @@ -11,11 +13,13 @@ George Peristerakis <[email protected]> Ihar Hrachyshka <[email protected]> Ilya Pekelny <[email protected]> +James Carey <[email protected]> Jason Kölker <[email protected]> Jay Pipes <[email protected]> Jeremy Stanley <[email protected]> Joe Gordon <[email protected]> Joe Heck <[email protected]> +Joshua Harlow <[email protected]> Julien Danjou <[email protected]> Luis A. Garcia <[email protected]> Marc Koderer <[email protected]> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslotest-1.1.0/CONTRIBUTING.rst new/oslotest-1.5.1/CONTRIBUTING.rst --- old/oslotest-1.1.0/CONTRIBUTING.rst 2014-09-18 14:15:06.000000000 +0200 +++ new/oslotest-1.5.1/CONTRIBUTING.rst 2015-03-09 15:35:54.000000000 +0100 @@ -1,17 +1,16 @@ If you would like to contribute to the development of OpenStack, -you must follow the steps in the "If you're a developer, start here" -section of this page: +you must follow the steps in this page: - http://wiki.openstack.org/HowToContribute + http://docs.openstack.org/infra/manual/developers.html Once those steps have been completed, changes to OpenStack should be submitted for review via the Gerrit tool, following the workflow documented at: - http://wiki.openstack.org/GerritWorkflow + http://docs.openstack.org/infra/manual/developers.html#development-workflow Pull requests submitted through GitHub will be ignored. Bugs should be filed on Launchpad, not GitHub: - https://bugs.launchpad.net/oslo.test \ No newline at end of file + https://bugs.launchpad.net/oslotest \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslotest-1.1.0/ChangeLog new/oslotest-1.5.1/ChangeLog --- old/oslotest-1.1.0/ChangeLog 2014-09-18 14:15:35.000000000 +0200 +++ new/oslotest-1.5.1/ChangeLog 2015-03-09 15:36:13.000000000 +0100 @@ -1,9 +1,56 @@ CHANGES ======= +1.5.1 +----- + + +1.5.0 +----- + +* Force rebuild egg-info before running cross tests +* Restore missing module for pre-release test script +* Updated from global requirements + +1.4.0 +----- + +* Set a higher default for maxDiff +* Move the script for running pre-releases into oslotest +* Update docs for new script name +* Publish cross-test runner as part of oslotest +* Fix for mktemp failure on osx +* Activate pep8 check that _ is imported +* Workflow documentation is now in infra-manual +* Fix the URL for reporting bugs in the README + +1.3.0 +----- + +* Updated from global requirements +* Updated from global requirements +* Updated from global requirements +* Add pbr to installation requirements +* Clean up the docs for oslo_debug_helper + +1.2.0 +----- + +* Updated from global requirements +* Set install_command in tox to avoid pre-releases +* Add an extra parameter for test directory in debugger script +* Handle tempfile content encoding +* Work toward Python 3.4 support and testing +* Add links to best practices video and etherpad +* Updated from global requirements +* Drop .sh extension from oslo_debug_helper.sh +* Add history/changelog to docs +* fix typo and formatting in contributing docs + 1.1.0 ----- +* warn against sorting requirements * Add fixture for mock.patch.multiple * Ensure that mock.patch.stopall is called last * Remove differences between Python 2.x and 3.x versions diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslotest-1.1.0/PKG-INFO new/oslotest-1.5.1/PKG-INFO --- old/oslotest-1.1.0/PKG-INFO 2014-09-18 14:15:36.000000000 +0200 +++ new/oslotest-1.5.1/PKG-INFO 2015-03-09 15:36:14.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: oslotest -Version: 1.1.0 +Version: 1.5.1 Summary: OpenStack test framework Home-page: http://launchpad.net/oslo Author: OpenStack @@ -15,7 +15,7 @@ * Free software: Apache license * Documentation: http://docs.openstack.org/developer/oslotest * Source: http://git.openstack.org/cgit/openstack/oslotest - * Bugs: http://bugs.launchpad.net/oslo + * Bugs: http://bugs.launchpad.net/oslotest Platform: UNKNOWN diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslotest-1.1.0/README.rst new/oslotest-1.5.1/README.rst --- old/oslotest-1.1.0/README.rst 2014-09-18 14:15:05.000000000 +0200 +++ new/oslotest-1.5.1/README.rst 2015-03-09 15:35:54.000000000 +0100 @@ -7,4 +7,4 @@ * Free software: Apache license * Documentation: http://docs.openstack.org/developer/oslotest * Source: http://git.openstack.org/cgit/openstack/oslotest -* Bugs: http://bugs.launchpad.net/oslo +* Bugs: http://bugs.launchpad.net/oslotest diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslotest-1.1.0/doc/source/contributing.rst new/oslotest-1.5.1/doc/source/contributing.rst --- old/oslotest-1.1.0/doc/source/contributing.rst 2014-09-18 14:15:06.000000000 +0200 +++ new/oslotest-1.5.1/doc/source/contributing.rst 2015-03-09 15:35:54.000000000 +0100 @@ -1,5 +1,5 @@ -============== - Contributing -============== +============ +Contributing +============ .. include:: ../../CONTRIBUTING.rst diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslotest-1.1.0/doc/source/features.rst new/oslotest-1.5.1/doc/source/features.rst --- old/oslotest-1.1.0/doc/source/features.rst 2014-09-18 14:15:05.000000000 +0200 +++ new/oslotest-1.5.1/doc/source/features.rst 2015-03-09 15:35:54.000000000 +0100 @@ -2,8 +2,8 @@ Features ========== -Debugging with oslo_debug_helper.sh -=================================== +Debugging with oslo_debug_helper +================================ The oslotest package also distributes a shell file that may be used to assist in debugging python code. The shell file uses testtools, and supports debugging @@ -25,9 +25,28 @@ Within the ``tox.ini`` file of your project add the following:: [testenv:debug] - commands = oslo_debug_helper.sh {posargs} + commands = oslo_debug_helper {posargs} -To run with tox: +If the project name, and the module that precedes the tests directory do not +match, then consider passing a `-t` argument to `oslo_debug_helper` to +indicate the directory where tests are located. + +For example, the ``python-keystoneclient`` project has tests in +``keystoneclient/tests``, thus it would have to pass in:: + + [testenv:debug] + commands = oslo_debug_helper -t keystoneclient/tests {posargs} + +Similarily, most ``oslo`` projects have the tests at the package level, it +would have to pass in:: + + [testenv:debug] + commands = oslo_debug_helper -t tests {posargs} + +Debugging with tox +------------------ + +To enable debugging, run tox with the ``debug`` environment: .. code-block:: bash @@ -35,3 +54,11 @@ $ tox -e debug test_notifications $ tox -e debug test_notifications.NotificationsTestCase $ tox -e debug test_notifications.NotificationsTestCase.test_send_notification + +Which results in an interactive prompt: + +.. code-block:: bash + + > /opt/stack/ceilometer/ceilometer/tests/identity/test_notifications.py(106)notification_for_role_change() + -> action_name = '%s.%s' % (action, ROLE_ASSIGNMENT) + (Pdb) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslotest-1.1.0/doc/source/history.rst new/oslotest-1.5.1/doc/source/history.rst --- old/oslotest-1.1.0/doc/source/history.rst 1970-01-01 01:00:00.000000000 +0100 +++ new/oslotest-1.5.1/doc/source/history.rst 2015-03-09 15:35:54.000000000 +0100 @@ -0,0 +1 @@ +.. include:: ../../ChangeLog diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslotest-1.1.0/doc/source/index.rst new/oslotest-1.5.1/doc/source/index.rst --- old/oslotest-1.1.0/doc/source/index.rst 2014-09-18 14:15:05.000000000 +0200 +++ new/oslotest-1.5.1/doc/source/index.rst 2015-03-09 15:35:54.000000000 +0100 @@ -13,7 +13,9 @@ api testing features + resources contributing + history Indices and tables ================== diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslotest-1.1.0/doc/source/resources.rst new/oslotest-1.5.1/doc/source/resources.rst --- old/oslotest-1.1.0/doc/source/resources.rst 1970-01-01 01:00:00.000000000 +0100 +++ new/oslotest-1.5.1/doc/source/resources.rst 2015-03-09 15:35:54.000000000 +0100 @@ -0,0 +1,10 @@ +======================== + Other Useful Resources +======================== + +* Mock_ library documentation +* OpenStack Bootstrapping Hour: Mock Best Practices: `video + <https://www.youtube.com/watch?v=jCWtLoSEfmw>`__ and `etherpad + <https://etherpad.openstack.org/p/obh-mock-best-practices>`__ + +.. _Mock: http://www.voidspace.org.uk/python/mock/ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslotest-1.1.0/doc/source/testing.rst new/oslotest-1.5.1/doc/source/testing.rst --- old/oslotest-1.1.0/doc/source/testing.rst 2014-09-18 14:15:05.000000000 +0200 +++ new/oslotest-1.5.1/doc/source/testing.rst 2015-03-09 15:35:54.000000000 +0100 @@ -26,5 +26,5 @@ :: $ cd oslo.test - $ ./tools/run_cross_tests.sh ~/repos/openstack/oslo.config py27 + $ ./tools/oslo_run_cross_tests ~/repos/openstack/oslo.config py27 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslotest-1.1.0/oslotest/base.py new/oslotest-1.5.1/oslotest/base.py --- old/oslotest-1.1.0/oslotest/base.py 2014-09-18 14:15:05.000000000 +0200 +++ new/oslotest-1.5.1/oslotest/base.py 2015-03-09 15:35:54.000000000 +0100 @@ -20,6 +20,7 @@ import tempfile import fixtures +import six from six.moves import mock import testtools @@ -72,6 +73,13 @@ def __init__(self, *args, **kwds): super(BaseTestCase, self).__init__(*args, **kwds) + + # This is the number of characters shown when two objects do not + # match for assertDictEqual, assertMultiLineEqual, and + # assertSequenceEqual. The default is 640 which is too + # low for comparing most dicts + self.maxDiff = 10000 + # Ensure that the mock.patch.stopall cleanup is registered # before any setUp() methods have a chance to register other # things to be cleaned up, so it is called last. This allows @@ -121,17 +129,29 @@ else: logging.basicConfig(format=_LOG_FORMAT, level=level) - def create_tempfiles(self, files, ext='.conf'): + def create_tempfiles(self, files, ext='.conf', default_encoding='utf-8'): """Safely create temporary files. :param files: Sequence of tuples containing (filename, file_contents). :type files: list of tuple :param ext: File name extension for the temporary file. :type ext: str + :param default_encoding: Default file content encoding when it is + not provided, used to decode the tempfile + contents from a text string into a binary + string. + :type default_encoding: str :return: A list of str with the names of the files created. """ tempfiles = [] - for (basename, contents) in files: + for f in files: + if len(f) == 3: + basename, contents, encoding = f + else: + basename, contents = f + encoding = default_encoding + if isinstance(contents, six.text_type): + contents = contents.encode(encoding) if not os.path.isabs(basename): (fd, path) = tempfile.mkstemp(prefix=basename, suffix=ext) else: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslotest-1.1.0/oslotest/tools/config.py new/oslotest-1.5.1/oslotest/tools/config.py --- old/oslotest-1.1.0/oslotest/tools/config.py 1970-01-01 01:00:00.000000000 +0100 +++ new/oslotest-1.5.1/oslotest/tools/config.py 2015-03-09 15:35:54.000000000 +0100 @@ -0,0 +1,48 @@ +# +# 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. +"""Utilities functions for working with oslo.config from the tool scripts. +""" + +import os + +from oslo_config import cfg + +DEFAULT_CONFIG_FILES = [ + './oslo.conf', + os.path.expanduser('~/.oslo.conf'), +] + + +def get_config_parser(): + conf = cfg.ConfigOpts() + conf.register_cli_opt( + cfg.StrOpt( + 'repo_root', + default='.', + help='directory containing the git repositories', + ) + ) + return conf + + +def parse_arguments(conf): + # Look for a few configuration files, and load the ones we find. + default_config_files = [ + f + for f in DEFAULT_CONFIG_FILES + if os.path.exists(f) + ] + return conf( + project='oslo', + default_config_files=default_config_files, + ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslotest-1.1.0/oslotest.egg-info/PKG-INFO new/oslotest-1.5.1/oslotest.egg-info/PKG-INFO --- old/oslotest-1.1.0/oslotest.egg-info/PKG-INFO 2014-09-18 14:15:35.000000000 +0200 +++ new/oslotest-1.5.1/oslotest.egg-info/PKG-INFO 2015-03-09 15:36:13.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: oslotest -Version: 1.1.0 +Version: 1.5.1 Summary: OpenStack test framework Home-page: http://launchpad.net/oslo Author: OpenStack @@ -15,7 +15,7 @@ * Free software: Apache license * Documentation: http://docs.openstack.org/developer/oslotest * Source: http://git.openstack.org/cgit/openstack/oslotest - * Bugs: http://bugs.launchpad.net/oslo + * Bugs: http://bugs.launchpad.net/oslotest Platform: UNKNOWN diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslotest-1.1.0/oslotest.egg-info/SOURCES.txt new/oslotest-1.5.1/oslotest.egg-info/SOURCES.txt --- old/oslotest-1.1.0/oslotest.egg-info/SOURCES.txt 2014-09-18 14:15:36.000000000 +0200 +++ new/oslotest-1.5.1/oslotest.egg-info/SOURCES.txt 2015-03-09 15:36:14.000000000 +0100 @@ -18,8 +18,10 @@ doc/source/conf.py doc/source/contributing.rst doc/source/features.rst +doc/source/history.rst doc/source/index.rst doc/source/installation.rst +doc/source/resources.rst doc/source/testing.rst oslotest/__init__.py oslotest/base.py @@ -29,12 +31,16 @@ oslotest.egg-info/SOURCES.txt oslotest.egg-info/dependency_links.txt oslotest.egg-info/not-zip-safe +oslotest.egg-info/pbr.json oslotest.egg-info/requires.txt oslotest.egg-info/top_level.txt +oslotest/tools/__init__.py +oslotest/tools/config.py tests/__init__.py tests/unit/__init__.py tests/unit/test_base.py tests/unit/test_mockpatch.py tests/unit/test_moxstubout.py -tools/oslo_debug_helper.sh -tools/run_cross_tests.sh \ No newline at end of file +tools/oslo_debug_helper +tools/oslo_run_cross_tests +tools/oslo_run_pre_release_tests \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslotest-1.1.0/oslotest.egg-info/pbr.json new/oslotest-1.5.1/oslotest.egg-info/pbr.json --- old/oslotest-1.1.0/oslotest.egg-info/pbr.json 1970-01-01 01:00:00.000000000 +0100 +++ new/oslotest-1.5.1/oslotest.egg-info/pbr.json 2015-03-09 15:36:13.000000000 +0100 @@ -0,0 +1 @@ +{"is_release": true, "git_version": "5020f1a"} \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslotest-1.1.0/oslotest.egg-info/requires.txt new/oslotest-1.5.1/oslotest.egg-info/requires.txt --- old/oslotest-1.1.0/oslotest.egg-info/requires.txt 2014-09-18 14:15:35.000000000 +0200 +++ new/oslotest-1.5.1/oslotest.egg-info/requires.txt 2015-03-09 15:36:13.000000000 +0100 @@ -1,9 +1,10 @@ +pbr>=0.6,!=0.7,<1.0 discover fixtures>=0.3.14 python-subunit>=0.0.18 -six>=1.7.0 +six>=1.9.0 testrepository>=0.0.18 testscenarios>=0.4 -testtools>=0.9.34 +testtools>=0.9.36,!=1.2.0 mock>=1.0 -mox3>=0.7.0 \ No newline at end of file +mox3>=0.7.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslotest-1.1.0/requirements.txt new/oslotest-1.5.1/requirements.txt --- old/oslotest-1.1.0/requirements.txt 2014-09-18 14:15:06.000000000 +0200 +++ new/oslotest-1.5.1/requirements.txt 2015-03-09 15:35:54.000000000 +0100 @@ -1,9 +1,14 @@ +# The order of packages is significant, because pip processes them in the order +# of appearance. Changing the order has an impact on the overall integration +# process, which may cause wedges in the gate later. + +pbr>=0.6,!=0.7,<1.0 discover fixtures>=0.3.14 python-subunit>=0.0.18 -six>=1.7.0 +six>=1.9.0 testrepository>=0.0.18 testscenarios>=0.4 -testtools>=0.9.34 +testtools>=0.9.36,!=1.2.0 mock>=1.0 mox3>=0.7.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslotest-1.1.0/setup.cfg new/oslotest-1.5.1/setup.cfg --- old/oslotest-1.1.0/setup.cfg 2014-09-18 14:15:36.000000000 +0200 +++ new/oslotest-1.5.1/setup.cfg 2015-03-09 15:36:14.000000000 +0100 @@ -23,7 +23,9 @@ packages = oslotest scripts = - tools/oslo_debug_helper.sh + tools/oslo_debug_helper + tools/oslo_run_cross_tests + tools/oslo_run_pre_release_tests [global] setup-hooks = @@ -45,6 +47,6 @@ [egg_info] tag_date = 0 -tag_build = tag_svn_revision = 0 +tag_build = diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslotest-1.1.0/test-requirements.txt new/oslotest-1.5.1/test-requirements.txt --- old/oslotest-1.1.0/test-requirements.txt 2014-09-18 14:15:06.000000000 +0200 +++ new/oslotest-1.5.1/test-requirements.txt 2015-03-09 15:35:54.000000000 +0100 @@ -1,3 +1,7 @@ +# The order of packages is significant, because pip processes them in the order +# of appearance. Changing the order has an impact on the overall integration +# process, which may cause wedges in the gate later. + hacking>=0.9.2,<0.10 # when we can require tox>= 1.4, this can go into tox.ini: @@ -6,5 +10,5 @@ coverage>=3.6 # this is required for the docs build jobs -sphinx>=1.1.2,!=1.2.0,<1.3 -oslosphinx>=2.2.0.0a2 +sphinx>=1.1.2,!=1.2.0,!=1.3b1,<1.3 +oslosphinx>=2.2.0 # Apache-2.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslotest-1.1.0/tests/unit/test_base.py new/oslotest-1.5.1/tests/unit/test_base.py --- old/oslotest-1.1.0/tests/unit/test_base.py 2014-09-18 14:15:05.000000000 +0200 +++ new/oslotest-1.5.1/tests/unit/test_base.py 2015-03-09 15:35:54.000000000 +0100 @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2014 Deutsche Telekom AG # # Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -13,8 +15,10 @@ # under the License. import logging +import os import unittest +import six from six.moves import mock import testtools @@ -121,3 +125,52 @@ patcher = mock.patch('os.environ.get') patcher.start() self.addCleanup(patcher.stop) + + +class TestTempFiles(base.BaseTestCase): + def test_create_unicode_files(self): + files = [["no_approve", u'ಠ_ಠ']] + temps = self.create_tempfiles(files) + self.assertEqual(1, len(temps)) + with open(temps[0], 'rb') as f: + contents = f.read() + self.assertEqual(u'ಠ_ಠ', six.text_type(contents, encoding='utf-8')) + + def test_create_unicode_files_encoding(self): + files = [["embarrassed", u'⊙﹏⊙', 'utf-8']] + temps = self.create_tempfiles(files) + self.assertEqual(1, len(temps)) + with open(temps[0], 'rb') as f: + contents = f.read() + self.assertEqual(u'⊙﹏⊙', six.text_type(contents, encoding='utf-8')) + + def test_create_unicode_files_multi_encoding(self): + files = [ + ["embarrassed", u'⊙﹏⊙', 'utf-8'], + ['abc', 'abc', 'ascii'], + ] + temps = self.create_tempfiles(files) + self.assertEqual(2, len(temps)) + for i, (basename, raw_contents, raw_encoding) in enumerate(files): + with open(temps[i], 'rb') as f: + contents = f.read() + if not isinstance(raw_contents, six.text_type): + raw_contents = six.text_type(raw_contents, + encoding=raw_encoding) + self.assertEqual(raw_contents, + six.text_type(contents, encoding=raw_encoding)) + + def test_create_bad_encoding(self): + files = [["hrm", u'ಠ~ಠ', 'ascii']] + self.assertRaises(UnicodeError, self.create_tempfiles, files) + + def test_prefix(self): + files = [["testing", '']] + temps = self.create_tempfiles(files) + self.assertEqual(1, len(temps)) + basename = os.path.basename(temps[0]) + self.assertTrue(basename.startswith('testing')) + + def test_wrong_length(self): + files = [["testing"]] + self.assertRaises(ValueError, self.create_tempfiles, files) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslotest-1.1.0/tools/oslo_debug_helper new/oslotest-1.5.1/tools/oslo_debug_helper --- old/oslotest-1.1.0/tools/oslo_debug_helper 1970-01-01 01:00:00.000000000 +0100 +++ new/oslotest-1.5.1/tools/oslo_debug_helper 2015-03-09 15:35:54.000000000 +0100 @@ -0,0 +1,40 @@ +#!/bin/bash + +# oslo_debug_helper - Script that allows for debugging tests +# +# oslo_debug_helper [-t <test_directory>] [<tests_to_run>] +# +# <tests_to_run> - may be a test suite, class, or function, if no value is +# passed, then all tests are run. +# -t <test_directory> - the name of the directory that houses the tests +# relative to the project directory. If no value is passed, it is assumed +# to be packagename/tests. + +TMP_DIR=`mktemp -d debug-$$-XXX` || exit 1 +trap "rm -rf $TMP_DIR" EXIT + +ALL_TESTS=$TMP_DIR/all_tests +TESTS_TO_RUN=$TMP_DIR/tests_to_run + +# Default to packagename/tests, i.e., keystone/tests +PACKAGENAME=$(python setup.py --name) +TEST_DIR=./$PACKAGENAME/tests + +# If a specific path is passed, use that one +while getopts ":t:" opt; do + case $opt in + t) TEST_DIR=$OPTARG;; + esac +done + +python -m testtools.run discover -t ./ $TEST_DIR --list > $ALL_TESTS + +# getopts friendly way of determining if a positional arg has been passed +ARG1=${@:$OPTIND:1} +if [ "$ARG1" ]; then + grep "$ARG1" < $ALL_TESTS > $TESTS_TO_RUN +else + mv $ALL_TESTS $TESTS_TO_RUN +fi + +python -m testtools.run discover --load-list $TESTS_TO_RUN diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslotest-1.1.0/tools/oslo_debug_helper.sh new/oslotest-1.5.1/tools/oslo_debug_helper.sh --- old/oslotest-1.1.0/tools/oslo_debug_helper.sh 2014-09-18 14:15:05.000000000 +0200 +++ new/oslotest-1.5.1/tools/oslo_debug_helper.sh 1970-01-01 01:00:00.000000000 +0100 @@ -1,20 +0,0 @@ -#!/bin/bash - -TMP_DIR=`mktemp -d` || exit 1 -trap "rm -rf $TMP_DIR" EXIT - -ALL_TESTS=$TMP_DIR/all_tests -TESTS_TO_RUN=$TMP_DIR/tests_to_run - -PACKAGENAME=$(python setup.py --name) - -python -m testtools.run discover -t ./ ./$PACKAGENAME/tests --list > $ALL_TESTS - -if [ "$1" ]; then - grep "$1" < $ALL_TESTS > $TESTS_TO_RUN -else - mv $ALL_TESTS $TESTS_TO_RUN -fi - -python -m testtools.run discover --load-list $TESTS_TO_RUN - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslotest-1.1.0/tools/oslo_run_cross_tests new/oslotest-1.5.1/tools/oslo_run_cross_tests --- old/oslotest-1.1.0/tools/oslo_run_cross_tests 1970-01-01 01:00:00.000000000 +0100 +++ new/oslotest-1.5.1/tools/oslo_run_cross_tests 2015-03-09 15:35:54.000000000 +0100 @@ -0,0 +1,101 @@ +#!/bin/bash +# +# Run cross-project tests +# +# Usage: +# +# oslo_run_cross_tests project_dir venv + +# Fail the build if any command fails +set -e + +project_dir="$1" +shift +venv="$1" +shift +posargs="$*" + +if [ -z "$project_dir" -o -z "$venv" ] +then + cat - <<EOF +ERROR: Missing argument(s) + +Usage: + + $0 PROJECT_DIR VIRTUAL_ENV [POSARGS] + +Example, run the python 2.7 tests for python-neutronclient: + + $0 /opt/stack/python-neutronclient py27 + $0 /opt/stack/nova py27 xenapi + +EOF + exit 1 +fi + +# Set up the virtualenv without running the tests +(cd $project_dir && tox --notest -e $venv) + +tox_envbin=$project_dir/.tox/$venv/bin + +our_name=$(python setup.py --name) + +# Build the egg-info, including the source file list, +# so we install all of the files, even if the package +# list or name has changed. +rm -rf $(python setup.py --name).egg-info +python setup.py egg_info + +# Replace the pip-installed package with the version in our source +# tree. Look to see if we are already installed before trying to +# uninstall ourselves, to avoid failures from packages that do not use us +# yet. +if $tox_envbin/pip freeze | grep -q $our_name +then + $tox_envbin/pip uninstall -y $our_name || echo "Ignoring error" +fi +$tox_envbin/pip install -U . + +# Run the tests +(cd $project_dir && tox -e $venv -- $posargs) +result=$? + + +# The below checks are modified from +# openstack-infra/config/modules/jenkins/files/slave_scripts/run-unittests.sh. + +# They expect to be run in the project being tested. +cd $project_dir + +echo "Begin pip freeze output from test virtualenv:" +echo "======================================================================" +.tox/$venv/bin/pip freeze +echo "======================================================================" + +# We only want to run the next check if the tool is installed, so look +# for it before continuing. +if [ -f /usr/local/jenkins/slave_scripts/subunit2html.py -a -d ".testrepository" ] ; then + if [ -f ".testrepository/0.2" ] ; then + cp .testrepository/0.2 ./subunit_log.txt + elif [ -f ".testrepository/0" ] ; then + .tox/$venv/bin/subunit-1to2 < .testrepository/0 > ./subunit_log.txt + fi + .tox/$venv/bin/python /usr/local/jenkins/slave_scripts/subunit2html.py ./subunit_log.txt testr_results.html + gzip -9 ./subunit_log.txt + gzip -9 ./testr_results.html + + export PYTHON=.tox/$venv/bin/python + set -e + rancount=$(.tox/$venv/bin/testr last | sed -ne 's/Ran \([0-9]\+\).*tests in.*/\1/p') + if [ "$rancount" -eq "0" ] ; then + echo + echo "Zero tests were run. At least one test should have been run." + echo "Failing this test as a result" + echo + exit 1 + fi +fi + +# If we make it this far, report status based on the tests that were +# run. +exit $result diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslotest-1.1.0/tools/oslo_run_pre_release_tests new/oslotest-1.5.1/tools/oslo_run_pre_release_tests --- old/oslotest-1.1.0/tools/oslo_run_pre_release_tests 1970-01-01 01:00:00.000000000 +0100 +++ new/oslotest-1.5.1/tools/oslo_run_pre_release_tests 2015-03-09 15:35:54.000000000 +0100 @@ -0,0 +1,211 @@ +#!/usr/bin/env python +# +# 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. +"""Run unit tests for projects that use a library. +""" + +from __future__ import print_function + +import glob +import os +import subprocess +import sys + +from oslo_config import cfg +from oslotest.tools import config as tconfig +from pbr import packaging +import pkg_resources + + +def find_all_projects(repo_root): + """Scan the checked out repositories for all available projects. + """ + pattern = os.path.join(repo_root, 'openstack/*') + candidates = glob.glob(pattern) + prefix_len = len(repo_root) + return [ + c[prefix_len:].lstrip('/') + for c in candidates + if os.path.isdir(c) + ] + + +def find_consuming_projects(lib_name, repo_root, projects): + """Filter the list of projects to only include entries that use the library. + """ + for p in projects: + consumer = False + for base in packaging.get_requirements_files(): + req_file = os.path.join(repo_root, p, base) + for req in packaging.parse_requirements([req_file]): + try: + parsed_req = pkg_resources.Requirement.parse(req) + req_name = parsed_req.project_name + except ValueError: + continue + if req_name == lib_name: + consumer = True + yield p + break + if consumer: + break + + +def main(): + conf = tconfig.get_config_parser() + conf.register_cli_opt( + cfg.StrOpt( + 'library-under-test', + short='l', + default='', + help=('the name of the library being tested; ' + 'defaults to current dir'), + ) + ) + conf.register_cli_opt( + cfg.BoolOpt( + 'update', + short='u', + default=False, + help='update consumers before running tests', + ) + ) + conf.register_cli_opt( + cfg.BoolOpt( + 'verbose', + short='v', + default=False, + help='print verbose output', + ) + ) + conf.register_cli_opt( + cfg.StrOpt( + 'ref', + short='r', + default='HEAD', + help='the commit reference to test; defaults to HEAD', + ) + ) + conf.register_cli_opt( + cfg.MultiStrOpt( + 'env', + short='e', + default=['py27', 'pep8'], + help=('the name of the tox environment to test; ' + 'defaults to py27 and pep8'), + ) + ) + conf.register_cli_opt( + cfg.MultiStrOpt( + 'consumer', + positional=True, + default=[], + help='the name of a project to test with; may be repeated', + ) + ) + tconfig.parse_arguments(conf) + + repo_root = os.path.expanduser(conf.repo_root) + + # Figure out which library is being tested + lib_name = conf.library_under_test + if not lib_name: + if conf.verbose: + print('finding library name') + lib_name = subprocess.check_output( + ['python', 'setup.py', '--name'] + ).strip() + lib_dir = os.getcwd() + else: + lib_dir = os.path.join(repo_root, 'openstack', lib_name) + print('testing %s in %s' % (lib_name, lib_dir)) + + projects = set(conf.consumer) + if not projects: + # TODO(dhellmann): Need to update this to look at gerrit, so + # we can check out the projects we want to test with. + if conf.verbose: + print('defaulting to all projects under %s/openstack' % repo_root) + projects = find_all_projects(repo_root) + + # Filter out projects that do not require the library under test + before = len(projects) + projects = list(find_consuming_projects(lib_name, repo_root, projects)) + after = len(projects) + if (after < before) and conf.verbose: + print('ignoring %s projects that do not use %s' + % (before - after, lib_name)) + + projects = list(sorted(projects)) + if not projects: + print('ERROR: found no projects using %s' % lib_name) + return 1 + if conf.verbose: + print('preparing to test %s projects' % after) + + # Make sure the lib being tested is set to the reference intended. + if conf.ref != 'HEAD': + if conf.verbose: + print('ensuring %s is updated to %s' % (lib_name, conf.ref)) + subprocess.check_call( + ['git', 'checkout', conf.ref], + cwd=lib_dir, + ) + + git_quiet = ['-q'] if not conf.verbose else [] + + failures = [] + for p in projects: + if conf.verbose: + print() + proj_dir = os.path.join(repo_root, p) + if conf.update: + if conf.verbose: + print('updating %s with "git pull"' % p) + subprocess.Popen( + ['git', 'pull'] + git_quiet, + cwd=proj_dir, + ).communicate() + p_log_name = p.split('/')[-1].replace('.', '-') + for e in conf.env: + log_name = 'cross-test-%s-%s.log' % (p_log_name, e) + with open(log_name, 'w') as log_file: + print('testing %s in %s, logging to %s' % (e, p, log_name), + end=' ') + sys.stdout.flush() + command = ['oslo_run_cross_tests', proj_dir, e] + log_file.write('running: %s\n' % ' '.join(command)) + log_file.flush() # since Popen is going to use the fd directly + cmd = subprocess.Popen( + command, + cwd=lib_dir, + stdout=log_file, + stderr=log_file + ) + cmd.communicate() + log_file.write('\nexit code: %s\n' % cmd.returncode) + if cmd.returncode: + print('FAIL') + failures.append((p, e, cmd.returncode)) + else: + print('PASS') + + if failures: + print('\nFAILED %d jobs' % len(failures)) + return 1 + print('\nPASSED all jobs') + return 0 + + +if __name__ == '__main__': + sys.exit(main()) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslotest-1.1.0/tools/run_cross_tests.sh new/oslotest-1.5.1/tools/run_cross_tests.sh --- old/oslotest-1.1.0/tools/run_cross_tests.sh 2014-09-18 14:15:05.000000000 +0200 +++ new/oslotest-1.5.1/tools/run_cross_tests.sh 1970-01-01 01:00:00.000000000 +0100 @@ -1,70 +0,0 @@ -#!/bin/bash -# -# Run cross-project tests - -# Fail the build if any command fails -set -e - -project_dir="$1" -venv="$2" - -# Set up the virtualenv without running the tests -(cd $project_dir && tox --notest -e $venv) - -tox_envbin=$project_dir/.tox/$venv/bin - -our_name=$(python setup.py --name) - -# Replace the pip-installed package with the version in our source -# tree. Look to see if we are already installed before trying to -# uninstall ourselves, to avoid failures from packages that do not use us -# yet. -if $tox_envbin/pip freeze | grep -q $our_name -then - $tox_envbin/pip uninstall -y $our_name -fi -$tox_envbin/pip install -U . - -# Run the tests -(cd $project_dir && tox -e $venv) -result=$? - - -# The below checks are modified from -# openstack-infra/config/modules/jenkins/files/slave_scripts/run-unittests.sh. - -# They expect to be run in the project being tested. -cd $project_dir - -echo "Begin pip freeze output from test virtualenv:" -echo "======================================================================" -.tox/$venv/bin/pip freeze -echo "======================================================================" - -# We only want to run the next check if the tool is installed, so look -# for it before continuing. -if [ -f /usr/local/jenkins/slave_scripts/subunit2html.py -a -d ".testrepository" ] ; then - if [ -f ".testrepository/0.2" ] ; then - cp .testrepository/0.2 ./subunit_log.txt - elif [ -f ".testrepository/0" ] ; then - .tox/$venv/bin/subunit-1to2 < .testrepository/0 > ./subunit_log.txt - fi - .tox/$venv/bin/python /usr/local/jenkins/slave_scripts/subunit2html.py ./subunit_log.txt testr_results.html - gzip -9 ./subunit_log.txt - gzip -9 ./testr_results.html - - export PYTHON=.tox/$venv/bin/python - set -e - rancount=$(.tox/$venv/bin/testr last | sed -ne 's/Ran \([0-9]\+\).*tests in.*/\1/p') - if [ "$rancount" -eq "0" ] ; then - echo - echo "Zero tests were run. At least one test should have been run." - echo "Failing this test as a result" - echo - exit 1 - fi -fi - -# If we make it this far, report status based on the tests that were -# run. -exit $result diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslotest-1.1.0/tox.ini new/oslotest-1.5.1/tox.ini --- old/oslotest-1.1.0/tox.ini 2014-09-18 14:15:05.000000000 +0200 +++ new/oslotest-1.5.1/tox.ini 2015-03-09 15:35:54.000000000 +0100 @@ -1,8 +1,9 @@ [tox] distribute = False -envlist = py33,py26,py27,pep8 +envlist = py33,py34,py26,py27,pep8 [testenv] +install_command = pip install -U {opts} {packages} setenv = VIRTUAL_ENV={envdir} deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt @@ -25,7 +26,6 @@ [flake8] show-source = True exclude = .tox,dist,doc,*.egg,build -builtins = _ [hacking] import_exceptions =
