exit on failure, add per-class logging
All checks were successful
Check Nix flake / Perform Nix flake checks (ubuntu-latest) (pull_request) Successful in 3m26s
Check flake.lock / Check health of `flake.lock` (pull_request) Successful in 20s
Check Nix flake / Build nix outputs (ubuntu-latest) (pull_request) Successful in 2m21s
Check Nix formatting / Perform Nix format checks (pull_request) Successful in 1m41s

Signed-off-by: ahuston-0 <aliceghuston@gmail.com>
This commit is contained in:
2025-03-26 11:22:29 -04:00
parent 4438e93037
commit 607f3f9f76
5 changed files with 42 additions and 31 deletions

View File

@ -5,6 +5,8 @@ import shutil
from flupdt.common import bash_wrapper
logger = logging.getLogger(__name__)
def compare_derivations(
path_to_flake: str, path_to_pre_drv: str, path_to_post_drv: str, *, soft_failure: bool = True
@ -24,10 +26,10 @@ def compare_derivations(
)
if returncode != 0:
log_func = logging.error
log_func = logger.error
if soft_failure:
log_func = logging.warning
logging.warning(f"diff failed for {path_to_pre_drv} and {path_to_post_drv}")
log_func = logger.warning
logger.warning(f"diff failed for {path_to_pre_drv} and {path_to_post_drv}")
log_func(stderr)
return stdout