SDCICD-51: Support arbitrary metrics derived from log data#218
Merged
openshift-merge-robot merged 1 commit intoopenshift:masterfrom Feb 6, 2020
Merged
SDCICD-51: Support arbitrary metrics derived from log data#218openshift-merge-robot merged 1 commit intoopenshift:masterfrom
openshift-merge-robot merged 1 commit intoopenshift:masterfrom
Conversation
mdwn
reviewed
Feb 6, 2020
Contributor
mdwn
left a comment
There was a problem hiding this comment.
One small thing, otherwise LGTM.
Contributor
Author
|
I disagree.
We're already hardcoding the Metadata we expect. On top of that, we're not
actually writing JSON. We're writing a hand-crafted unmarshalled interface{}
Functionally this is here to test whether writeToJSON, which besides
json.Marshal/Unmarshal, has logic to place and write a file correctly.
Therefore we shouldn't validate that json.Marshal/Unmarshal works
correctly, but that the data placed and read is what/where we expect.
Let the json library do its thing, let's just test what we care about:
Where the data is placed and it being what we expect.
…On Thu, Feb 6, 2020 at 3:28 PM Michael Wilson ***@***.***> wrote:
***@***.**** commented on this pull request.
One small thing, otherwise LGTM.
------------------------------
In pkg/metadata/metadata_test.go
<#218 (comment)>:
> @@ -10,11 +10,31 @@ import (
"testing"
)
+// generateExpected marshals/unmarshals a supplied metadata object.
+// Rather than hand-curating our own expected data, this functionally
+// achieves the same test result but it's cleaner.
+func generateExpected(m *Metadata) map[string]interface{} {
The advantage of hard coding the test strings in here is that it forces
the developer to be a little more intentional about the design of the JSON.
With marshalling the JSON programmatically, it won't catch things like
misnamed fields or missed fields.
I think I'd rather have the hard coding here rather than this function.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#218?email_source=notifications&email_token=AAKUO6HXDUY2I4OKKPR4IWDRBRXGPA5CNFSM4KRDA4X2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCUSQVQA#pullrequestreview-354749120>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAKUO6E5MCXHPBPM7T7GLSTRBRXGPANCNFSM4KRDA4XQ>
.
|
Contributor
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jeefy, meowfaceman 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.