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

[common] Update the CR tests to mark one as optional #207

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

elfiesmelfie
Copy link
Collaborator

@elfiesmelfie elfiesmelfie commented Jan 22, 2025

Only include the test_id if the condition_type is defined. Set a default for the condition_type so that the task name is rendered correctly in output plugins.

Copy link

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/a9bc9fa539b643c98135598db3309a2f

✔️ openstack-k8s-operators-content-provider SUCCESS in 2h 08m 33s
functional-tests-on-osp18 FAILURE in 1h 53m 42s
✔️ functional-logging-tests-osp18 SUCCESS in 1h 05m 48s
functional-graphing-tests-osp18 FAILURE in 1h 04m 47s
✔️ functional-metric-verification-tests-osp18 SUCCESS in 1h 14m 30s

Only include the test_id if the condition_type is defined.
Set a default for the condition_type so that the task name is rendered
correctly in output plugins.
@elfiesmelfie elfiesmelfie force-pushed the efoley/cr_tests_mark_one_optional branch from f22b088 to cb1d8e5 Compare January 29, 2025 12:14
@elfiesmelfie
Copy link
Collaborator Author

recheck

condition_type: "{{ item.condition_type if item.condition_type is defined else '' }}"

- name: |
Verify that the {{ item.kind }} {{ item.name }} CR is {{ condition_type }}
Copy link
Contributor

Choose a reason for hiding this comment

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

The name makes less sense to me like this. It's expected for the condition_type to not be defined (to be set to '' by the task above) right? In that case the name will render into just "Verify that the CR is".

The condition type is used to determine where to look in a CR to determine it's in some expected state. A not so practical example could be, that we want to check that the CeilometerReady is True in the Telemetry CR. Now the name would be: "Verify that the telemetry telemetry CR is CeilometerReady".

You could reword it to something like: "Verify that the {{ condition_type }} condition of {{ item.kind }} {{ item.name }} is True"

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is the partial change. #182 Updates the name again to mark it as a test when the status is defined.

The condition type is set above because if it is undefined, the name renders as the literal template string, rather than getting templated out.

I like your suggestion for the update of the name, so I'll update it to make the task clearer.

register: result
changed_when: false
failed_when:
- result.stdout != "True"
when:
- common_cr_ready_test_id is defined
- item.condition_type is defined
Copy link
Contributor

Choose a reason for hiding this comment

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

There are CRs, which don't have status conditions to check, so in that case the cr_test would just check their existence (the top task of this file). What happens with the when removed? I think it just fails in that case right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't have an answer for that. Looking at this here, I think the when should be re-added. I can't remember why it was removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants