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
Prints generated Dockerfile lines nicely #178
Conversation
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.
This is great! I have one small change, to use an existing test helper, and then it is ready to merge.
pkg/porter/build_test.go
Outdated
@@ -39,6 +40,36 @@ func TestPorter_buildDockerfile(t *testing.T) { | |||
assert.Equal(t, wantlines, gotlines) | |||
} | |||
|
|||
func TestPorter_buildDockerfile_output(t *testing.T) { | |||
buffer := bytes.NewBuffer([]byte{}) |
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 would like to show you a special function that I built into TestPorter that assists with collecting output during a test.
You can remove lines 44 and 46. Then on line 70, change buffer.String
to p.TestConfig.TestContext.GetOutput()
.
The TestPorter struct does the same thing that you did in the test (make a byte buffer) and then exposes it as a string with GetOputput()
.
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.
That makes sense to me! Just updated the branch to reflect those changes.
I'm excited to have you contributing to porter! Please let me know if you are interested in more issues, and I can help you find another. 😀 |
Signed-off-by: Ryan Moran <rmoran@pivotal.io>
@carolynvs thank you for being so welcoming. We're excited to be contributing in this space. |
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 good, thanks! ✨
Resolves #111
/cc @ryanmoran