Skip to content
This repository has been archived by the owner on Dec 11, 2023. It is now read-only.

Minor improvements #158

Merged
merged 4 commits into from
Oct 30, 2019
Merged

Minor improvements #158

merged 4 commits into from
Oct 30, 2019

Conversation

lrgar
Copy link
Contributor

@lrgar lrgar commented Oct 29, 2019

Some small changes:

  • Use correct token when creating the API Client on NodseController. Unused so it's not a bug, but still for consistency.
  • Move ExtractToken (formerly GetToken) tests to oneagent-utils package.
  • Fix typo in istio_integration_test.go file name.

val, err := ExtractToken(secret, "key")
assert.Error(t, err)
assert.Empty(t, val)
// this case should ideally fail with "missing token X" error
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can add message arg to assert function call. These comments can be moved there, imo.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, the comment would only appear when the check fails which don't think it's the intention here, right? This comment is more of a TODO.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this test is actually useless. Either change the validation logic in ExtractToken to check for empty strings or remove it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll just remove the comment. I personally find an empty string a valid response for non-specific Secret field getter, and the usual receiver, dynatrace_client.NewClient() already validates for empty strings anyway.

Copy link
Contributor

@namratachaudhary namratachaudhary left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please squash the commits into one before merging - as they are all minor changes.

DTMad
DTMad previously approved these changes Oct 30, 2019
@lrgar lrgar merged commit f39f94c into master Oct 30, 2019
@lrgar lrgar deleted the bugfix/codeimprovements branch November 8, 2019 14:02
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants