Skip to content

Commit

Permalink
fix: improve localstack test performance (#184)
Browse files Browse the repository at this point in the history
  • Loading branch information
thantos committed Jun 2, 2022
1 parent 82c72d3 commit a421632
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions test/localstack.ts
Expand Up @@ -20,6 +20,8 @@ export const clientConfig = {

const CF = new CloudFormation(clientConfig);

// Inspiration for the current approach: https://github.com/aws/aws-cdk/pull/18667#issuecomment-1075348390
// Writeup on performance improvements: https://github.com/functionless/functionless/pull/184#issuecomment-1144767427
export const deployStack = async (app: App, stack: Stack) => {
const cloudAssembly = await asyncSynth(app);

Expand All @@ -42,15 +44,10 @@ export const deployStack = async (app: App, stack: Stack) => {
sdkProvider,
});

const assembly = new cxapi.CloudAssembly(cloudAssembly.directory);
const stackArtifact = cxapi.CloudFormationStackArtifact.fromManifest(
assembly,
stack.artifactId,
cloudAssembly.getStackArtifact(stack.artifactId).manifest
) as cxapi.CloudFormationStackArtifact;

await cfn.deployStack({
stack: stackArtifact,
stack: cloudAssembly.getStackArtifact(
stack.artifactId
) as unknown as cxapi.CloudFormationStackArtifact,
force: true,
});
};
Expand Down

0 comments on commit a421632

Please sign in to comment.