-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into location-place-index-refactor
- Loading branch information
Showing
168 changed files
with
106,164 additions
and
33,302 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
43 changes: 43 additions & 0 deletions
43
packages/@aws-cdk-testing/cli-integ/tests/tool-integrations/amplify.integtest.ts
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { promises as fs } from 'fs'; | ||
import * as path from 'path'; | ||
import { withToolContext } from './with-tool-context'; | ||
import { integTest, ShellHelper, TemporaryDirectoryContext } from '../../lib'; | ||
|
||
const TIMEOUT = 1800_000; | ||
|
||
integTest('amplify integration', withToolContext(async (context) => { | ||
const shell = ShellHelper.fromContext(context); | ||
|
||
await shell.shell(['npm', 'create', '-y', 'amplify@latest']); | ||
await shell.shell(['npx', 'ampx', 'configure', 'telemetry', 'disable']); | ||
|
||
// This will create 'package.json' implicating a certain version of the CDK | ||
await updateCdkDependency(context, context.packages.requestedCliVersion(), context.packages.requestedFrameworkVersion()); | ||
await shell.shell(['npm', 'install']); | ||
|
||
await shell.shell(['npx', 'ampx', 'sandbox', '--once'], { | ||
modEnv: { | ||
AWS_REGION: context.aws.region, | ||
}, | ||
}); | ||
try { | ||
|
||
// Future code goes here, putting the try/finally here already so it doesn't | ||
// get forgotten. | ||
|
||
} finally { | ||
await shell.shell(['npx', 'ampx', 'sandbox', 'delete', '--yes'], { | ||
modEnv: { | ||
AWS_REGION: context.aws.region, | ||
}, | ||
}); | ||
} | ||
}), TIMEOUT); | ||
|
||
async function updateCdkDependency(context: TemporaryDirectoryContext, cliVersion: string, libVersion: string) { | ||
const filename = path.join(context.integTestDir, 'package.json'); | ||
const pj = JSON.parse(await fs.readFile(filename, { encoding: 'utf-8' })); | ||
pj.devDependencies['aws-cdk'] = cliVersion; | ||
pj.devDependencies['aws-cdk-lib'] = libVersion; | ||
await fs.writeFile(filename, JSON.stringify(pj, undefined, 2), { encoding: 'utf-8' }); | ||
} |
14 changes: 14 additions & 0 deletions
14
packages/@aws-cdk-testing/cli-integ/tests/tool-integrations/with-tool-context.ts
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { TestContext } from '../../lib/integ-test'; | ||
import { AwsContext, withAws } from '../../lib/with-aws'; | ||
import { DisableBootstrapContext } from '../../lib/with-cdk-app'; | ||
import { PackageContext, withPackages } from '../../lib/with-packages'; | ||
import { TemporaryDirectoryContext, withTemporaryDirectory } from '../../lib/with-temporary-directory'; | ||
|
||
/** | ||
* The default prerequisites for tests running tool integrations | ||
*/ | ||
export function withToolContext<A extends TestContext>( | ||
block: (context: A & TemporaryDirectoryContext & PackageContext & AwsContext & DisableBootstrapContext | ||
) => Promise<void>) { | ||
return withAws(withTemporaryDirectory(withPackages(block))); | ||
} |
1 change: 1 addition & 0 deletions
1
...ting/framework-integ/test/aws-codebuild/test/integ.github-org-webhook.js.snapshot/cdk.out
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
19 changes: 19 additions & 0 deletions
19
...ebuild/test/integ.github-org-webhook.js.snapshot/codebuild-github-org-webhook.assets.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
181 changes: 181 additions & 0 deletions
181
...uild/test/integ.github-org-webhook.js.snapshot/codebuild-github-org-webhook.template.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,181 @@ | ||
{ | ||
"Resources": { | ||
"MyProjectRole9BBE5233": { | ||
"Type": "AWS::IAM::Role", | ||
"Properties": { | ||
"AssumeRolePolicyDocument": { | ||
"Statement": [ | ||
{ | ||
"Action": "sts:AssumeRole", | ||
"Effect": "Allow", | ||
"Principal": { | ||
"Service": "codebuild.amazonaws.com" | ||
} | ||
} | ||
], | ||
"Version": "2012-10-17" | ||
} | ||
} | ||
}, | ||
"MyProjectRoleDefaultPolicyB19B7C29": { | ||
"Type": "AWS::IAM::Policy", | ||
"Properties": { | ||
"PolicyDocument": { | ||
"Statement": [ | ||
{ | ||
"Action": [ | ||
"logs:CreateLogGroup", | ||
"logs:CreateLogStream", | ||
"logs:PutLogEvents" | ||
], | ||
"Effect": "Allow", | ||
"Resource": [ | ||
{ | ||
"Fn::Join": [ | ||
"", | ||
[ | ||
"arn:", | ||
{ | ||
"Ref": "AWS::Partition" | ||
}, | ||
":logs:", | ||
{ | ||
"Ref": "AWS::Region" | ||
}, | ||
":", | ||
{ | ||
"Ref": "AWS::AccountId" | ||
}, | ||
":log-group:/aws/codebuild/", | ||
{ | ||
"Ref": "MyProject39F7B0AE" | ||
}, | ||
":*" | ||
] | ||
] | ||
}, | ||
{ | ||
"Fn::Join": [ | ||
"", | ||
[ | ||
"arn:", | ||
{ | ||
"Ref": "AWS::Partition" | ||
}, | ||
":logs:", | ||
{ | ||
"Ref": "AWS::Region" | ||
}, | ||
":", | ||
{ | ||
"Ref": "AWS::AccountId" | ||
}, | ||
":log-group:/aws/codebuild/", | ||
{ | ||
"Ref": "MyProject39F7B0AE" | ||
} | ||
] | ||
] | ||
} | ||
] | ||
} | ||
], | ||
"Version": "2012-10-17" | ||
}, | ||
"PolicyName": "MyProjectRoleDefaultPolicyB19B7C29", | ||
"Roles": [ | ||
{ | ||
"Ref": "MyProjectRole9BBE5233" | ||
} | ||
] | ||
} | ||
}, | ||
"MyProject39F7B0AE": { | ||
"Type": "AWS::CodeBuild::Project", | ||
"Properties": { | ||
"Artifacts": { | ||
"Type": "NO_ARTIFACTS" | ||
}, | ||
"Cache": { | ||
"Type": "NO_CACHE" | ||
}, | ||
"EncryptionKey": "alias/aws/s3", | ||
"Environment": { | ||
"ComputeType": "BUILD_GENERAL1_SMALL", | ||
"Image": "aws/codebuild/standard:7.0", | ||
"ImagePullCredentialsType": "CODEBUILD", | ||
"PrivilegedMode": false, | ||
"Type": "LINUX_CONTAINER" | ||
}, | ||
"ServiceRole": { | ||
"Fn::GetAtt": [ | ||
"MyProjectRole9BBE5233", | ||
"Arn" | ||
] | ||
}, | ||
"Source": { | ||
"Location": "CODEBUILD_DEFAULT_WEBHOOK_SOURCE_LOCATION", | ||
"ReportBuildStatus": false, | ||
"Type": "GITHUB" | ||
}, | ||
"Triggers": { | ||
"FilterGroups": [ | ||
[ | ||
{ | ||
"Pattern": "WORKFLOW_JOB_QUEUED", | ||
"Type": "EVENT" | ||
}, | ||
{ | ||
"Pattern": "aws-cdk.*", | ||
"Type": "REPOSITORY_NAME" | ||
}, | ||
{ | ||
"ExcludeMatchedPattern": true, | ||
"Pattern": "aws-cdk-lib", | ||
"Type": "REPOSITORY_NAME" | ||
} | ||
] | ||
], | ||
"ScopeConfiguration": { | ||
"Name": "aws" | ||
}, | ||
"Webhook": true | ||
} | ||
} | ||
} | ||
}, | ||
"Parameters": { | ||
"BootstrapVersion": { | ||
"Type": "AWS::SSM::Parameter::Value<String>", | ||
"Default": "/cdk-bootstrap/hnb659fds/version", | ||
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" | ||
} | ||
}, | ||
"Rules": { | ||
"CheckBootstrapVersion": { | ||
"Assertions": [ | ||
{ | ||
"Assert": { | ||
"Fn::Not": [ | ||
{ | ||
"Fn::Contains": [ | ||
[ | ||
"1", | ||
"2", | ||
"3", | ||
"4", | ||
"5" | ||
], | ||
{ | ||
"Ref": "BootstrapVersion" | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." | ||
} | ||
] | ||
} | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
...ook.js.snapshot/codebuildgithuborgwebhookintegDefaultTestDeployAssertB287C481.assets.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
36 changes: 36 additions & 0 deletions
36
...k.js.snapshot/codebuildgithuborgwebhookintegDefaultTestDeployAssertB287C481.template.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
13 changes: 13 additions & 0 deletions
13
...g/framework-integ/test/aws-codebuild/test/integ.github-org-webhook.js.snapshot/integ.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.