-
Notifications
You must be signed in to change notification settings - Fork 142
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
Add integration test coverage for adding an app in a GitLab repo #1101
Conversation
e2ca5bd
to
4d7c523
Compare
e3bef64
to
74178ee
Compare
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 just some thoughts
@@ -58,7 +58,7 @@ func CreateRepo(ctx context.Context, gp gitprovider.Client, url string) (gitprov | |||
return nil, nil, fmt.Errorf("could not reconcile org repo: %w", err) | |||
} | |||
|
|||
err = utils.WaitUntil(os.Stdout, 3*time.Second, 9*time.Second, func() error { | |||
err = utils.WaitUntil(bytes.NewBuffer([]byte{}), 3*time.Second, 9*time.Second, func() error { |
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'm curious on why came back to this. Last time, we agreed to print to stdout to have better debug logs. Any change of mind?
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.
Ah yes I should have called this out.
Logging to stdout
during the retry loop populates the output with unnecessary information. We expect the retry to fire a couple of times, so we don't need to tell the user about it.
It ensures that we only log things when they have gone wrong. If the WaitUntil
function hides important output or doesn't return an error at the right time, there is a bug with WaitUntil
.
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, are you suggesting printing out all errors only if the last attempt fails?
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, are you suggesting printing out all errors only if the last attempt fails?
I am suggesting only printing the error if waitUntil
returns one.
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.
looks great, just a minor nit
37134d9
to
784456c
Compare
Adds some much needed test coverage for GitLab. Only covers the Merge Request case (not auto-merge).
These tests have reached a tipping point IMO and need to be refactored into a table-style test to reduce some of the repetition. I will handle that in another PR, as getting the coverage is more important than making them DRY.