Skip to content
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

refactor (1/3): simplify controller tests #503

Merged
merged 1 commit into from
May 26, 2021

Conversation

kuritka
Copy link
Collaborator

@kuritka kuritka commented May 24, 2021

  • I'm removing config settings through environment variables in controller_tests.
    Depresolver tests already cover such functionality. Thanks to that I'm simplifying provideSettings function.
    Also, introducing new property will not require setting environment variables
    in two places.

  • In order to rename interfaces (refactor: interface rename #491) I'm regenerating mocks to get new names.

Signed-off-by: kuritka [email protected]

- I'm removing config settings through environment variables in controller_tests.
Such functionality is covered by depresolver tests and thanks to that I'm simplifying
`provideSettings` function. Also introducing new property will not require to set environment variables
in two places.

- In order to rename interfaces (#491) I'm regenerating mocks to get new names.

Signed-off-by: kuritka <[email protected]>
Copy link
Member

@ytsarev ytsarev left a comment

Choose a reason for hiding this comment

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

Does it mean we don't set config through environment variables? How do we test the expected env var name?

@kuritka
Copy link
Collaborator Author

kuritka commented May 25, 2021

@ytsarev yes and no. We resolve env vars in main() func while controller (or better reconciler) accepts ready-made configuration. It still happens in main() func.

The same we did in controller_tests. Set envvars, read them, pass to reconciler, factory, etc. At the end, the test started. From my POV we can pass configuration directly to controller with no envvars manipulation.

Envvars manipulation itself is covered by depresolver tests.

Copy link
Member

@ytsarev ytsarev left a comment

Choose a reason for hiding this comment

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

`Got it, I like the separation

@kuritka kuritka merged commit 1ba9dc6 into master May 26, 2021
@kuritka kuritka deleted the refactor-remove-config-from-controller-tests branch May 26, 2021 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants