open-cas-linux/test/functional/api/cas/git.py
Robert Baldyga 2a982aaf7e tests: Fix git utils
Return appropriate information instead of entire commit diff.

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2019-10-31 14:58:29 +01:00

22 lines
610 B
Python

#
# Copyright(c) 2019 Intel Corporation
# SPDX-License-Identifier: BSD-3-Clause-Clear
#
from core.test_run import TestRun
from connection.local_executor import LocalExecutor
def get_current_commit_hash():
local_executor = LocalExecutor()
return local_executor.run(
f"cd {TestRun.plugins['opencas']['repo_dir']} &&"
f'git show HEAD -s --pretty=format:"%H"').stdout
def get_current_commit_message():
local_executor = LocalExecutor()
return local_executor.run(
f"cd {TestRun.plugins['opencas']['repo_dir']} &&"
f'git show HEAD -s --pretty=format:"%B"').stdout