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

Making it easy to move from mocks to lambda stubs #125

Open
ziaukhan opened this issue Dec 27, 2021 · 0 comments
Open

Making it easy to move from mocks to lambda stubs #125

ziaukhan opened this issue Dec 27, 2021 · 0 comments
Labels
cli enhancement New feature or request

Comments

@ziaukhan
Copy link
Contributor

ziaukhan commented Dec 27, 2021

We want the API developer to easily config the lambda stubs. Our panacloudconfig.json should look like this:

{
"lambdas": {
"user": { "is_mock": true },
"addUser": { "is_mock": true }
},
"stages": ["prd", "dev"]
}

There are only two states of lambdas either we are using the mock lambdas (custom test data) or stub lambdas (custom business logic) for the real lambdas.

When the is_mock is true we will be using the mock_lambda and mock_lambda_layer. But the mock data will be in a separate directory editable_src/mockData. The types of this mockData will be in a directory testCollectionsTypes in the root, it will be updated by the update cli command. However, editable_src/mockData will not be updated by the cli but the developer will be responsible for maintaining and updating it. This editable_src/mockData will be used to create the mock server on the server-side and test the API on the client-side. When the mock lambdas are being deployed the editable_src/mockData directory will be copied to the mock_lambda_layer.

When the is_mock is false we will be using the editable_src/lambda_stubs and editable_src/lambdaLayers for real lambdas. The editable_src/mockData will not be used on the server-side but only on the client-side to test the APIs.

@ziaukhan ziaukhan added enhancement New feature or request cli labels Dec 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant