[PKG-Openstack-devel] Bug#898656: python-stestr updates from ubuntu

Corey Bryant corey.bryant at canonical.com
Mon May 14 18:54:39 BST 2018


Package: python-stestr
Version: 1.1.0-1
Severity: normal
Tags: patch
User: ubuntu-devel at lists.ubuntu.com
Usertags: origin-ubuntu cosmic ubuntu-patch

Dear Maintainer,

In Ubuntu, the attached patch was applied to achieve the following:

  - d/rules: Continue to run tests as we did in the past.
  - d/p/argparse-empty-array.patch: Deal with [] instead of 'None'
    when list is called with no additional parameters.


Thanks for considering the patch.


-- System Information:
Debian Release: buster/sid
  APT prefers cosmic
  APT policy: (500, 'cosmic'), (500, 'bionic-security')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.15.0-20-generic (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
-------------- next part --------------
diff -Nru python-stestr-1.1.0/debian/patches/argparse-empty-array.patch python-stestr-1.1.0/debian/patches/argparse-empty-array.patch
--- python-stestr-1.1.0/debian/patches/argparse-empty-array.patch	1969-12-31 19:00:00.000000000 -0500
+++ python-stestr-1.1.0/debian/patches/argparse-empty-array.patch	2018-05-14 13:52:24.000000000 -0400
@@ -0,0 +1,18 @@
+Description: Deal with [] instead of 'None'
+ argparse returns an empty array for any unknown arguments; detect
+ this situation and default filters to None in this instance as
+ already performed in the 'run' cli module.
+Author: James Page <james.page at ubuntu.com>
+Forwarded: https://github.com/mtreinish/stestr/pull/129
+
+--- a/stestr/commands/list.py
++++ b/stestr/commands/list.py
+@@ -48,7 +48,7 @@ def set_cli_opts(parser):
+ 
+ def run(arguments):
+     args = arguments[0]
+-    filters = arguments[1]
++    filters = arguments[1] or None
+     return list_command(config=args.config, repo_type=args.repo_type,
+                         repo_url=args.repo_url, group_regex=args.group_regex,
+                         test_path=args.test_path, top_dir=args.top_dir,
diff -Nru python-stestr-1.1.0/debian/patches/series python-stestr-1.1.0/debian/patches/series
--- python-stestr-1.1.0/debian/patches/series	2018-03-03 13:24:52.000000000 -0500
+++ python-stestr-1.1.0/debian/patches/series	2018-05-14 13:52:24.000000000 -0400
@@ -1 +1,2 @@
 remove-privacy-breach-in-README.rst.patch
+argparse-empty-array.patch
diff -Nru python-stestr-1.1.0/debian/rules python-stestr-1.1.0/debian/rules
--- python-stestr-1.1.0/debian/rules	2018-03-03 13:24:52.000000000 -0500
+++ python-stestr-1.1.0/debian/rules	2018-05-14 13:52:24.000000000 -0400
@@ -7,27 +7,25 @@
 	dh $@ --buildsystem=python_distutils --with python2,python3,sphinxdoc
 
 export PATH:=$(PATH):$(CURDIR)/debian/bin
+export HOME:=/tmp
 
 override_dh_auto_install:
 	pkgos-dh_auto_install
 
-ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
-	cp debian/bin/pythonX-stestr debian/bin/stestr ;
-	sed -i s/z/2.7/ debian/bin/stestr ;
-	PYTHONPATH=$(CURDIR)/debian/python-stestr/usr/lib/python2.7/dist-packages PYTHON=python2.7 stestr init ;
-	HOME=$(CURDIR) PYTHONPATH=$(CURDIR)/debian/python-stestr/usr/lib/python2.7/dist-packages PYTHON=python2.7 stestr run --subunit 'stestr\.tests\.(?!(.*repository\.test_file\.TestFileRepository\.test_get_test_run_unexpected_ioerror_errno.*))' | subunit2pyunit ;
-	set -x ; set -e ; for i in $(PYTHON3S); do \
-		cp debian/bin/pythonX-stestr debian/bin/stestr ; \
-		sed -i s/z/$$i/ debian/bin/stestr ; \
-		PYTHONPATH=$(CURDIR)/debian/python3-stestr/usr/lib/python3/dist-packages PYTHON=python$$i stestr init ; \
-		HOME=$(CURDIR) PYTHONPATH=$(CURDIR)/debian/python3-stestr/usr/lib/python3/dist-packages PYTHON=python$$i stestr run --subunit 'stestr\.tests\.(?!(.*repository\.test_file\.TestFileRepository\.test_get_test_run_unexpected_ioerror_errno.*))' | subunit2pyunit ; \
-	done
-endif
-
 override_dh_python3:
 	dh_python3 --shebang=/usr/bin/python3
 
 override_dh_auto_test:
+ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
+	set -x ; set -e ; for pyvers in $(PYTHONS) $(PYTHON3S); do \
+		PYMAJOR=`echo $$pyvers | cut -d'.' -f1` ; \
+		echo "===> Testing with python$$pyvers (python$$PYMAJOR)" ; \
+		cp debian/bin/pythonX-stestr debian/bin/stestr ; \
+		sed -i s/z/$$pyvers/ debian/bin/stestr ; \
+		PYTHONPATH=$(CURDIR) PYTHON=python$$pyvers python$$pyvers -m stestr.cli init ; \
+		PYTHONPATH=$(CURDIR) PYTHON=python$$pyvers python$$pyvers -m stestr.cli run --subunit | subunit2pyunit ; \
+	done
+endif
 
 override_dh_sphinxdoc:
 ifeq (,$(findstring nodocs, $(DEB_BUILD_OPTIONS)))


More information about the Openstack-devel mailing list