Open
Conversation
ritesh-cs
reviewed
Mar 20, 2023
callmekatootie
requested changes
Mar 20, 2023
callmekatootie
requested changes
Mar 20, 2023
tests/index.js
Outdated
| should.exist(found) | ||
| found.value.should.equal(getSharedConfigParams[i].value) | ||
| } | ||
| }) |
Contributor
There was a problem hiding this comment.
Test is same as the one before - to test if cached value returned, you would need to first retrieve the values, then update them - and then retrieve them again to verify that you are NOT getting the updated value... thus proving that it is indeed read from cache.
However, you don't have to write such a test right now. So you can remove this one.
callmekatootie
approved these changes
Mar 21, 2023
Contributor
|
Great work on this btw! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https://github.com/opentorc/torc-serverless/issues/557
This PR is a POC for storing config parameters in Config table - related PR https://github.com/opentorc/platform-api/pull/1133 - added two methods to the cli to be able to test it.
Create Config table mentioned in the related PR
1.a Creat SSM variable
DYNAMODB_CONFIG_TABLEundercommonpathinstall
config-wrapperpackage locallynpm i path../.../config-wrappercreate
sharedConfig.jsoneg
{ "DYNAMODB_USER_TABLE_STREAM": { "value": "TABLE_NAME" }, "ASSESSMENT_CONFIG": { "value": { "testId": 123459, "valir": false } }, "ARRAY_CONFIG" : { "value": [{ "testValue" : 5 }] } }with the cli create service parameters
config-wrapper putSharedConfigFromFile --infile sharedConfig.json --env develop --service resolverswith the cli get service parameters
config-wrapper getSharedConfigByService --env develop --service resolvers—-
NOTE: When
configWrapper.awsManager.getSharedConfigByService()method is called in a lambda function. Lambda function should havedynamodb:Querypermission for the Config_Table including Config_Table/index/*