Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
lhcb-dpa
Analysis Productions
LbAPLocal
Commits
619f0b68
Commit
619f0b68
authored
Mar 04, 2022
by
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
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
src/LbAPLocal/cli.py
View file @
619f0b68
...
...
@@ -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"
,
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment