[WIP]: Add object naming conflicts e2e test#1995
Conversation
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cathyzhyi The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
5e6dd20 to
4972345
Compare
|
/hold |
| return value | ||
| } | ||
|
|
||
| func CallShellFunctionAndGetStdout(funcName, scriptNameWithPath, projectLocation string, out io.Writer) error { |
There was a problem hiding this comment.
FWIW, this will not run outside knative* repos.
There was a problem hiding this comment.
hmm, after this knative/hack#32 the places that are allowed to use the shell util are narrowed to only upgrade test and knative/hack/shell.
| // If the last word is "configured", there is a naming conflict with the components already installed | ||
| pattern := "configured" | ||
| var prevline string | ||
| if strings.Contains(out.String(), pattern) { |
There was a problem hiding this comment.
To be safe, you can just iterate per line, and check if it ends wth "configured."
There was a problem hiding this comment.
Do you mean it's safer to always check each line rather than do an overall check first?
There was a problem hiding this comment.
Based on the comment, you want to make sure it is the last word. Otherwise you will match sth like: "We configured this as ....".
There was a problem hiding this comment.
Good point! Changed as suggested.
4972345 to
4f0bcc0
Compare
4f0bcc0 to
9b24996
Compare
| pattern := "configured" | ||
| for _, line := range strings.Split(out.String(), "\n") { | ||
| words := strings.Fields(line) | ||
| if len(words) > 0 && strings.Compare(words[len(words)-1], pattern) == 0 { |
|
@cathyzhyi: PR needs rebase. DetailsInstructions 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. |
|
@cathyzhyi: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions 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. |
|
@cathyzhyi please rebase this PR, thanks! |
Fixes #1994
Proposed Changes
Release Note
Docs