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

Provider fake load-balancer service implementation #243

Open
timoreimann opened this issue Jul 17, 2019 · 2 comments
Open

Provider fake load-balancer service implementation #243

timoreimann opened this issue Jul 17, 2019 · 2 comments

Comments

@timoreimann
Copy link
Collaborator

timoreimann commented Jul 17, 2019

Similar to our fake tag service, we should also provide a fake load-balancer service. This will make testing much simpler because testers won't need to think about what each API method should return anymore. Instead, it allows to focus on what load-balancer resources the fake should be populated with initially and leave the rest to the implemented logic.

@timoreimann timoreimann changed the title Provider fake load-balancer implementation Provider fake load-balancer service implementation Jul 17, 2019
@cpanato
Copy link
Collaborator

cpanato commented Aug 16, 2020

@timoreimann can I try this one? Anything special I need to know? Thanks

@timoreimann
Copy link
Collaborator Author

timoreimann commented Aug 16, 2020

Heya @cpanato 👋

I'd be more than happy to let you take a stab at this one.

I think the basic idea is spelled out in this issue's description. My tl;dr is that we shouldn't have to spend so much time programming/configuring the LB test doubles, at least not for happy path testing: the fake should implement the logic and mimic how the public LB API behaves as good as possible. Ideally, we'd also want this better fake framework to support stubbing out errors (though an argument could be made that we should better refer to stubs/mocks for that purpose).

I previously worked on this task but never managed to finish it off. The basic fake implementation is there (along with a means to fake out errors, modelled about client-go's fake implementation), with the major chunk of remaining work being to update the tests (and make any changes to the fake along the way as it makes sense).

You can take a look at my https://github.com/digitalocean/digitalocean-cloud-controller-manager/tree/add-lb-fake branch if you like. There's a ton of WIP commits, with the delta itself being fairly small.

I'm always open to considering alternative approaches If you think it makes sense. Happy to discuss here and/or based on a demonstrative PR.

Thanks for the offer to help out, appreciated!

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

No branches or pull requests

2 participants