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

test/e2e: validate CMO and UWM configs #2006

Merged
merged 1 commit into from Jun 26, 2023

Conversation

simonpasquier
Copy link
Contributor

  • I added CHANGELOG entry for this change.
  • No user facing changes, so no entry in CHANGELOG was needed.

@openshift-ci openshift-ci bot requested review from slashpai and sthaha June 21, 2023 14:16
@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 21, 2023
@simonpasquier
Copy link
Contributor Author

/skip

@simonpasquier
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 Jun 21, 2023
@simonpasquier
Copy link
Contributor Author

/skip

},
}
f.MustCreateOrUpdateConfigMap(t, cm)
cmoConfigMap := f.BuildCMOConfigMap(t, "{xxx}")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

the typo is on purpose to verify that BuildCMOConfigMap() fails if the input isn't valid.

@simonpasquier
Copy link
Contributor Author

/skip

@simonpasquier simonpasquier changed the title chore: simplify configMapWithData() test function test/e2e: validate CMO and UWM configs Jun 23, 2023
},
}
f.MustCreateOrUpdateConfigMap(t, cm)
cmoConfigMap := f.BuildCMOConfigMap(t, "{xxx")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

typo on purpose

Copy link
Contributor Author

Choose a reason for hiding this comment

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

which produced the expected result in the test logs:

 === RUN   TestTelemeterRemoteWrite
    telemeter_test.go:31: invalid CMO config yaml: line 1: did not find expected ',' or '}'
--- FAIL: TestTelemeterRemoteWrite (0.00s) 

This commit refactors the e2e tests to ensure that the CMO and UWM
configurations are valid YAML. The goal is to ease test debugging when
the YAML input is invalid (such as tab characters instead of spaces).

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
Copy link
Contributor

@sthaha sthaha left a comment

Choose a reason for hiding this comment

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

/lgtm

Nice addition, @simonpasquier 🙇

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jun 26, 2023
@jan--f
Copy link
Contributor

jan--f commented Jun 26, 2023

/label docs-approved
/label px-approved
/label qe-approved
Adding labels for test refactoring.
/lgtm
Thanks, very nice!

@openshift-ci openshift-ci bot added docs-approved Signifies that Docs has signed off on this PR px-approved Signifies that Product Support has signed off on this PR qe-approved Signifies that QE has signed off on this PR labels Jun 26, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jun 26, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jan--f, simonpasquier, sthaha

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:
  • OWNERS [jan--f,simonpasquier,sthaha]

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

@simonpasquier
Copy link
Contributor Author

/hold cancel

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 26, 2023
// BuildCMOConfigMap returns a ConfigMap holding the provided Cluster
// Monitoring Operator's config.
// If the config isn't valid YAML, the test will fail.
func (f *Framework) BuildCMOConfigMap(t *testing.T, config string) *v1.ConfigMap {
Copy link
Contributor

Choose a reason for hiding this comment

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

I may have missed it, sorry if it was the case, and I know all the test do that as well, but how about a 'dummy'test that just test the creation of a minimum ConfigMap and UserWorkloadConfigMap? Totally a nit,tho.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jun 26, 2023

@simonpasquier: all tests passed!

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/test-infra repository. I understand the commands that are listed here.

@openshift-merge-robot openshift-merge-robot merged commit 899104b into openshift:master Jun 26, 2023
16 checks passed
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. docs-approved Signifies that Docs has signed off on this PR lgtm Indicates that a PR is ready to be merged. px-approved Signifies that Product Support has signed off on this PR qe-approved Signifies that QE has signed off on this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants