Commit 619f0b68 authored by Chris Burr's avatar Chris Burr
Browse files

Merge branch 'aiwieder/checks_ci' into 'master'

Produce `root` output from checks in the CI

See merge request !48
parents 8687504f b74b9adf
Pipeline #3659125 passed with stages
in 6 minutes and 36 seconds
......@@ -16,7 +16,7 @@ from os.path import join
import click
from LbAPCommon import parse_yaml, render_yaml, validate_yaml
from LbAPCommon.checks import run_job_checks
from LbAPCommon.checks_utils import checks_to_JSON
from LbAPCommon.checks_utils import checks_to_JSON, hist_to_root
from pkg_resources import DistributionNotFound, get_distribution
from .checks import checks_exist, perform_checks
......@@ -345,23 +345,26 @@ def check(production_name, job_name, test_ntuple_path, checks_output_dir, valida
@main.command()
@click.argument("checks_data_file", type=str, nargs=1)
@click.argument("input_ntuple", type=str, nargs=1)
@click.argument("checks_output_file", type=str, nargs=1)
def ci_checks(checks_data_file, input_ntuple, checks_output_file):
@click.argument("output_dir", type=str, nargs=1)
def ci_checks(checks_data_file, input_ntuple, output_dir):
"""Helper function for running checks in the CI. This is not recommended for users."""
click.secho("Starting checks!", fg="green")
with open(checks_data_file, "r") as inf:
test_info = json.load(inf)
check_results = {
test_info["jobs"][0]["name"]: run_job_checks(
test_info["jobs"][0]["checks"],
test_info["jobs"][0]["checks_data"],
[input_ntuple],
)
}
check_results = run_job_checks(
test_info["jobs"][0]["checks"],
test_info["jobs"][0]["checks_data"],
[input_ntuple],
)
hist_to_root(
test_info["jobs"][0]["name"], check_results, f"{output_dir}/checks.root"
)
check_results = {test_info["jobs"][0]["name"]: check_results}
checks_to_JSON(
test_info["jobs"][0]["checks_data"],
check_results,
json_output_path=checks_output_file,
json_output_path=f"{output_dir}/checks.json",
)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment