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

Allow setting order and hooks for test role #2374

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

Conversation

eshulman2
Copy link
Contributor

@eshulman2 eshulman2 commented Sep 24, 2024

This PR introduces improvements to the test_operator role, enabling ordering of testing stages and hooks for better control over test execution. Key updates include:

Customizable Testing Order:
Introduced the ability to define the testing order for the test_operator role, providing better control over test sequencing.

Repeatable Testing Controller:
Added support for running the same testing controller multiple times within a single test suite.

Stage-Specific Hooks:
Enabled configuration of pre-hooks and post-hooks for each testing stage, offering more granular customization.

Variable Overrides per Stage:
Allowed overriding variables for specific testing stages via either external files (test_vars_file) or specific stage vars (test_vars) parameter.

Refactoring for Enhanced Flexibility
The implementation refactors pre-set testing stage functionality, making test management more adaptable and significantly extending hook behavior when using the CI framework (cifmw). These changes enable the creation of more complex testing workflows, including scenarios requiring multiple and varied hooks or stage-specific configurations.

Impact and Use Cases
These updates allow users to:

  • Design sophisticated test scenarios with stage-specific logic.
  • Reuse controllers efficiently across multiple stages.
  • Seamlessly integrate dynamic hooks and variables for greater flexibility.

Related Issue:
Jira: OSPRH-10106

Copy link
Contributor

openshift-ci bot commented Sep 24, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign cescgina for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link

Thanks for the PR! ❤️
I'm marking it as a draft, once your happy with it merging and the PR is passing CI, click the "Ready for review" button below.

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/e1ceb9f2cf3d47658a3de25c1ed70de8

✔️ openstack-k8s-operators-content-provider SUCCESS in 1h 39m 16s
podified-multinode-edpm-deployment-crc FAILURE in 1h 03m 43s
✔️ cifmw-crc-podified-edpm-baremetal SUCCESS in 1h 23m 33s
cifmw-multinode-tempest FAILURE in 1h 05m 28s
✔️ noop SUCCESS in 0s
✔️ cifmw-pod-ansible-test SUCCESS in 7m 35s
cifmw-pod-pre-commit FAILURE in 7m 04s
✔️ build-push-container-cifmw-client SUCCESS in 30m 49s
✔️ cifmw-molecule-run_hook SUCCESS in 3m 26s
✔️ cifmw-molecule-test_operator SUCCESS in 3m 31s

@eshulman2 eshulman2 force-pushed the test_operator_stages branch 3 times, most recently from f24ddba to c4de17d Compare September 24, 2024 15:17
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/a25d6668f88443eeb5b2e354691eb8dc

✔️ openstack-k8s-operators-content-provider SUCCESS in 1h 39m 51s
podified-multinode-edpm-deployment-crc FAILURE in 1h 02m 18s
cifmw-crc-podified-edpm-baremetal RETRY_LIMIT in 22m 04s
cifmw-multinode-tempest FAILURE in 1h 02m 50s
✔️ noop SUCCESS in 0s
✔️ cifmw-pod-ansible-test SUCCESS in 7m 49s
cifmw-pod-pre-commit FAILURE in 8m 22s
✔️ cifmw-pod-zuul-files SUCCESS in 4m 50s
✔️ cifmw-architecture-validate-hci SUCCESS in 4m 00s
✔️ build-push-container-cifmw-client SUCCESS in 31m 24s
✔️ cifmw-molecule-run_hook SUCCESS in 3m 25s
✔️ cifmw-molecule-test_operator SUCCESS in 3m 16s

@eshulman2 eshulman2 force-pushed the test_operator_stages branch 2 times, most recently from c175381 to 5efbd8f Compare September 24, 2024 17:26
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/ea84a8ceb689406f85a63f9e9f8d1718

✔️ openstack-k8s-operators-content-provider SUCCESS in 1h 39m 40s
podified-multinode-edpm-deployment-crc FAILURE in 1h 00m 58s
✔️ cifmw-crc-podified-edpm-baremetal SUCCESS in 1h 27m 32s
cifmw-multinode-tempest FAILURE in 1h 01m 56s
✔️ noop SUCCESS in 0s
✔️ cifmw-pod-ansible-test SUCCESS in 7m 29s
cifmw-pod-pre-commit FAILURE in 6m 57s
✔️ cifmw-pod-zuul-files SUCCESS in 4m 18s
✔️ cifmw-architecture-validate-hci SUCCESS in 4m 47s
✔️ build-push-container-cifmw-client SUCCESS in 20m 55s
✔️ cifmw-molecule-run_hook SUCCESS in 4m 02s
✔️ cifmw-molecule-test_operator SUCCESS in 3m 54s

@eshulman2 eshulman2 force-pushed the test_operator_stages branch 3 times, most recently from 1c61cd8 to 34ffac9 Compare September 25, 2024 08:19
@eshulman2 eshulman2 marked this pull request as ready for review September 25, 2024 08:24
@eshulman2 eshulman2 force-pushed the test_operator_stages branch 2 times, most recently from c00804c to e6b67aa Compare September 25, 2024 08:28
@eshulman2 eshulman2 requested review from lpiwowar, lewisdenny and cjeanner and removed request for lpiwowar and lewisdenny September 25, 2024 09:48
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/243d4e9a524745129e39edc840e9685c

✔️ openstack-k8s-operators-content-provider SUCCESS in 2h 01m 35s
✔️ podified-multinode-edpm-deployment-crc SUCCESS in 1h 22m 51s
cifmw-crc-podified-edpm-baremetal RETRY_LIMIT in 20m 04s
✔️ cifmw-multinode-tempest SUCCESS in 1h 49m 35s
✔️ noop SUCCESS in 0s
✔️ cifmw-pod-ansible-test SUCCESS in 9m 22s
✔️ cifmw-pod-pre-commit SUCCESS in 7m 36s
✔️ cifmw-pod-zuul-files SUCCESS in 5m 08s
✔️ build-push-container-cifmw-client SUCCESS in 21m 15s
✔️ cifmw-molecule-test_operator SUCCESS in 4m 02s

@eshulman2
Copy link
Contributor Author

recheck

@lpiwowar
Copy link
Contributor

Hi 👋 , I think there need to be patches prepared for some other upstream repositories as well:

And it seems that there is missing an update for the hci_ceph_backends.yml:

cifmw_tempest_tempestconf_config:

Copy link
Contributor

@lpiwowar lpiwowar left a comment

Choose a reason for hiding this comment

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

As per my previous comment [1].

[1] #2374 (comment)

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/585f0c06fb1b4f71b39c58dfbfa92426

✔️ openstack-k8s-operators-content-provider SUCCESS in 1h 51m 07s
✔️ podified-multinode-edpm-deployment-crc SUCCESS in 1h 20m 24s
cifmw-crc-podified-edpm-baremetal RETRY_LIMIT in 13m 31s
✔️ cifmw-multinode-tempest SUCCESS in 1h 38m 45s
✔️ noop SUCCESS in 0s
✔️ cifmw-pod-ansible-test SUCCESS in 7m 39s
✔️ cifmw-pod-pre-commit SUCCESS in 7m 37s
✔️ cifmw-pod-zuul-files SUCCESS in 5m 00s
✔️ build-push-container-cifmw-client SUCCESS in 22m 09s
✔️ cifmw-molecule-test_operator SUCCESS in 3m 33s

@lpiwowar
Copy link
Contributor

lpiwowar commented Nov 26, 2024

As of now the core of the PR looks good to me 👍 . The parameters should work as expected (experience from my manual testing session).

I'm testing that the global vars are going to work with the test-operator job here (extra testing on top of what was agreed on). I'm not giving /lgtm or Approved yet because:

  • proper testing needs to be done downstream first and
  • there needs to be a set of PRs merged (upstream + downstream) that prepare the jobs definitions for this PR

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/88a7411e712e48ab877ce57526a53132

openstack-k8s-operators-content-provider FAILURE in 11m 35s
⚠️ podified-multinode-edpm-deployment-crc SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider
⚠️ cifmw-crc-podified-edpm-baremetal SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider
⚠️ podified-multinode-hci-deployment-crc SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider
⚠️ cifmw-multinode-tempest SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider
✔️ noop SUCCESS in 0s
✔️ cifmw-pod-ansible-test SUCCESS in 7m 43s
✔️ cifmw-pod-pre-commit SUCCESS in 7m 14s
✔️ cifmw-pod-zuul-files SUCCESS in 4m 14s
✔️ build-push-container-cifmw-client SUCCESS in 36m 49s
✔️ cifmw-molecule-test_operator SUCCESS in 3m 31s

@pablintino
Copy link
Collaborator

recheck

@eshulman2
Copy link
Contributor Author

Hi 👋 , I think there need to be patches prepared for some other upstream repositories as well:

And it seems that there is missing an update for the hci_ceph_backends.yml:

cifmw_tempest_tempestconf_config:

@lpiwowar created patches for all relevant projects updating the required var names:
openstack-operator: openstack-k8s-operators/openstack-operator#1209
telemetry-operator: openstack-k8s-operators/telemetry-operator#548
heat-operator: openstack-k8s-operators/heat-operator#477
nova-operator: openstack-k8s-operators/nova-operator#900
manila-operator: openstack-k8s-operators/manila-operator#364

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/6a0917a358fb41229665d3f47f6e98ff

✔️ openstack-k8s-operators-content-provider SUCCESS in 2h 23m 57s
✔️ podified-multinode-edpm-deployment-crc SUCCESS in 1h 18m 37s
cifmw-crc-podified-edpm-baremetal RETRY_LIMIT in 28m 30s
✔️ podified-multinode-hci-deployment-crc SUCCESS in 1h 42m 08s
✔️ cifmw-multinode-tempest SUCCESS in 1h 48m 11s
✔️ noop SUCCESS in 0s
✔️ cifmw-pod-ansible-test SUCCESS in 8m 22s
✔️ cifmw-pod-pre-commit SUCCESS in 7m 38s
✔️ cifmw-pod-zuul-files SUCCESS in 4m 24s
✔️ build-push-container-cifmw-client SUCCESS in 36m 44s
✔️ cifmw-molecule-test_operator SUCCESS in 3m 24s

@eshulman2
Copy link
Contributor Author

eshulman2 commented Nov 27, 2024

@lpiwowar @SeanMooney @vyzigold I can offer a compromise. I can probably do something like this in the defaults/main.yaml and mention that the old names are aliases for the new names and should not be used anymore for any new project. this will allow us to keep the same behavior in case a project didn't changed the name of the vars but would also allow us to conform to a naming convention:

cifmw_test_operator_tempest_concurrency: "{{ cifmw_test_operator_concurrency }}"
cifmw_test_operator_tempest_tempestconf_config: "{{ cifmw_tempest_tempestconf_config }}"

CC: @pablintino any thoughts?

@SeanMooney
Copy link
Contributor

@lpiwowar @SeanMooney @vyzigold I can offer a compromise. I can probably do something like this in the defaults/main.yaml and mention that the old names are aliases for the new names and should not be used anymore for any new project. this will allow us to keep the same behavior in case a project didn't changed the name of the vars but would also allow us to conform to a naming convention:

cifmw_test_operator_tempest_concurrency: "{{ cifmw_test_operator_concurrency }}"
cifmw_test_operator_tempest_tempestconf_config: "{{ cifmw_tempest_tempestconf_config }}"

CC: @pablintino any thoughts?

i think that is fine.
I'm not against removing the usage of the old parameter by the way just not in a single pr.

what i would propose is let have the fallback for now, "deprecate" the old value and remove it after FR2 is released.

i.e support both for a short period of time to not break the existing ci jobs, update them to the new value and only delete the old one when that is complete.

if the nova jobs (upstream and downstream) started running with concurrency 8 instead of the overridden values we have in those jobs they would start failing which is why we added the override in the first place. so as long as we do it in three stages (add new parameter, update old uages, remove old parameter) i have objection to the rename

@lpiwowar
Copy link
Contributor

@lpiwowar @SeanMooney @vyzigold I can offer a compromise. I can probably do something like this in the defaults/main.yaml and mention that the old names are aliases for the new names and should not be used anymore for any new project. this will allow us to keep the same behavior in case a project didn't changed the name of the vars but would also allow us to conform to a naming convention:

I think @SeanMooney and @vyzigold have a good point. The proposed solution by @eshulman2 should allow us to transition to the new parameters more smoothly 👍 . Just one small note:

cifmw_test_operator_tempest_concurrency: "{{ cifmw_test_operator_concurrency }}"

will not work IIUC as this change will lead to cifmw_test_operator_tempest_concurrency being string when cifmw_test_operator_concurrency is utilized. We can remove the introduction of the cifmw_test_operator_tempest_concurrency in this PR. And we can deal with it as part of this ticket OSPRH-11952.

Also, cifmw_tempest_tempestconf_config should be marked in the README as deprecated. But that has already been mentioned by Ella.

@pablintino
Copy link
Collaborator

pablintino commented Nov 27, 2024

@lpiwowar @SeanMooney @vyzigold I can offer a compromise. I can probably do something like this in the defaults/main.yaml and mention that the old names are aliases for the new names and should not be used anymore for any new project. this will allow us to keep the same behavior in case a project didn't changed the name of the vars but would also allow us to conform to a naming convention:

cifmw_test_operator_tempest_concurrency: "{{ cifmw_test_operator_concurrency }}"
cifmw_test_operator_tempest_tempestconf_config: "{{ cifmw_tempest_tempestconf_config }}"

CC: @pablintino any thoughts?

I'd be fine with this change as long as we can merge it without touching a single job. That trick in the defaults will do the trick and I'm all good with it.

@eshulman2
Copy link
Contributor Author

@lpiwowar @pablintino updated the patch and related patch with changes in the compromise

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/5ab23c4b7d3f4804b46465355e232cf1

✔️ openstack-k8s-operators-content-provider SUCCESS in 3h 07m 37s
✔️ podified-multinode-edpm-deployment-crc SUCCESS in 1h 18m 38s
✔️ cifmw-crc-podified-edpm-baremetal SUCCESS in 1h 29m 13s
podified-multinode-hci-deployment-crc FAILURE in 2h 34m 32s
✔️ cifmw-multinode-tempest SUCCESS in 1h 39m 46s
✔️ noop SUCCESS in 0s
✔️ cifmw-pod-ansible-test SUCCESS in 7m 20s
✔️ cifmw-pod-pre-commit SUCCESS in 7m 03s
✔️ cifmw-pod-zuul-files SUCCESS in 4m 02s
✔️ build-push-container-cifmw-client SUCCESS in 37m 38s
✔️ cifmw-molecule-test_operator SUCCESS in 3m 12s

@lpiwowar
Copy link
Contributor

@eshulman2 👍 the changes you've made look reasonable. Now it is about the testing.

This commit adds key improvements to the test_operator role:

Support for defining test execution order.
Ability to run the same testing controller multiple times.
Pre-hooks and post-hooks for stage-specific customization.
Per-stage variable overrides via files or test_vars.
Refactored pre-set testing stages to enable more dynamic test
management and extend hook behavior for complex scenarios.

Jira: OSPRH-10106
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants