未验证 提交 ecd38f65 编写于 作者: A Amador Pahim

Merge branch 'clebergnu-misc_improvs'

Signed-off-by: NAmador Pahim <apahim@redhat.com>
......@@ -329,23 +329,28 @@ class Job(object):
@staticmethod
def _get_avocado_git_version():
# if running from git sources, there will be a ".git" directory
# 3 levels up
base_dir = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
git_dir = os.path.join(base_dir, '.git')
if not os.path.isdir(git_dir):
return
if not os.path.exists(os.path.join(base_dir, 'python-avocado.spec')):
return
try:
git = path.find_command('git')
except path.CmdNotFoundError:
return
# We need to get git root as `py2to3` creates this file in BUILD
olddir = os.getcwd()
try:
os.chdir(os.path.dirname(__file__))
git_root = process.run('%s rev-parse --show-toplevel' % git,
ignore_status=True, verbose=False)
if git_root.exit_status == 0 and os.path.exists(os.path.join(
git_root.stdout.strip(), 'python-avocado.spec')):
cmd = "%s show --summary --pretty='%%H'" % git
res = process.run(cmd, ignore_status=True, verbose=False)
if res.exit_status == 0:
top_commit = res.stdout.splitlines()[0][:8]
return " (GIT commit %s)" % top_commit
os.chdir(base_dir)
cmd = "%s show --summary --pretty='%%H'" % git
res = process.run(cmd, ignore_status=True, verbose=False)
if res.exit_status == 0:
top_commit = res.stdout.splitlines()[0][:8]
return " (GIT commit %s)" % top_commit
finally:
os.chdir(olddir)
......
......@@ -257,12 +257,18 @@ class CmdResult(object):
"""
Command execution result.
:param command: String containing the command line itself
:param exit_status: Integer exit code of the process
:param stdout: String containing stdout of the process
:param stderr: String containing stderr of the process
:param duration: Elapsed wall clock time running the process
:param command: the command line itself
:type command: str
:param exit_status: exit code of the process
:type exit_status: int
:param stdout: content of the process stdout
:type stdout: str
:param stderr: content of the process stderr
:type stderr: str
:param duration: elapsed wall clock time running the process
:type duration: float
:param pid: ID of the process
:type pid: int
"""
def __init__(self, command="", stdout="", stderr="",
......
......@@ -154,6 +154,7 @@ if __name__ == '__main__':
"Operating System :: POSIX",
"Topic :: Software Development :: Quality Assurance",
"Topic :: Software Development :: Testing",
"Programming Language :: Python :: 2.7",
],
packages=find_packages(exclude=('selftests*',)),
data_files=get_data_files(),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册