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"
u'Hello 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.
Change-Id: I17e5aa6f45133d9d12aa38cec9cc42694913d4bd
Closes-Bug: #1857901
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
users.
Change-Id: I3a6084db9f86627e3e94abaa4fb4aec52a01126a
The traceback would look like
Traceback (most recent call last):
File ".../bin/ostestr", line 10, in <module>
sys.exit(main())
File ".../os_testr/ostestr.py", line 263, in main
exit(ostestr(sys.argv[1:]))
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
black_regex=opts.black_regex)
File ".../os_testr/ostestr.py", line 167, in call_testr
black_regex=black_regex)
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.
See https://github.com/mtreinish/stestr/commit/ac8dac0
Change-Id: I70a3ed6c3edaafc8bb6269b1ae07bd46b06f4db4
This is a mechanically generated patch to switch the documentation
jobs to use the new PTI versions of the jobs as part of the
python3-first goal.
See the python3-first goal document for details:
https://governance.openstack.org/tc/goals/stein/python3-first.html
Change-Id: I659dfddd562e051633902f7b57e27f6e02880576
Story: #2002586
Task: #24327
This is a mechanically generated patch to complete step 1 of moving
the zuul job settings out of project-config and into each project
repository.
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
normalized.
See the python3-first goal document for details:
https://governance.openstack.org/tc/goals/stein/python3-first.html
Change-Id: I7fe9740c9fe5e6f386d88f7930a79a8c25316ebf
Story: #2002586
Task: #24327
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.
Change-Id: I721815ac34e3cd0bc84a5e69104aecfe7fd62e79
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.
Change-Id: Icb3492ab0f08248a33f711807b150b4a9748fda6
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
tools/tox_install.sh.
Change-Id: I37fdd240862d4369160c3e7a7e5a004a154a5944
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.
Change-Id: Icdeb3c311f7eb414158aedb4c030494b419211c0
Closes-Bug: #1506215
Closes-Bug: #1595119
Closes-Bug: #1622722
Closes-Bug: #1669455
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
useful).
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.
Change-Id: Ide155a8e6b2b746c81388bacc0822c68d853b5a1
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)
Depends-On: I2c7618a742439fd2ed26879f3114f0f66fd6337f
Change-Id: Id7cb2a39a8308f1413608dcf19273a1d7f33592e
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.
Change-Id: If98df5c4905f4b5a22602ba19224f9368fc8129f