Skip to content

Translate all provider/base/units/stress pxus (Infra) - #2817

Merged
Hook25 merged 18 commits into
mainfrom
translate-all-stress-pxus
Sep 18, 2026
Merged

Hook25 merged 18 commits into
mainfrom
translate-all-stress-pxus

Conversation

@tomli380576

@tomli380576 tomli380576 commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Description

This PR translates all pxu files under provider/base/units/stress and removes all invalid keys.

Resolved issues

  • Migrated all units to YAML
  • Added math typesetting to the suspend test readme file.
  • Replaced the not-descriptive job summary with one that's consistent with all other suspend jobs
Before After

Documentation

Jinja2

In docs/how-to/migrate-away-jinja2.rst it explicitly mentions that the use of jinja2 is very dangerous in the command section. However, to keep this PR as close to the checkbox-cli translate output as possible (it's already pretty big), I left the jinja2 pieces in. The impacted jobs still work as shown in the C3 submission, but I will have a follow-up PR specifically to remove all uses of jinja2 after this PR is merged.

Impacted jobs

  • stress-tests/suspend_s3_iterations_cycles. This one is especially sketchy because it uses jinja2 as a conditional check

These jobs only use {{}} substitution syntax from jinja2 so it should be easy to migrate.

  • stress-tests/suspend_cycles_1_rebootsuspend_reboot_id
  • stress-tests/suspend_cycles_suspend_id_rebootsuspend_reboot_id
  • stress-tests/suspend_cycles_rebootsuspend_reboot_id
  • stress-tests/hibernate_s4_iterations_cycles

(Seemingly) orphaned jobs

When doing the translation copilot found these jobs that doesn't seem to be included in any test plan (I searched around the repo to validate this and made sure copilot wasn't making things up)

stress/reboot
stress/reboot_log
stress/poweroff
stress/poweroff_log
stress/reboot_check
stress/reboot_check_log
stress/reboot_30_check
stress/reboot_30_check_log
stress/poweroff_check
stress/poweroff_check_log
stress/poweroff_30_check
stress/poweroff_30_check_log
stress/suspend_250_cycles
stress/suspend-250-cycle-log-attach
stress/suspend-250-cycles-time-check
stress/hibernate_250_cycles
stress/hibernate-250-cycle-log-attach,
stress/usb
stress/sdhc
stress/network_restart
stress/network_restart_log
stress/wireless_hotkey
stress/wireless_bluetooth_coex_connect_stress
power-management/suspend-30-cycles-log-check

not going to remove them in this PR because I'm not sure if any custom test plans uses them. They are listed here for documentation.

Tests

Successful run of suspend-cycles-stress: https://certification.canonical.com/hardware/202601-38351/submission/508978/

Compared the output of checkbox-cli list-bootstrapped before and after the PR for these test plans and no jobs were lost

com.canonical.certification::stress-cert-full
com.canonical.certification::stress-cert-manual
com.canonical.certification::stress-cert-automated
com.canonical.certification::stress-cert-blockers
com.canonical.certification::stress-suspend-30-cycles-with-reboots-automated
com.canonical.certification::stress-suspend-30-cycles-with-coldboots-automated
com.canonical.certification::stress-hibernate-30-cycles-automated
com.canonical.certification::stress-30-reboot-poweroff-automated
com.canonical.certification::stress-10-reboot-poweroff-automated
com.canonical.certification::stress-ng-cert-automated
com.canonical.certification::stress-warmboot-coldboot-automated
com.canonical.certification::stress-full
com.canonical.certification::stress-automated
com.canonical.certification::warm-boot-stress-test
com.canonical.certification::cold-boot-stress-test
com.canonical.certification::suspend-stress-test
com.canonical.certification::hibernate-stress-test
com.canonical.certification::suspend-cycles-stress-test
com.canonical.certification::stress-ng-automated
com.canonical.certification::stress-iperf3-automated
com.canonical.certification::stress-pm-graph
com.canonical.certification::stress-sru-tests
com.canonical.certification::stress-base-26-04-automated

@codecov

codecov Bot commented Sep 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 61.33%. Comparing base (1acd778) to head (c686545).
⚠️ Report is 42 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2817      +/-   ##
==========================================
+ Coverage   61.32%   61.33%   +0.01%     
==========================================
  Files         499      499              
  Lines       50363    50392      +29     
  Branches     8848     8856       +8     
==========================================
+ Hits        30886    30910      +24     
  Misses      18637    18637              
- Partials      840      845       +5     
Flag Coverage Δ
provider-base 39.89% <ø> (+0.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@tomli380576
tomli380576 requested a lite review from Copilot September 3, 2026 17:33
@tomli380576
tomli380576 marked this pull request as ready for review September 3, 2026 17:34
@tomli380576
tomli380576 force-pushed the translate-all-stress-pxus branch from 4fc82a6 to 192c2b8 Compare September 3, 2026 17:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Several migrated YAML job command fields contain embedded newlines inside quoted scalars, which will split shell commands at runtime and break the affected jobs.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR migrates the providers/base/units/stress provider units from legacy .pxu format to YAML, aiming to keep the same test-plan behavior while removing invalid keys and improving related documentation.

Changes:

  • Converted stress test plans, jobs, and templates from .pxu to .yaml, removing the old .pxu sources.
  • Updated the suspend-cycles reboot flow documentation (suspend_cycles_reboot.md) to better describe execution order and generated job relationships.
  • Normalized/cleaned up some YAML fields (e.g., quoting of estimated_duration, manifest field naming/formatting) and added packaging metadata for stress-ng.
File summaries
File Description
providers/base/units/stress/test-plan.yaml New YAML test-plan definitions replacing the removed PXU plan.
providers/base/units/stress/test-plan.pxu Removed legacy PXU test-plan source after YAML migration.
providers/base/units/stress/suspend_cycles_reboot.yaml New YAML resource/template/job units for suspend cycles with reboot flow.
providers/base/units/stress/suspend_cycles_reboot.pxu Removed legacy PXU suspend/reboot units after YAML migration.
providers/base/units/stress/suspend_cycles_reboot.md Updated documentation describing generated jobs and their dependency flow.
providers/base/units/stress/stress-ng.yaml Minor YAML normalization (e.g., estimated_duration quoting).
providers/base/units/stress/s3s4.yaml New YAML definitions for S3/S4 stress categories/resources/templates replacing PXU.
providers/base/units/stress/s3s4.pxu Removed legacy PXU S3/S4 units after YAML migration.
providers/base/units/stress/packaging.yaml Added packaging metadata to express required stress-ng dependency.
providers/base/units/stress/manifest.yaml Updated manifest entry field naming and made hidden-reason a block scalar.
providers/base/units/stress/jobs.yaml New YAML job definitions replacing PXU jobs for stress/power-management tasks.
providers/base/units/stress/jobs.pxu Removed legacy PXU jobs after YAML migration.
Review details

Suppressed comments (2)

providers/base/units/stress/suspend_cycles_reboot.yaml:227

  • This command is a single-quoted multi-line YAML scalar, so the embedded newline is preserved and will split the shell command in two. Keep it on one line (or use a folded scalar) so --s/--r remain arguments to sleep_time_check.py.
command:
  '[ -e "$PLAINBOX_SESSION_SHARE"/suspend_cycles_with_reboot_total.log ] && sleep_time_check.py "$PLAINBOX_SESSION_SHARE"/suspend_cycles_with_reboot_total.log
  --s {sleep_threshold} --r {resume_threshold}'

providers/base/units/stress/s3s4.yaml:164

  • The command value is a single-quoted multi-line YAML scalar; the newline is preserved and will split the shell command, causing -t all ... to be executed separately. Keep the command on one line (or use a folded scalar).
command:
  '[ -e "$PLAINBOX_SESSION_SHARE"/hibernate_{s4_iterations}_cycles.log ] && sleep_test_log_check.py -v --ignore-warning
  -t all "$PLAINBOX_SESSION_SHARE"/hibernate_{s4_iterations}_cycles.log'
  • Files reviewed: 11/12 changed files
  • Comments generated: 3
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread providers/base/units/stress/jobs.yaml Outdated
Comment thread providers/base/units/stress/s3s4.yaml Outdated
Comment thread providers/base/units/stress/suspend_cycles_reboot.yaml Outdated
@tomli380576
tomli380576 marked this pull request as draft September 3, 2026 17:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Several newly introduced YAML units contain invalid command: scalars (missing |/>-) and one multi-line shell command is missing a line-continuation, which will break parsing/runtime.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details

Suppressed comments (5)

providers/base/units/stress/jobs.yaml:505

  • command: is missing a YAML block scalar (|/>-) so the following indented lines are not a valid scalar value, which will break YAML parsing for this unit.
command:
  pm_log_check.py --log-level=notset "$PLAINBOX_SESSION_SHARE"/pm_test.reboot.10.log
  "$PLAINBOX_SESSION_SHARE"/pm_log_check_reboot.10.log

providers/base/units/stress/jobs.yaml:528

  • command: is missing a YAML block scalar (|/>-) so the following indented lines are not a valid scalar value, which will break YAML parsing for this unit.
command:
  pm_log_check.py --log-level=notset "$PLAINBOX_SESSION_SHARE"/pm_test.poweroff.30.log
  "$PLAINBOX_SESSION_SHARE"/pm_log_check_poweroff.30.log

providers/base/units/stress/jobs.yaml:551

  • command: is missing a YAML block scalar (|/>-) so the following indented lines are not a valid scalar value, which will break YAML parsing for this unit.
command:
  pm_log_check.py --log-level=notset "$PLAINBOX_SESSION_SHARE"/pm_test.poweroff.10.log
  "$PLAINBOX_SESSION_SHARE"/pm_log_check_poweroff.10.log

providers/base/units/stress/jobs.yaml:574

  • command: is missing a YAML block scalar (|/>-) so the following indented lines are not a valid scalar value, which will break YAML parsing for this unit.
command:
  pm_log_check.py --log-level=notset "$PLAINBOX_SESSION_SHARE"/pm_test.reboot.100.log
  "$PLAINBOX_SESSION_SHARE"/pm_log_check_reboot.100.log

providers/base/units/stress/jobs.yaml:597

  • command: is missing a YAML block scalar (|/>-) so the following indented lines are not a valid scalar value, which will break YAML parsing for this unit.
command:
  pm_log_check.py --log-level=notset "$PLAINBOX_SESSION_SHARE"/pm_test.poweroff.100.log
  "$PLAINBOX_SESSION_SHARE"/pm_log_check_poweroff.100.log
  • Files reviewed: 11/12 changed files
  • Comments generated: 3
  • Review effort level: Lite

Comment thread providers/base/units/stress/jobs.yaml
Comment thread providers/base/units/stress/jobs.yaml Outdated
Comment thread providers/base/units/stress/suspend_cycles_reboot.md Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The migration can leave the watchdog disabled and prevent Checkbox from restarting after reboot jobs.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details

Suppressed comments (2)

Previously missed (1) — in code that hasn't changed since the last review.

providers/base/units/stress/test-plan.yaml:306

  • restore_watchdog is no longer selected by this plan. The stressor templates' before relation only orders the restore job when it is already in the selected job map; it does not pull that job in (checkbox-ng/plainbox/impl/ctrl.py:148-154). The after relation does pull the disable job, so this sequence can leave the systemd watchdog disabled after the stress run. Keep the explicit wrapper jobs in the plan.

providers/base/units/stress/suspend_cycles_reboot.md:29

  • These generated-job examples have the indices and ranges reversed. This template produces the first suspend for reboot cycles 2 through K, while the next template produces suspend cycles 2 through N for every reboot cycle. As written, the documentation duplicates S_{1,1}, omits S_{n,1}, and labels S_{1,k} as S_{k,1}.
- `suspend_cycles_1_reboot{{suspend_reboot_id}}`: $S_{k,1}$, where $k = 1,2,3$
- `suspend_cycles_{{suspend_id}}_reboot{{suspend_reboot_id}}`: $S_{n, k}$, where $n = 2,3,4,5$ and $k=2,3$
  • Files reviewed: 11/12 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Comment thread providers/base/units/stress/suspend_cycles_reboot.yaml
@tomli380576
tomli380576 marked this pull request as ready for review September 16, 2026 07:54
@tomli380576
tomli380576 marked this pull request as draft September 17, 2026 04:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The suspend-cycle documentation currently gives incorrect generated-job indices and ranges.

Review details

Suppressed comments (2)

Previously missed (1) — in code that hasn't changed since the last review.

providers/base/units/stress/suspend_cycles_reboot.md:18

  • Correct the grammar and duplicated word in this definition.

providers/base/units/stress/suspend_cycles_reboot.md:29

  • These ranges do not match the generators: stress_s3_cycles_iterations_1 emits only reboot IDs 2 through K, while stress_s3_cycles_iterations_multiple emits every reboot ID 1 through K. The first template is also $S_{1,k}$, not $S_{k,1}$, so the example currently misdocuments which jobs are generated.
- `suspend_cycles_1_reboot{{suspend_reboot_id}}`: $S_{k,1}$, where $k = 1,2,3$
- `suspend_cycles_{{suspend_id}}_reboot{{suspend_reboot_id}}`: $S_{n, k}$, where $n = 2,3,4,5$ and $k=2,3$
  • Files reviewed: 11/12 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Two cold-boot siblings retain incorrect inherited reboot purposes because their overrides use description instead of purpose.

Review details

Suppressed comments (3)

Previously missed (3) — in code that hasn't changed since the last review.

providers/base/units/stress/jobs.yaml:126

  • This sibling inherits the parent job's reboot purpose, because description is a separate legacy field and does not override purpose. The generated cold-boot job therefore exposes a purpose describing a reboot rather than a poweroff. Use purpose here to preserve the PXU override semantics.
    providers/base/units/stress/jobs.yaml:205
  • This sibling inherits the parent attachment's reboot purpose; setting description does not replace that field. As a result, the generated cold-boot attachment has a poweroff description but still exposes the reboot purpose. Override purpose directly.
    providers/base/units/stress/suspend_cycles_reboot.md:62
  • Use the plural verb to agree with “jobs.”
  • Files reviewed: 11/12 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

@tomli380576
tomli380576 marked this pull request as ready for review September 17, 2026 05:15
@tomli380576 tomli380576 changed the title Translate all provider/base/units/stress pxus (New) Translate all provider/base/units/stress pxus (Infra) Sep 18, 2026

@Hook25 Hook25 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

+1, Than ks for all the fixes

@Hook25
Hook25 merged commit 7a2caf0 into main Sep 18, 2026
58 checks passed
@Hook25
Hook25 deleted the translate-all-stress-pxus branch September 18, 2026 07:24
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.

3 participants