Adds new output format for sites/site-machines.json#146
Conversation
cristinaleonr
left a comment
There was a problem hiding this comment.
Is it possible to add a unit test like we have for the other formats?
Reviewable status: 0 of 1 LGTMs obtained
Pull Request Test Coverage Report for Build 1147
💛 - Coveralls |
nkinkade
left a comment
There was a problem hiding this comment.
@cristinaleonr: It is! And I have. PTAL?
Reviewable status: 0 of 1 LGTMs obtained
cristinaleonr
left a comment
There was a problem hiding this comment.
Great! I believe you forgot to push the "testdata/site-machines.json" test file, though.
Reviewable status: 0 of 1 LGTMs obtained
siteinfo/client_test.go line 274 at r2 (raw file):
} // Test working HTTP client request
Nit: missing period.
nkinkade
left a comment
There was a problem hiding this comment.
Bah! I forgot to add the untracked file. I've added it now, and the build is working. PTAL?
Reviewable status: 0 of 1 LGTMs obtained
siteinfo/client_test.go line 274 at r2 (raw file):
Previously, cristinaleonr (Cristina Leon) wrote…
Nit: missing period.
Period added.
cristinaleonr
left a comment
There was a problem hiding this comment.
Reviewable status:
complete! 1 of 1 LGTMs obtained
siteinfo/client_test.go line 285 at r4 (raw file):
_, err = client.SiteMachines() if err != nil { t.Error("SiteMachines(): expected success, got error.")
This is the one place we don't use Errorf, but it might be useful to add err to the error string.
Also, opposite nit: https://github.com/golang/go/wiki/CodeReviewComments#error-strings
cristinaleonr
left a comment
There was a problem hiding this comment.
Reviewable status:
complete! 1 of 1 LGTMs obtained
siteinfo/client_test.go line 285 at r4 (raw file):
Previously, cristinaleonr (Cristina Leon) wrote…
This is the one place we don't use
Errorf, but it might be useful to adderrto the error string.Also, opposite nit: https://github.com/golang/go/wiki/CodeReviewComments#error-strings
Actually I just saw the nit does not apply to print statements :). Feel free to ignore.
nkinkade
left a comment
There was a problem hiding this comment.
Reviewable status:
complete! 1 of 1 LGTMs obtained
siteinfo/client_test.go line 285 at r4 (raw file):
Previously, cristinaleonr (Cristina Leon) wrote…
Actually I just saw the nit does not apply to print statements :). Feel free to ignore.
This test now uses t.Errorf() and should display the error. Additionally, I noticed that the other uses of t.Errorf() were unnecessary, as none of the statements actually had any formatting strings. I'm surprised that the Go linter in vscode didn't point that out to me. In any case, I have changed those to just use t.Error().
This change is