style: split health check words
This commit is contained in:
parent
6b5d941eb1
commit
8ad4d6f2a0
|
@ -4,7 +4,7 @@ from typing import List
|
||||||
from joj3_config_generator.models import joj1, repo, result, task
|
from joj3_config_generator.models import joj1, repo, result, task
|
||||||
from joj3_config_generator.models.const import CACHE_ROOT, JOJ3_CONFIG_ROOT
|
from joj3_config_generator.models.const import CACHE_ROOT, JOJ3_CONFIG_ROOT
|
||||||
from joj3_config_generator.processers.repo import (
|
from joj3_config_generator.processers.repo import (
|
||||||
get_healthcheck_config,
|
get_health_check_config,
|
||||||
get_teapot_stage,
|
get_teapot_stage,
|
||||||
)
|
)
|
||||||
from joj3_config_generator.processers.task import (
|
from joj3_config_generator.processers.task import (
|
||||||
|
@ -32,9 +32,9 @@ def convert(repo_conf: repo.Config, task_conf: task.Config) -> result.Config:
|
||||||
)
|
)
|
||||||
|
|
||||||
current_test = os.environ.get("PYTEST_CURRENT_TEST") is not None
|
current_test = os.environ.get("PYTEST_CURRENT_TEST") is not None
|
||||||
# Construct healthcheck stage
|
# Construct health check stage
|
||||||
if not repo_conf.force_skip_health_check_on_test or not current_test:
|
if not repo_conf.force_skip_health_check_on_test or not current_test:
|
||||||
result_conf.stage.stages.append(get_healthcheck_config(repo_conf))
|
result_conf.stage.stages.append(get_health_check_config(repo_conf))
|
||||||
cached: List[str] = []
|
cached: List[str] = []
|
||||||
# Convert each stage in the task configuration
|
# Convert each stage in the task configuration
|
||||||
for task_stage in task_conf.stages:
|
for task_stage in task_conf.stages:
|
||||||
|
|
|
@ -34,7 +34,7 @@ def get_teapot_stage(repo_conf: repo.Config) -> result.StageDetail:
|
||||||
return stage_conf
|
return stage_conf
|
||||||
|
|
||||||
|
|
||||||
def get_healthcheck_args(repo_conf: repo.Config) -> List[str]:
|
def get_health_check_args(repo_conf: repo.Config) -> List[str]:
|
||||||
return [
|
return [
|
||||||
"/usr/local/bin/repo-health-checker",
|
"/usr/local/bin/repo-health-checker",
|
||||||
"-root=.",
|
"-root=.",
|
||||||
|
@ -45,7 +45,7 @@ def get_healthcheck_args(repo_conf: repo.Config) -> List[str]:
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
def get_debug_args(repo_conf: repo.Config) -> List[str]:
|
def get_teapot_check_args(repo_conf: repo.Config) -> List[str]:
|
||||||
group_config = ""
|
group_config = ""
|
||||||
for i, name in enumerate(repo_conf.groups.name):
|
for i, name in enumerate(repo_conf.groups.name):
|
||||||
group_config = (
|
group_config = (
|
||||||
|
@ -67,9 +67,9 @@ def get_debug_args(repo_conf: repo.Config) -> List[str]:
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
def get_healthcheck_config(repo_conf: repo.Config) -> result.StageDetail:
|
def get_health_check_config(repo_conf: repo.Config) -> result.StageDetail:
|
||||||
healthcheck_stage = result.StageDetail(
|
health_check_stage = result.StageDetail(
|
||||||
name="healthcheck",
|
name="Health Check",
|
||||||
group="",
|
group="",
|
||||||
executor=result.Executor(
|
executor=result.Executor(
|
||||||
name="local",
|
name="local",
|
||||||
|
@ -77,10 +77,10 @@ def get_healthcheck_config(repo_conf: repo.Config) -> result.StageDetail:
|
||||||
default=result.Cmd(),
|
default=result.Cmd(),
|
||||||
cases=[
|
cases=[
|
||||||
result.OptionalCmd(
|
result.OptionalCmd(
|
||||||
args=get_healthcheck_args(repo_conf),
|
args=get_health_check_args(repo_conf),
|
||||||
),
|
),
|
||||||
result.OptionalCmd(
|
result.OptionalCmd(
|
||||||
args=get_debug_args(repo_conf),
|
args=get_teapot_check_args(repo_conf),
|
||||||
env=[f"LOG_FILE_PATH={CACHE_ROOT}/joint-teapot-debug.log"],
|
env=[f"LOG_FILE_PATH={CACHE_ROOT}/joint-teapot-debug.log"],
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
@ -91,7 +91,7 @@ def get_healthcheck_config(repo_conf: repo.Config) -> result.StageDetail:
|
||||||
result.ParserConfig(name="debug", with_={"score": 0}),
|
result.ParserConfig(name="debug", with_={"score": 0}),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
return healthcheck_stage
|
return health_check_stage
|
||||||
|
|
||||||
|
|
||||||
def calc_sha256sum(file_path: Path) -> str:
|
def calc_sha256sum(file_path: Path) -> str:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user