Skip to content

ci: apple-build-kunit: run the KUnit suites a PR touches, several per job - #3738

Merged
RyanTheTide merged 1 commit into
mainfrom
ci/b1-trim-pr-jobs-20261201
Dec 1, 2026
Merged

RyanTheTide merged 1 commit into
mainfrom
ci/b1-trim-pr-jobs-20261201

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

What: Per-PR KUnit selection for linux. A same-repo driver PR went from ~21 jobs (17 KUnit suites as 17 jobs, each building its own arm64 kernel, set off by include/**, any Kconfig* or Makefile) to ~6.

  • scripts/ci/apple-kunit.py holds all 23 suites (the 17 here plus the display, macaudio, MT7932, pmgr-pwrstate, SEP and AOP suites from the single-suite workflows), each with its kunitconfig and paths.
  • A "KUnit plan" job reads the PR's merge commit (HEAD^1..HEAD) and picks the suites whose paths the PR touches. For a header no entry names, it picks the suites whose own sources include it (at most four), and otherwise a smoke set (dcp-topology, asahi). Other shared code (Kconfig, Makefile, rust/, arm64, kernel/, mm/, lib/, KUnit tooling) also picks the smoke set. DT, docs and other workflows' files pick nothing. Example: include/uapi/drm/asahi_drm.h picks asahi only.
  • The selected suites run in order in one job, up to four per job, sharing one build dir.
  • Pushes to main, dispatches and PRs labelled kunit-full still run every suite, one "KUnit " job each. These names and "KUnit plan" are what the merge train's full-matrix check (kunit_proven) reads, so it keeps working. A dispatch can name suites (input "suites").
  • The compile job also builds drivers/pmdomain/apple, the MT7932 driver and sound/soc/apple in the Mac configuration.
  • Concurrency: one group per PR for whichever event's jobs run (pull_request or pull_request_target, per the AURORA_SELF_HOSTED routing), so a push supersedes the run of either event. The skipped twin and non-kunit-full label events get a group of their own and cancel nothing. The routing if:/runs-on and the merge-ref check are unchanged.

Supersedes the tiering in #3675 (that PR runs all suites on approval and on any shared path). The companion PR ci/b1-trim-pr-jobs-2-20261201 removes the single-suite workflows once this one is in.

Tested:

Risk: two-way door, CI only, no kernel change. A PR now runs only the suites its paths map to, so a break in an unselected suite shows up on the main push run (all suites) or under kunit-full. sep and aop now use the pinned Rust 1.96.0 that asahi uses, not the runner's default toolchain. Until the companion PR is in, the display/macaudio/MT7932/pmgr/SEP suites run twice on matching PRs.

Not yet: the companion PR (single-suite workflow removal, sep-source and host-tests trims). After both are in, the stale apple-drm/macaudio/mt7932/pmgr entries can come out of runner groups 3 and 4 (selected_workflows). #3722 adds a matrix entry to this file and will need a table line in apple-kunit.py instead.

… job

Every push to a PR under the Apple paths started all 17 KUnit suites as
17 jobs, each building its own arm64 kernel, and include/**, Kconfig* or
Makefile anywhere set that off. The display, macaudio, MT7932,
pmgr-pwrstate, SEP and AOP suites ran from five more workflows.

scripts/ci/apple-kunit.py now holds all 23 suites with their paths.
A "KUnit plan" job reads the PR's merge commit (HEAD^1..HEAD) and picks:
the suites whose paths the PR touches; for a header no entry names, the
suites whose sources include it (at most four), else a smoke set
(dcp-topology, asahi); the smoke set for other shared code (Kconfig,
Makefile, rust/, arm64, kernel/, mm/, lib/, the KUnit tooling). DT,
docs and other workflows' files pick nothing. Selected suites run in
order in one job, up to four per job, sharing one build dir.

Pushes, dispatches and PRs carrying the kunit-full label still run
every suite, one "KUnit <suite>" job each, which the merge train's
full-matrix check reads. A dispatch can name suites.

The compile job also builds drivers/pmdomain/apple, the MT7932 driver
and sound/soc/apple.

The run concurrency group is per PR for whichever event's jobs run,
so a push supersedes the run of either event; the skipped twin and
other label events get their own group and cancel nothing.

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: MERGE at d882049

Checked: scripts/ci/apple-kunit.py and the plan/matrix wiring in apple-build-kunit.yml.

  • An empty plan is guarded: the KUnit job has needs.plan.outputs.count != '0', so {"include":[]} never reaches fromJSON as a matrix. kunit-full, pushes and dispatches still get one "KUnit " job each, the names kunit_proven reads.
  • Dry run of plan --files on this head:
    • asahi .rs → asahi; clpc.c → clpc; sep.rs → sep; macsmc.c → macsmc
    • drivers/soc/apple/Kconfig → smoke (dcp-topology asahi)
    • media/apple/common → all six media suites in 2 jobs
    • Documentation and dts → nothing
  • run continues past a failed suite and fails the job at the end, with a summary table.
    Follow-ups (pre-existing gaps; the old 17-entry matrix had them too, so not a hold):
  • drivers/soc/apple/sleep.c and drivers/{net/wireless/apple/centauri,bluetooth/btcentauri}.c select no suite. Their KUnit tests (APPLE_SOC_SLEEP_KUNIT_TEST, apple-centauri-wifi) have no table entry. B1-GATES ran them by hand for #3728/#3735-3737; worth adding rows.
  • open(...) in --files is never closed (cosmetic).
  • Merge #3739 only after this one, as its body says.

@RyanTheTide
RyanTheTide merged commit 75507ff into main Dec 1, 2026
9 of 28 checks passed
@RyanTheTide
RyanTheTide deleted the ci/b1-trim-pr-jobs-20261201 branch December 1, 2026 05:59
RyanTheTide added a commit that referenced this pull request Dec 1, 2026
apple-build-kunit.yml now takes its KUnit suites from
scripts/ci/apple-kunit.py (#3738): the panel-notch matrix entry becomes
a table row there, selected by the panel notch record, its header and
the kiwi driver.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant