-
-
Notifications
You must be signed in to change notification settings - Fork 3
test: Add tests for file_header and footer #533
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
Changes from 3 commits
4d82cb4
ec9511b
0d25aeb
ca1e726
253f467
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -7,6 +7,9 @@ commands: | |||||||||||||||||||||||||||||
# Test envOverrides | ||||||||||||||||||||||||||||||
# | ||||||||||||||||||||||||||||||
- script: | | ||||||||||||||||||||||||||||||
kubectl -n $NAMESPACE get cm superset-node-default -o yaml | yq -e '.data."superset_config.py"' | grep "COMMON_HEADER_VAR = "group-value"" | ||||||||||||||||||||||||||||||
kubectl -n $NAMESPACE get cm superset-node-default -o yaml | yq -e '.data."superset_config.py"' | grep "ROLE_FOOTER_VAR = "role-value"" | ||||||||||||||||||||||||||||||
sbernauer marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||
if [ -z "$(kubectl -n $NAMESPACE get cm superset-node-default -o yaml | yq -e '.data."superset_config.py"' | grep "ROLE_HEADER_VAR = \"role-value\"")" ]; then (echo "Success, ROLE_HEADER_VAR not present") else { echo "Failure, ROLE_HEADER_VAR present"; exit 1; } fi | ||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this should be simplified. Will paste an example in a moment. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I actually think the whole if block could be simplified by using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
See: #533 (comment) |
||||||||||||||||||||||||||||||
kubectl -n $NAMESPACE get sts superset-node-default -o yaml | yq -e '.spec.template.spec.containers[] | select (.name == "superset") | .env[] | select (.name == "COMMON_VAR" and .value == "group-value")' | ||||||||||||||||||||||||||||||
kubectl -n $NAMESPACE get sts superset-node-default -o yaml | yq -e '.spec.template.spec.containers[] | select (.name == "superset") | .env[] | select (.name == "GROUP_VAR" and .value == "group-value")' | ||||||||||||||||||||||||||||||
kubectl -n $NAMESPACE get sts superset-node-default -o yaml | yq -e '.spec.template.spec.containers[] | select (.name == "superset") | .env[] | select (.name == "ROLE_VAR" and .value == "role-value")' |
Uh oh!
There was an error while loading. Please reload this page.
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.
Here's my suggestion:
--arg
options).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.
Thank you for the suggestion, it makes sense to me. However, we implemented such stuff here e.g. https://github.com/stackabletech/airflow-operator/pull/490/files and from myself https://github.com/stackabletech/airflow-operator/pull/493/files
As I said I like your suggestion, but fear our tests differ to much from one another and nobody is going to understand it anymore
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 see how it has been done, but to me they are unreadable. I think we should go with the readable option (it lessens the burden on reviewers too).
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.
First off: I don't have a strong opinion, but I would tend to agree with @NickLarsenNZ. I see your concerns @Maleware and I have the same ones (mono-repo would be much easier here), but I personally think readability is more important in this case (especially as @NickLarsenNZ already did the work of rewriting the script)
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.
Granted: ca1e726