prplos/.gitlab/tests/cram
Petr Štetiar 26895230f7 ci: cram: add component split jobs behind CRAM_COMPONENTS
The hardware cram jobs currently run each board's complete suite. Every
automatic pipeline therefore consumes coverage that can be selected more
cheaply by component.

Add a runtime component template so test collection happens in cram's
checkout and environment. Replace each legacy board job with four static
full, prplmesh, lcm, and prplos jobs selected through the
comma-separated CRAM_COMPONENTS variable.

Name each job `cram <board> [<component>]` and include the selected
component in the expandable test-execution section title.

Move the MXL-specific cram skip from the legacy job-name token. Use the
stable DUT board identifier instead.

Preserve skip behavior under the compact OSPv2 name.

Default automatic pipelines to prplos. Start the full jobs
automatically in prplware release tag pipelines, whose build jobs also
run automatically. Keep cram jobs out of scheduled pipelines entirely,
as with the legacy suite: schedules never create the build jobs these
jobs need, so any selected cram job would fail scheduled pipeline
creation with an unsatisfiable needs reference. Keep the test command,
post suite, timeout, run_check, and JUnit filenames unchanged.

Assisted-by: codex:gpt-5
Assisted-by: claude:fable-5
References: CI-7
Signed-off-by: Petr Štetiar <petr.stetiar@prplfoundation.org>
2026-08-19 10:14:27 +00:00
..
arcadyan-mozart .gitlab: cram: update expected output after alignment with openwrt v24.10.8 2026-08-18 11:40:42 +01:00
generic ci: cram: add component split jobs behind CRAM_COMPONENTS 2026-08-19 10:14:27 +00:00
mxl25641-hdk-6 .gitlab: cram: update expected output after alignment with openwrt v24.10.8 2026-08-18 11:40:42 +01:00
nokia-valyrian .gitlab: cram: update expected output after alignment with openwrt v24.10.8 2026-08-18 11:40:42 +01:00
post/generic profiles: prpl_core.yml: feed_amx: amx-cli: bump stdin fix 2026-06-01 10:41:21 +00:00
prpl-haze .gitlab: cram: update expected output after alignment with openwrt v24.10.8 2026-08-18 11:40:42 +01:00
prplmesh ci: cram: add IEEE1905 model checks 2026-08-14 09:43:12 +00:00
scripts ci: cram: add component manifest lint 2026-08-19 10:14:27 +00:00
turris-omnia .gitlab: cram: update expected output after alignment with openwrt v24.10.8 2026-08-18 11:40:42 +01:00
urx851-b0-dk .gitlab: cram: update expected output after alignment with openwrt v24.10.8 2026-08-18 11:40:42 +01:00
wifi ci: cram: wifi-scheduler: adapt test script 2026-07-14 16:47:04 +01:00
wnc-freedom .gitlab: cram: update expected lspci output after hwdata upstep 2026-08-18 11:40:42 +01:00
.gitignore ci: cram: gitignore *.t.err artifacts 2026-07-21 13:45:22 +00:00
components.yml ci: cram: add component manifest and resolver 2026-08-19 10:14:27 +00:00
README.md ci: cram: add component split jobs behind CRAM_COMPONENTS 2026-08-19 10:14:27 +00:00

Cram tests

This directory contains the cram test suites used by the testbed jobs. Generic tests live in generic/; each supported device also has a board directory. Tests under post/ run separately after every selected main suite.

Component buckets

components.yml assigns tests to the component jobs:

  • sanity contains DUT and environment checks whose failure invalidates the result of any component bucket.
  • lcm contains tests matched by the explicit Lifecycle Manager globs.
  • prplmesh contains tests matched by the explicit prplMesh and wireless stack globs.
  • prplos is the computed remainder after the sanity and explicit buckets are removed.
  • full preserves the complete legacy suite and its ordering.

A trimmed manifest looks like this:

version: 1
sanity:
  include:
    # Globs are relative to the cram test root.
    - "*/005-build-config.t"
components:
  lcm:
    description: Lifecycle Manager
    include:
      - "generic/lcm/**/*.t"
  prplmesh:
    description: prplMesh + wireless stack (pwhm/mlo/apmld/wifi)
    include:
      - "**/*prplmesh*.t"

Every test in a split suite belongs to exactly one of sanity, lcm, prplmesh, or the prplos remainder. Sanity matches are removed first and must not also match an explicit component glob. A non-sanity test may match at most one explicit component; tests that match none enter the remainder. To reassign a test, add or adjust an include glob in the desired bucket. The prplos remainder is recomputed automatically.

For prplmesh, lcm, and prplos, the resolver puts the board's ordered sanity block before the ordered component block. Sanity checks therefore run first in each split component job. Non-sanity tests still run once across the three buckets. The full selection keeps the legacy suite byte-for-byte, and tests under post/ continue to run separately after every selected main suite.

The smoke and hw_only sets are reserved for the upcoming QEMU testbed lane (CI-5): smoke is the fast QEMU pre-gate set, while hw_only contains tests excluded from the QEMU candidate set. The lint validates both sets; hardware jobs do not use them.

Scripts

  • cram_component_bucketing.py provides the shared manifest, collection, glob expansion, and partition logic.
  • resolve-component-tests.py prints the ordered test list for one board and component.
  • check-component-coverage.py validates the manifest and reports sanity and bucket counts, newly added remainder tests, and broken test symlinks.

cram_component_bucketing.py uses underscores because it is an importable module. Executable scripts follow the repository's hyphenated CLI convention.

Selecting pipeline jobs

Set the pipeline-level CRAM_COMPONENTS variable to a comma-separated list containing one or more of full, prplmesh, lcm, and prplos. Do not add spaces around the commas. The default is prplos.

For example:

CRAM_COMPONENTS=prplmesh
CRAM_COMPONENTS=lcm,prplos
CRAM_COMPONENTS=full

Release tag pipelines (prplware-v*) start the full jobs automatically. Scheduled pipelines never create cram jobs, because they also never create the build jobs these jobs need. Other pipeline sources run the jobs named by the list. The job names have the form cram <Board> [<component>], such as cram OSPv2 [lcm]. The trailing component name lets GitLab group the four jobs for a board in the pipeline UI.

Resolving tests locally

The CI jobs call the resolver at runtime. Run it from the same checkout and Python environment that will run cram so its filesystem view and PyYAML dependency match the job:

.gitlab/tests/cram/scripts/resolve-component-tests.py \
  --test-root .gitlab/tests/cram \
  --manifest components.yml \
  --board wnc-freedom \
  --component prplos

The command prints the ordered test paths for cram. Valid component values are full, sanity, prplmesh, lcm, and prplos. Use sanity to inspect the always-run block. The sanity value is for inspection, not pipeline job selection.

Run the manifest lint from that environment as well:

.gitlab/tests/cram/scripts/check-component-coverage.py \
  --test-root .gitlab/tests/cram \
  --manifest components.yml

By default, the lint prints the full and sanity counts, the component and reserved-set counts, and warnings without listing the entire prplos remainder. It rejects unmatched include globs, overlaps between sanity and an explicit component, and overlaps between explicit components. Add --print-remainder to include the sorted remainder list.

Add --base-ref <commit> to compare against the tests tracked by a Git revision. --base-list <path> accepts a newline-separated baseline instead; the two baseline options are mutually exclusive. The lint still succeeds when a newly added test enters the prplos remainder, but prints a warning so the assignment can be reviewed.