The patch encodes a data string which contains
non-ASCII characters to unicode type.
In python2 there are two text types str and unicode.
When we add two different text types, for example:
>>> "Hello " + u"World"
The string on the left is decoded by using the default
system encoding into a Unicode string.
If it would contain non-ASCII characters(as in our case)
this normally blow up with an UnicodeDecodeError because
the default encoding is set to ASCII.
This commit adds deprecation comments to README, the user doc and
warning message to in the command. We already switched to use
`stestr` command instead of `ostestr`. And we haven't maintained
this command recently. So, it would be good to make it clearer for
The traceback would look like
Traceback (most recent call last):
File ".../bin/ostestr", line 10, in <module>
File ".../os_testr/ostestr.py", line 263, in main
File ".../os_testr/ostestr.py", line 259, in ostestr
return _select_and_call_runner(opts, regex, others)
File ".../os_testr/ostestr.py", line 212, in _select_and_call_runner
File ".../os_testr/ostestr.py", line 167, in call_testr
File ".../stestr/commands/run.py", line 334, in run_command
concurrency = _to_int(concurrency)
File ".../stestr/commands/run.py", line 39, in _to_int
i = int(possible)
TypeError: int() argument must be a string or a number, not 'NoneType'
New enough stestr will tolerate it, but still write a warning to stderr.
This is a mechanically generated patch to complete step 1 of moving
the zuul job settings out of project-config and into each project
Because there will be a separate patch on each branch, the branch
specifiers for branch-specific jobs have been removed.
Because this patch is generated by a script, there may be some
cosmetic changes to the layout of the YAML file(s) as the contents are
See the python3-first goal document for details:
We want to default to running all tox environments under python 3, so
set the basepython value in each environment.
We do not want to specify a minor version number, because we do not
want to have to update the file every time we upgrade python.
We do not want to set the override once in testenv, because that
breaks the more specific versions used in default environments like
py35 and py36.
This commit fixes a small oversight in the ostestr --pdb/--no-discover
path. When we go to load the results from the run the command used to
load the results was still using testrepository, which is not used
anywhere else in ostestr at this point.(and is not in requirements.txt
anymore) This commit fixes this and switches it to use stestr instead.
That also exposed another bug in that code path where it was assuming
a repository was created before ostestr was run which is fixed as part
of this commit.
We do not need tox_install.sh, pip can handle constraints itself
and install the project correctly. Thus update tox.ini and remove
the now obsolete tools/tox_install.sh file.
This follows https://review.openstack.org/#/c/508061 to remove
Currently when the blacklist_file and regex string is provided,
the constructed regex looks like '^((?!black1|black2|...).)*$regex'.
This is incorrect, as it will match nothing - some string
is expected after end of the line [denoted as $ in the regex].
The proper construction is like ^(?!black1|black2|...).*(regex).*$
This solves the issue with Tempest, where using blacklist for smoke
tests is not working now, as it leads into the issue described above.
Apparently if -t is not specified, the path to the unit test directory
follows immediately the "discover" keyword.
This fixes the discovery for the .testr.conf in the sahara repository
(even if is being replaced by .stestr.conf, the fix may still be
Also, split the code which discover the legacy values in its own function
to simplify the testing.
Finally, disable hacking rule H405 which kept flagging incorrectly a long
multiline string as docstring.
This commit switches the ostestr command to use stestr under the covers.
This simplifies the majority of the logic, eventually ostestr will
be deprecated as a result of this migration. (since almost all the logic
here is contained in stestr already)
Previous code worked fine in python 2.7 but generated
"ResourceWarning: Unclosed file" in python 3.4+
Does not change the funtionality of the code at all.
Also updated the unit tests to work with the new code.