-
Notifications
You must be signed in to change notification settings - Fork 2
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
env-loader: bug fixes #295
Conversation
Is it possible to write some tests to lock in this behavior? |
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 assuming we add tests
for _, test := range tests { | ||
actualValues, err := getRequestedEnvValues(test.c) | ||
require.NoError(t, err) | ||
require.EqualValues(t, actualValues, test.expectedValues) |
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 think you've got the order backwards here. I'm pretty sure it should be expected values, then actual values.
In Teleport we have a linter enabled that catches a lot of these.
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.
In Teleport we have a linter enabled that catches a lot of these.
Do you happen to know what it is/how it's configured? I setup this to standardize how we lint across the projects in this repo. It'd be great to get this enabled for everything.
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.
We run testifylint
via golangci-lint
: https://github.com/gravitational/teleport/blob/master/.golangci.yml#L252-L264
Fixed the following bugs with the env loader tool:
environments-directory
arg shared an environment variable with theenvironments
arg/
character in them would search individual components instead of the full path (i.e..environments/stage
and.environments/build
instead of.environments/stage/build
)