-
Notifications
You must be signed in to change notification settings - Fork 154
Maintenance: add comments to SecretsProvider
integration tests
#1279
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
Comments
I can take this one, since I worked on the PR before. |
While at it, please also update the imports of the import {
SecretsProvider,
} from '../../src/secrets';
import { SecretsGetOptionsInterface } from '../../src/types'; Currently they are pointing to the built/compiled version instead of the source. And in tests 6 & 7, review the |
Also, test number 7 we have: await providerWithMiddleware.get(secretNamePlainChached);
await providerWithMiddleware.get(secretNamePlainChached, { forceFetch: true }); The counter here should be 2 (fetched twice because of using it('should retrieve single parameter twice without caching', async () => {
const logs = invocationLogs[0].getFunctionLogs();
const testLogFirst = InvocationLogs.parseFunctionLog(logs[6]);
expect(testLogFirst).toStrictEqual({
test: 'get-plain-force',
value: 1 // This should be 2
});
}); This is happening because we are fetching the same parameter from test 6, so the first time we fetch in test 7 we are still hitting cache, while in the second one we are actually finally fetching. To fix this we have a few options:
Apologies for not spotting these things during my review, I should have done better and I will try to in future ones. |
No worries, I also missed this part completely. Adding |
|
Summary
In #1263 we have added integration tests for
SecretsProvider
, part of the upcoming Parameters utility.We should dedicate some additional cycles to add comments/documentation to the tests to make them future proof and clearer.
Why is this needed?
To allow future maintainers and potential prospect contributors to more easily understand what's going on in the tests, as well as troubleshoot issues.
Which area does this relate to?
Tests, Parameters
Solution
See example of comments in the
DynamoDBProvider
here.Acknowledgment
The text was updated successfully, but these errors were encountered: