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
Conversation
simonpasquier
commented
Jun 21, 2023
- I added CHANGELOG entry for this change.
- No user facing changes, so no entry in CHANGELOG was needed.
/skip |
/hold |
/skip |
test/e2e/telemeter_test.go
Outdated
}, | ||
} | ||
f.MustCreateOrUpdateConfigMap(t, cm) | ||
cmoConfigMap := f.BuildCMOConfigMap(t, "{xxx}") |
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 typo is on purpose to verify that BuildCMOConfigMap() fails if the input isn't valid.
/skip |
test/e2e/telemeter_test.go
Outdated
}, | ||
} | ||
f.MustCreateOrUpdateConfigMap(t, cm) | ||
cmoConfigMap := f.BuildCMOConfigMap(t, "{xxx") |
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.
typo on purpose
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.
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>
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.
/lgtm
Nice addition, @simonpasquier 🙇
/label docs-approved |
[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:
Approvers can indicate their approval by writing |
/hold cancel |
// 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 { |
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 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.
@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. |