-
Notifications
You must be signed in to change notification settings - Fork 8
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
base: master
Are you sure you want to change the base?
Conversation
Build failed (check pipeline). Post https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/a9bc9fa539b643c98135598db3309a2f ✔️ openstack-k8s-operators-content-provider SUCCESS in 2h 08m 33s |
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.
f22b088
to
cb1d8e5
Compare
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 }} |
There was a problem hiding this comment.
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"
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
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.