зеркало из https://github.com/microsoft/lisa.git
dump git repo information before run
This commit is contained in:
Родитель
c94debc308
Коммит
7f6b958938
10
lisa/main.py
10
lisa/main.py
|
@ -2,6 +2,7 @@
|
|||
# Licensed under the MIT license.
|
||||
|
||||
|
||||
import os
|
||||
import sys
|
||||
import traceback
|
||||
from datetime import datetime
|
||||
|
@ -11,6 +12,7 @@ from typing import Optional
|
|||
|
||||
from retry import retry
|
||||
|
||||
# force to import all modules for reflection use
|
||||
import lisa.mixin_modules # noqa: F401
|
||||
from lisa.parameter_parser.argparser import parse_args
|
||||
from lisa.util import constants, get_datetime_path
|
||||
|
@ -41,6 +43,12 @@ def _normalize_path(path_type: str, path: Optional[Path] = None) -> Path:
|
|||
return path
|
||||
|
||||
|
||||
def _dump_code_information() -> None:
|
||||
command = r'git log -1 "--pretty=format:%H%d %ci, %s"'
|
||||
os.system(command)
|
||||
os.system(f"git submodule foreach --recursive {command}")
|
||||
|
||||
|
||||
@retry(FileExistsError, tries=10, delay=0.2)
|
||||
def test_path(
|
||||
log_root_path: Path, working_root_path: Path, run_id: str = ""
|
||||
|
@ -116,6 +124,8 @@ def main() -> int:
|
|||
log.info(f"Python version: {sys.version}")
|
||||
log.info(f"local time: {datetime.now().astimezone()}")
|
||||
|
||||
_dump_code_information()
|
||||
|
||||
# We don't want command line args logging to leak any provided
|
||||
# secrets, if any ("s:key:value" syntax)
|
||||
add_secrets_from_pairs(args.variables)
|
||||
|
|
Загрузка…
Ссылка в новой задаче