Skip to content

Commit

Permalink
Merge branch 'aws-amplify:master' into cli/env-vars-lambda-sample
Browse files Browse the repository at this point in the history
  • Loading branch information
sachscode authored Jul 23, 2021
2 parents 08c71bb + 57eeae5 commit 20181e7
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/amplify-e2e-core/src/categories/lambda-function.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,9 @@ const coreFunction = (
selectTemplate(chain, settings.functionTemplate, runtime);
}
} else {
if (settings.layerOptions && settings.layerOptions.layerAndFunctionExist) {
chain.wait('Select which capability you want to update:').sendCarriageReturn() // lambda function
}
chain.wait('Select the Lambda function you want to update').sendCarriageReturn(); // assumes only one function configured in the project
}

Expand Down Expand Up @@ -358,6 +361,7 @@ export const removeFunction = (cwd: string, funcName: string) =>

export interface LayerOptions {
select?: string[]; // list options to select
layerAndFunctionExist?: boolean; // whether this test involves both a function and a layer
expectedListOptions?: string[]; // the expected list of all layers
versions?: Record<string, { version: number; expectedVersionOptions: number[] }>; // map with keys for each element of select that determines the verison and expected version for each layer
customArns?: string[]; // external ARNs to enter
Expand Down
2 changes: 2 additions & 0 deletions packages/amplify-e2e-tests/src/__tests__/layer-2.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ describe('amplify add lambda layer with changes', () => {
expectedListOptions: [fullLayerName],
versions: { [fullLayerName]: { version: 1, expectedVersionOptions: [1] } },
skipLayerAssignment: true,
layerAndFunctionExist: true,
},
};

Expand All @@ -277,6 +278,7 @@ describe('amplify add lambda layer with changes', () => {
layerName,
projName,
layerOptions: {
layerAndFunctionExist: true,
layerWalkthrough: (chain: ExecutionContext): void => {
chain
.wait('Provide existing layers')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ describe('test lambda layer migration flow introduced in v5.0.0', () => {
layerOptions: {
select: [],
expectedListOptions: [layerName],
layerAndFunctionExist: true,
},
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ describe('amplify function migration', () => {
layerOptions: {
select: [projName + layerName],
expectedListOptions: [projName + layerName],
layerAndFunctionExist: true,
},
name: function1,
testingWithLatestCodebase: true,
Expand Down

0 comments on commit 20181e7

Please sign in to comment.