Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion docs/maestro-validate.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ Invoking `kci-dev maestro validate` without a subcommand prints help and exits w

* **MISS** if error_code ∈ {`Bug`, `Configuration`, `invalid_job_params`, `Job`, `job_generation_error`, `ObjectNotPersisted`, `RequestBodyTooLarge`, `submit_error`, `Unexisting permission codename.`, `kbuild_internal_error`}
* **ERROR** if error_code ∈ {`Canceled`, `Infrastructure`, `LAVATimeout`, `MultinodeTimeout`, `Test`}
* Boot retries excluded unless `retry_counter == 3`.
* Boot retries excluded unless `retry_counter == 3`: `incomplete` boots, and `fail` boots of `baseline*` jobs (the only failed jobs Maestro retries).
* A **status mismatch** is reported when the mapped result disagrees with the dashboard.

---
Expand Down Expand Up @@ -187,6 +187,9 @@ kci-dev maestro validate boots [OPTIONS]
| `--arch` | str | | Architecture filter. |
| `--verbose` | flag | `false` | Print detailed lists of missing items (JSON). |
| `--table-output` | flag | `false` | Show a table (otherwise prints a simple list). |
| `--pipeline-config` | path | | kernelci-pipeline config directory or file. Boot jobs are the jobs whose `kcidb_test_suite` starts with `boot`. |

Without `--pipeline-config`, Maestro boot jobs are matched by name: `baseline*` and `job-*-cip`.

### Output (Boots)

Expand Down Expand Up @@ -245,6 +248,10 @@ kci-dev maestro validate boots \
--commit <sha> \
--arch x86_64

# All boots for all trees, selecting boot jobs from the pipeline config
kci-dev maestro validate boots --all-checkouts \
--pipeline-config <kernelci-pipeline>/config

# Build history for a stable branch over the last 14 days
kci-dev maestro validate builds --history \
--giturl https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git \
Expand Down
29 changes: 28 additions & 1 deletion kcidev/subcommands/maestro/validate/boots.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@

from .helper import (
get_boot_stats,
load_boot_job_names,
print_simple_list,
print_table_stats,
print_validation_human,
print_validation_json,
validation_rows_to_json,
)
Expand All @@ -31,6 +33,7 @@
Examples:
kci-dev maestro validate boots --all-checkouts --days <number-of-days>
kci-dev maestro validate boots -commit <git-commit> --giturl <git-url> --branch <git-branch>
kci-dev maestro validate boots --all-checkouts --pipeline-config <kernelci-pipeline>/config
""",
)
@click.option(
Expand Down Expand Up @@ -90,6 +93,17 @@
default=False,
help="Print validation results as JSON",
)
@click.option(
"--human-readable",
is_flag=True,
default=False,
help="Print a human-readable validation summary. With --json, text is written to stderr.",
)
@click.option(
"--pipeline-config",
type=click.Path(exists=True),
help="kernelci-pipeline config directory or file used to select boot jobs by kcidb_test_suite. Without it, boot jobs are matched by name.",
)
@click.option(
"--fail-on-mismatch",
is_flag=True,
Expand All @@ -111,9 +125,12 @@ def boots(
verbose,
table_output,
use_json,
human_readable,
pipeline_config,
fail_on_mismatch,
):
final_stats = []
boot_jobs = load_boot_job_names(pipeline_config) if pipeline_config else None
raise_errors = use_json or fail_on_mismatch
stdout = sys.stdout
if use_json:
Expand Down Expand Up @@ -141,6 +158,7 @@ def boots(
verbose,
arch,
raise_errors,
boot_jobs=boot_jobs,
)
if stats:
final_stats.append(stats)
Expand All @@ -158,13 +176,16 @@ def boots(
verbose,
arch,
raise_errors,
boot_jobs=boot_jobs,
)
if stats:
final_stats.append(stats)
finally:
sys.stdout = stdout
if use_json:
report = print_validation_json("boots", final_stats, False, origin, days, arch)
if human_readable:
print_validation_human(report, err=True)
if fail_on_mismatch and not report["summary"]["ok"]:
ctx.exit(1)
return
Expand All @@ -177,11 +198,17 @@ def boots(
"Boot count\ncomparison",
"Missing boot IDs",
"Boots with\nstatus mismatch",
"Extra dashboard\nboot IDs",
]
max_col_width = [None, 40, 3, 3, 2, 30, 30]
max_col_width = [None, 40, 3, 3, 2, 30, 30, 30]
table_fmt = "simple_grid"
if table_output:
print_table_stats(final_stats, headers, max_col_width, table_fmt)
elif human_readable:
report = validation_rows_to_json(
"boots", final_stats, False, origin, days, arch
)
print_validation_human(report)
else:
print_simple_list(final_stats, "boots", False)
if fail_on_mismatch:
Expand Down
21 changes: 19 additions & 2 deletions kcidev/subcommands/maestro/validate/builds.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
get_builds_history_stats,
print_simple_list,
print_table_stats,
print_validation_human,
print_validation_json,
validation_rows_to_json,
)
Expand Down Expand Up @@ -104,6 +105,12 @@
default=False,
help="Print validation results as JSON",
)
@click.option(
"--human-readable",
is_flag=True,
default=False,
help="Print a human-readable validation summary. With --json, text is written to stderr.",
)
@click.option(
"--fail-on-mismatch",
is_flag=True,
Expand All @@ -126,6 +133,7 @@ def builds(
verbose,
table_output,
use_json,
human_readable,
fail_on_mismatch,
):
final_stats = []
Expand Down Expand Up @@ -213,6 +221,8 @@ def builds(
report = print_validation_json(
"builds", final_stats, history, origin, days, arch
)
if human_readable:
print_validation_human(report, err=True)
if fail_on_mismatch and not report["summary"]["ok"]:
ctx.exit(1)
return
Expand All @@ -225,8 +235,9 @@ def builds(
"Dashboard\nbuilds",
"Build count\ncomparison",
"Missing build IDs",
"Extra dashboard\nbuild IDs",
]
max_col_width = [None, 40, 3, 3, 2, 30]
max_col_width = [None, 40, 3, 3, 2, 30, 30]

else:
headers = [
Expand All @@ -237,11 +248,17 @@ def builds(
"Build count\ncomparison",
"Missing build IDs",
"Builds with\nstatus mismatch",
"Extra dashboard\nbuild IDs",
]
max_col_width = [None, 40, 3, 3, 2, 30, 30]
max_col_width = [None, 40, 3, 3, 2, 30, 30, 30]
table_fmt = "simple_grid"
if table_output:
print_table_stats(final_stats, headers, max_col_width, table_fmt)
elif human_readable:
report = validation_rows_to_json(
"builds", final_stats, history, origin, days, arch
)
print_validation_human(report)
else:
print_simple_list(final_stats, "builds", history)
if fail_on_mismatch:
Expand Down
Loading
Loading