Closed ifraixedes closed 6 years ago
Wouldn't this create some complication with the testing?
My understanding is that this code being run during test, I'm not sure on how that works with mocked calls. Have already faced such case?
As far as I can understand, this main isn't runnable because it doesn't have required values https://github.com/cycloidio/raws/blob/master/example/main.go#L83L85
I would change it to take those values from env vars
and in the main (Example function when it be converted) skip the execution if those values are empty. The Example functions don't require to have strong assertions so it isn't needed to check anything that's returned by AWS.
If you want, you can always print a message, if the required values are invalid or they produce an error on the calls, to indicate to check the values of such env vars
.
The good thing of having an Example function is that on each test they are executed or at least compiled, ensuring that they don't get out of date when some changes are introduced.
I think that it would be better to become the example an Example function