Skip to content

Move some modules from checkbox_support to checkbox_ng (BugFix)#2312

Open
pieqq wants to merge 11 commits intomainfrom
2132-baked-submission-resource
Open

Move some modules from checkbox_support to checkbox_ng (BugFix)#2312
pieqq wants to merge 11 commits intomainfrom
2132-baked-submission-resource

Conversation

@pieqq
Copy link
Collaborator

@pieqq pieqq commented Jan 28, 2026

Description

This PR is the first of a series of PR to allow Checkbox to include information about the test run without relying on specific jobs in a test plan.

It does not add anything new, but should not break anything either.

This PR focuses on moving modules from the checkbox_support package to a new module in the checkbox_ng package (checkbox_ng.support), namely the parsers modules originally in checkbox_support/parsers, along with the following modules that are required by said parsers:

  • checkbox_support.lib modules
  • checkbox_support.monitor_config module
  • checkbox_support.helpers release_info and slugify modules

The old modules in checkbox_support are not deleted, but instead modified to point to the new ones. This is done to be backward compatible not only with the jobs in our own providers, but also potentially with jobs in third party providers that we might not be aware of.

Resolved issues

https://warthogs.atlassian.net/browse/CHECKBOX-2132

Documentation

Please check each commit description for more information.

Tests

  • Existing unit tests are still passing (for checkbox_ng, checkbox_support, as well as the resource and base providers' ./manage.py test -u)
  • A quick run of a simple test plan in checkbox returns what's expected in the submission.

pieqq added 3 commits January 28, 2026 16:07
In order to include device information in every Checkbox submission
without relying on external jobs being present in the test plan run, a
bunch of parsers and helpers initially available in checkbox_support
need to be migrated to checkbox_ng (since we don't want to import stuff
from checkbox_support in checkbox_ng, but the other way around is OK).

In addition to these, the following code is also migrated because it is
required by the parsers:

    - checkbox_support.lib modules
    - checkbox_support.monitor_config module
    - checkbox_support.helpers release_info and slugify modules

In order not to break any providers (internal or third party), all the
modules in checkbox_support remain, but they point to the code in
checkbox_ng.support.
The meminfo module was modified when it was migrated from
checkbox_support to checkbox_ng.support to decouple the parsed data from
the information required by the resource job.

In this commit, the resource script is adjusted to match the new code in
the parser.
Some python classes copied over from checkbox_support do not need to be
tested even though their class name starts with "Test".
@codecov
Copy link

codecov bot commented Jan 28, 2026

Codecov Report

❌ Patch coverage is 78.36156% with 626 lines in your changes missing coverage. Please review.
✅ Project coverage is 56.92%. Comparing base (d0f126c) to head (c47d3ce).
⚠️ Report is 11 commits behind head on main.

Files with missing lines Patch % Lines
checkbox-ng/checkbox_ng/support/parsers/udevadm.py 82.03% 101 Missing and 67 partials ⚠️
checkbox-ng/checkbox_ng/support/parsers/netplan.py 0.00% 99 Missing ⚠️
...eckbox-ng/checkbox_ng/support/parsers/sysfs_usb.py 47.09% 88 Missing and 3 partials ⚠️
checkbox-ng/checkbox_ng/support/lib/conversion.py 33.82% 42 Missing and 3 partials ⚠️
...heckbox-ng/checkbox_ng/support/parsers/__init__.py 41.17% 30 Missing ⚠️
checkbox-ng/checkbox_ng/support/parsers/cpuinfo.py 65.43% 16 Missing and 12 partials ⚠️
...heckbox-ng/checkbox_ng/support/parsers/lshwjson.py 0.00% 19 Missing ⚠️
checkbox-ng/checkbox_ng/support/parsers/meminfo.py 0.00% 19 Missing ⚠️
checkbox-ng/checkbox_ng/support/lib/dmi.py 81.01% 15 Missing ⚠️
...ckbox-ng/checkbox_ng/support/parsers/image_info.py 79.72% 15 Missing ⚠️
... and 37 more

❌ Your patch check has failed because the patch coverage (78.36%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2312      +/-   ##
==========================================
+ Coverage   54.92%   56.92%   +1.99%     
==========================================
  Files         412      460      +48     
  Lines       44304    46616    +2312     
  Branches     8165     8325     +160     
==========================================
+ Hits        24335    26536    +2201     
- Misses      19140    19215      +75     
- Partials      829      865      +36     
Flag Coverage Δ
checkbox-ng 75.32% <79.05%> (+3.63%) ⬆️
checkbox-support 62.81% <20.00%> (-6.75%) ⬇️
provider-base 31.72% <ø> (ø)
provider-certification-client 57.14% <ø> (ø)
provider-certification-server 57.14% <ø> (ø)
provider-genio 96.90% <ø> (ø)
provider-gpgpu 93.14% <ø> (ø)
provider-iiotg 100.00% <ø> (ø)
provider-resource 39.61% <0.00%> (+0.04%) ⬆️
provider-sru 97.97% <ø> (ø)

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

☔ View full report in Codecov by Sentry.
📢 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.

pieqq added 4 commits January 28, 2026 16:18
checkbox-ng is now a dependency of checkbox_support, so it needs to be
installed before running the tests.
@pieqq pieqq changed the title Move (BugFix) Move some modules from checkbox_support to checkbox_ng (BugFix) Jan 28, 2026
pieqq added 3 commits January 28, 2026 16:58
pyparsing is used by some modules that have migrated from
checkbox_support to checkbox_ng. Therefore, dependencies need updating.
Move pyparsing requirements from checkbox-support to checkbox-ng
@pieqq
Copy link
Collaborator Author

pieqq commented Jan 29, 2026

Regarding the failure of the deb_validation action, I think it's because of the newly added dependency: checkbox-support now depends on checkbox-ng (since the code for the parsers in checkbox-support are now hollow modules that point to checkbox_ng.support).

I've tried the following:

  1. In checkbox-support/debian/rules and checkbox-ng/debian/rules, modify SRCTOP to point to . instead of checkbox-[support|ng].
  2. Go to checkbox-ng and run sudo apt-get -qq -y build-dep .
  3. Run dpkg-buildpackage
  4. It builds two Debian packages: checkbox-ng_2.8_all.deb and python3-checkbox-ng_2.8_all.deb.
  5. Install these so they're available for checkbox-support: sudo dpkg -i checkbox-ng_2.8_all.deb python3-checkbox-ng_2.8_all.deb
  6. Go to checkbox-support and run sudo apt-get -qq -y build-dep .
  7. Run dpkg-buildpackage
  8. It builds python3-checkbox-support_2.8_all.deb running all the unit tests without complaining.

So it seems to work?

@pieqq
Copy link
Collaborator Author

pieqq commented Feb 5, 2026

One way of not having the CI fail would be to land a first PR with only duplicated code in checkbox_ng.support (leaving checkbox_support intact), then, once this lands, redirect the checkbox_support parsers modules to checkbox_ng.support.

What do you think @Hook25 @fernando79513 ?

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