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

Take inline overrides into account in mandatory_include and bootstrap_include sections of a test plan (BugFix) #1079

Merged
merged 3 commits into from
Mar 19, 2024

Conversation

pieqq
Copy link
Collaborator

@pieqq pieqq commented Mar 18, 2024

Description

Although inline overrides were taking into account in the include section of a test plan, it was not the case for the mandatory_include and bootstrap_include sections.

So a test plan like this:

unit: test plan
id: test-plan
name: My test plan
bootstrap_include:
    bootstrap-cert-blocker-job  certification_status=blocker
mandatory_include:
    mandatory-cert-blocker-job  certification_status=blocker
include:
    regular-cert-blocker-job    certification_status=blocker

would only make "regular-cert-blocker-job" a cert-blocker, not "mandatory-cert-blocker-job".

Resolved issues

Tests

Tested by running a test plan similar as the one described above and making sure the HTML report includes the job in mandatory_include and bootstrap_include sections as a cert-blocker.

…test plan

Although inline overrides were taking into account in the `include`
section of a test plan, it was not the case for the `mandatory_include`
section.

So a test plan like this:

unit: test plan
id: test-plan
name: My test plan
mandatory_include:
    mandatory-cert-blocker-job  certification_status=blocker
include:
    regular-cert-blocker-job    certification_status=blocker

would only make "regular-cert-blocker-job" a cert-blocker, not
"mandatory-cert-blocker-job".
Copy link

codecov bot commented Mar 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 40.99%. Comparing base (44498aa) to head (ea88ac6).
Report is 10 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1079      +/-   ##
==========================================
+ Coverage   40.92%   40.99%   +0.07%     
==========================================
  Files         337      337              
  Lines       37548    37552       +4     
  Branches     6384     6385       +1     
==========================================
+ Hits        15366    15396      +30     
+ Misses      21543    21517      -26     
  Partials      639      639              
Flag Coverage Δ
checkbox-ng 67.14% <100.00%> (+0.18%) ⬆️

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.

Copy link
Collaborator

@Hook25 Hook25 left a comment

Choose a reason for hiding this comment

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

Small comment below

checkbox-ng/plainbox/impl/unit/testplan.py Outdated Show resolved Hide resolved
- Move the V class one level above, so it can be used for the different
include sections of the test plan.
- Fix issue found by Max (`mandatory_include` was parsed only if there
was an `include` section)
- Add support for `bootstrap_include` for good measure
@pieqq pieqq changed the title Take inline overrides into account in mandatory_include section of a test plan (BugFix) Take inline overrides into account in mandatory_include and bootstrap_include sections of a test plan (BugFix) Mar 19, 2024
Copy link
Collaborator

@Hook25 Hook25 left a comment

Choose a reason for hiding this comment

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

+1, ty

@Hook25 Hook25 merged commit b5317f4 into main Mar 19, 2024
24 checks passed
@Hook25 Hook25 deleted the testplan-override-mandatory-include branch March 19, 2024 11:45
binli pushed a commit to binli/checkbox that referenced this pull request Mar 22, 2024
…_include sections of a test plan (BugFix) (canonical#1079)

* Take inline overrides into account in mandatory_include section of a test plan

Although inline overrides were taking into account in the `include`
section of a test plan, it was not the case for the `mandatory_include`
section.

So a test plan like this:

unit: test plan
id: test-plan
name: My test plan
mandatory_include:
    mandatory-cert-blocker-job  certification_status=blocker
include:
    regular-cert-blocker-job    certification_status=blocker

would only make "regular-cert-blocker-job" a cert-blocker, not
"mandatory-cert-blocker-job".

* Add support for bootstrap_include section

- Move the V class one level above, so it can be used for the different
include sections of the test plan.
- Fix issue found by Max (`mandatory_include` was parsed only if there
was an `include` section)
- Add support for `bootstrap_include` for good measure

* Add unit test to check bootstrap_include inline overrides
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