Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New match feature (new) #1422

Merged
merged 10 commits into from
Aug 20, 2024
Merged

New match feature (new) #1422

merged 10 commits into from
Aug 20, 2024

Conversation

Hook25
Copy link
Collaborator

@Hook25 Hook25 commented Aug 16, 2024

Description

Re-running an entire test plan is very time consuming, sometimes we have to do it to only fix a handful of jobs and this stresses our lab and makes us waste time. One solution on the Checkbox side is to have a new configuration that allows us to run a few specific tests.

Similarly to how exclude= works, we should add a new section to the [test selection] configuration that does the opposite of exclude. Namely: Given a bootstrapped testplan run all tests that match the match or that the matching tests depend on

If this is the dependency graph, where the arrow means: depends on (namely H depends on G)

image

When the following match constraint is applied:

[test selection]
match=
  B
  E

The following jobs will be run:

  • anything in Bootstrap
  • B (direct match)
  • A (B depends on A)
  • E (direct match)
  • D (E depends on D)
  • C (D depends on C)

The following wont be run:

  • F
  • H
  • G

Note: This feature must support creating a submission after running

Resolved issues

Fixes: CHECKBOX-1525

Documentation

Documentation added in the reference section along with other sections. No section was added to the tutorial as I feel this is a more "advanced" topic

Tests

New metabox tests and unit tests added

Copy link

codecov bot commented Aug 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 45.24%. Comparing base (4123afe) to head (cb882e3).
Report is 122 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1422      +/-   ##
==========================================
+ Coverage   45.19%   45.24%   +0.04%     
==========================================
  Files         367      367              
  Lines       39119    39125       +6     
  Branches     6613     6616       +3     
==========================================
+ Hits        17681    17701      +20     
+ Misses      20764    20751      -13     
+ Partials      674      673       -1     
Flag Coverage Δ
checkbox-ng 67.69% <100.00%> (+0.10%) ⬆️
checkbox-support 59.71% <ø> (+0.01%) ⬆️

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.

@Hook25 Hook25 marked this pull request as ready for review August 16, 2024 15:28
@Hook25 Hook25 changed the title New only_include feature (breaking) New only_include feature (new) Aug 19, 2024
@Hook25 Hook25 changed the title New only_include feature (new) New match feature (new) Aug 19, 2024
pieqq
pieqq previously approved these changes Aug 20, 2024
Copy link
Collaborator

@pieqq pieqq left a comment

Choose a reason for hiding this comment

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

Great change that will help us a lot, especially with the re-runs in the lab!

I tested it locally using the following launcher:

[test plan]
unit = com.canonical.certification::sru
forced = yes

[test selection]
match = com.canonical.certification::benchmarks/disk/hdparm-read_name

It launched the SRU test plan, but only selected the stuff in bootstrap and the Disk benchmark test to be run (benchmarks/disk/hdparm-read_name is a template id). I also modified the match section to check that it worked properly with job ids and regexes. All good!

Tiny things here and there (see inline) that you might want to modify, but otherwise this can land.

checkbox-ng/plainbox/impl/secure/qualifiers.py Outdated Show resolved Hide resolved
checkbox-ng/plainbox/impl/secure/qualifiers.py Outdated Show resolved Hide resolved
checkbox-ng/plainbox/impl/session/assistant.py Outdated Show resolved Hide resolved
docs/reference/launcher.rst Outdated Show resolved Hide resolved
docs/reference/launcher.rst Outdated Show resolved Hide resolved
Copy link
Collaborator

@pieqq pieqq left a comment

Choose a reason for hiding this comment

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

Thanks!

@pieqq pieqq merged commit b672f33 into main Aug 20, 2024
47 of 55 checks passed
@pieqq pieqq deleted the only_include_feature branch August 20, 2024 13:29
Hook25 added a commit that referenced this pull request Aug 20, 2024
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.

2 participants