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

Some status of cases are still be non-blocker even apply blocker to .* to test plan #1492

Open
baconYao opened this issue Sep 20, 2024 · 6 comments · Fixed by #1552
Open
Labels
bug Something isn't working

Comments

@baconYao
Copy link
Contributor

baconYao commented Sep 20, 2024

Bug Description

In PR#1206 Certification team made every test job in client-cert-iot-.* test plans as cert blocker according to a decision made a few years ago which we have been using to judge the bug importance since then (All checkbox jobs being executed for the IoT project is a cert blocker)

Therefore, QA team started implementing this rule in each project. However, we observed that the status is still be non-blocker of some cases who are from base provider.

Here is the simple PR to implement this feature. What I did is like below (nest the cert test plan and have certification_status_overrides field be defined):

bootstrap_include:
    baoshan_device_soc
include:
nested_part:
    .
    .
    com.canonical.certification::client-cert-desktop-22-04-automated
    .
    .
certification_status_overrides:
    apply blocker to .*
exclude:
    .
    .
    .

To Reproduce

  1. Have a test plan that nests the com.canonical.certification::client-cert-desktop-22-04-automated
  2. Add certification_status_overrides field
  3. Sideload this test plan
  4. Checkbox remote runs this auto plan and choose the miscellaneous and info sets then executing it.

Environment

  • OS: Classic Desktop / Server / Ubuntu Core
  • Checkbox type: Snap

Relevant log output

No response

Additional context

No response

@baconYao baconYao added the bug Something isn't working label Sep 20, 2024
Copy link

Thank you for reporting us your feedback!

The internal ticket has been created: https://warthogs.atlassian.net/browse/CHECKBOX-1577.

This message was autogenerated

@pieqq
Copy link
Collaborator

pieqq commented Oct 17, 2024

If everything is in the same namespace, the issue does not happen.

However, if the override is applied to a test plan in one of the provider (with one namespace), and that test plan is then nested in another provider (with another namespace), the override is not applied.

→ Issue confirmed.

@pieqq
Copy link
Collaborator

pieqq commented Oct 17, 2024

A workaround for you:

use

certification_status_overrides:
    apply blocker to .*::.*

instead of

certification_status_overrides:
    apply blocker to .*

The issue lies in the testplan unit where Checkbox adds the namespace to everything that does not have a namespace.

@baconYao
Copy link
Contributor Author

Hi @pieqq
I've tried the method you provided but still has non-blocker cases.

certification_status_overrides:
    apply blocker to .*::.*

The Submission-A use apply blocker to .*::.*

The Submission-B use apply blocker to .*

Compare Submission-A and Submission-B, we can find the miscellanea/submission-resources case has been blocker but info/systemd-analyze and info/systemd-analyze-critical-chain cases are still non-blocker

@baconYao baconYao reopened this Nov 14, 2024
@pieqq
Copy link
Collaborator

pieqq commented Dec 21, 2024

I think I found the culprit:

return sorted(
(key, field_value_list)
for key, field_value_list in override_map.items()
)

For some reason, the list of override_map items is returned sorted. This is why the non-blocker status you see is still returned, even though it should be overridden by the certification_status_overrides section of the test plan.

By removing the sorted function, I get what you expect, so this seems to be the solution. However, I need to investigate why this list is returned sorted, and I need to write more tests to make sure I'm not breaking something else, somewhere else :)

@pieqq
Copy link
Collaborator

pieqq commented Jan 8, 2025

I spent quite some time on this yesterday and I cannot reproduce the issue anymore...

If I use the following override in the genio-baoshan-core-22-automated test plan:

certification_status_overrides:
    apply blocker to .*::.*

and run

checkbox-cli expand "com.canonical.qa.baoshan::genio-baoshan-core-22-automated" --format json | jq > /var/tmp/baoshan.json

All the jobs in the list have the certification_status set to blocker, as expected.

I've also tried with a very small and dumb test plan, namely:

id: my-testplan-override
_name: my testplan override
unit: test plan
include:
  com.canonical.certification::info/systemd-analyze certification_status=non-blocker
certification_status_overrides:
  apply blocker to .*::.*

and when I use the expand command as above, the job is, indeed, set to blocker as expected, even though it has a non-blocker inline override.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants