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

fix: More YAML templates for E2E virt tests #1364

Conversation

mateusoliveira43
Copy link
Contributor

@mateusoliveira43 mateusoliveira43 commented Mar 17, 2024

Why the changes were made

Follow up for #1359 to add more YAML templates.

Blocked by #1386

How the changes were made

Studied code to find and remove "YAML literals" from it. Added feature to replace strings in code in templates.

How to test the changes made

If you have 4.14+ cluster, you can run E2E virt tests locally with make TEST_VIRT=true test-e2e

Check logs, they should not be less informative and readable as they were before this change.

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 17, 2024
Copy link
Contributor

@mrnold mrnold left a comment

Choose a reason for hiding this comment

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

I like having this code simplified into YAML templates, but I know @weshayutin is really in favor of having plain YAML files. I am wondering if a good compromise is to move the infrastructure-related templates (the HCO installation, KVM emulation, and maybe a new one for the latest CirrOS image fetching) out of sample-applications into a separate directory under tests/e2e, and renamed to something like *.yaml.template. Then the actual VMs themselves can be plain .yaml files under sample-applications like they are now, with no templating.

Otherwise, @mpryc had an interesting idea about parsing the sample YAML into actual CRD structs and replacing the relevant fields That way, there could be fixed YAML files in the current directory, and each test could decide to override any fields as needed. Maybe with a command line argument or environment variable to enable or disable this replacement, to force the test to respect any manually-added YAML changes.

Do either of these ideas sound useful?

@weshayutin
Copy link
Contributor

I would say the following.. How the templates are constructed is NOT a big deal to me unless the templates are used in documentation in oadp-operator/docs. I am happy with working templates and we shouldn't bike shed too much about it.

YAML templates are fine, we should have a little shell script that can populate and render the templates. Breaking out files into directories that make more sense is also fine.

Re the sample apps in our tests/e2e

  1. should be good enough for our CI
  2. a user should be able to manually use the sample apps with simple instructions
  3. At the first pass of this work does NOT need to be perfect for all users. We'll get there

template, err := os.ReadFile(file)
if err != nil {
return err
}
obj := &unstructured.UnstructuredList{}

// YAML templates can have replace directives, in the form of "<<template-replace-N>>", where N
Copy link
Member

Choose a reason for hiding this comment

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

Is this oadp specific directive or we're following some published standard?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

just from my head 🤣

tried to think what would be good in the future using this

I accept suggestions

@mateusoliveira43
Copy link
Contributor Author

@mrnold did not understand how would be @mpryc idea

we can document yes @weshayutin . This can be very useful for me in the future. Today (in IBM) I need to manually edit all snapclasses (because I do not use ceph), for example. This could be automated with templates (and not change how other people run make test-e2e

But seems we have some discussion, so we can focus on working here after 1.3.1 (unless @mrnold wants anything from here now)

Copy link
Contributor

@mrnold mrnold left a comment

Choose a reason for hiding this comment

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

This is fine with me as-is, then.

Copy link

openshift-ci bot commented Mar 21, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mateusoliveira43, mrnold

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

The pull request process is described 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

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 10, 2024
@openshift-merge-robot
Copy link

PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@weshayutin
Copy link
Contributor

/retest

@mateusoliveira43
Copy link
Contributor Author

/hold

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 12, 2024
Copy link

openshift-ci bot commented Jun 19, 2024

@mateusoliveira43: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/4.13-e2e-test-aws df955c5 link true /test 4.13-e2e-test-aws
ci/prow/4.16-e2e-test-aws df955c5 link true /test 4.16-e2e-test-aws
ci/prow/4.16-e2e-test-kubevirt-aws df955c5 link true /test 4.16-e2e-test-kubevirt-aws
ci/prow/4.15-ci-index df955c5 link true /test 4.15-ci-index
ci/prow/4.15-e2e-test-kubevirt-aws df955c5 link true /test 4.15-e2e-test-kubevirt-aws
ci/prow/4.16-images df955c5 link true /test 4.16-images
ci/prow/4.15-e2e-test-aws df955c5 link true /test 4.15-e2e-test-aws
ci/prow/4.15-images df955c5 link true /test 4.15-images
ci/prow/4.16-ci-index df955c5 link true /test 4.16-ci-index

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@openshift-bot
Copy link

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@openshift-ci openshift-ci bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Sep 18, 2024
@weshayutin
Copy link
Contributor

@mateusoliveira43 thank you for putting up this change, it fell off my radar tbh. I have strong opinions about this that should be tempered by a group discussion. I'll raise it in thrs scrum for discussion. I'd like Matthew to review in depth but he is focused on dataupload/datadown changes, this will have to wait a bit.

@mateusoliveira43
Copy link
Contributor Author

Created issue to discuss solution #1531

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. CI do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants