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

Sandbox e2e test #206

Merged
merged 35 commits into from
Sep 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
c92c58e
fixup
edwardfoyle Sep 1, 2023
8e7a1e7
e2e working
edwardfoyle Sep 2, 2023
331ccea
remove unnecessary promise
edwardfoyle Sep 5, 2023
fe1c2f7
make process controller more ergonomic
edwardfoyle Sep 5, 2023
7fea057
fix pathing
edwardfoyle Sep 5, 2023
b54443e
refactor macros
edwardfoyle Sep 5, 2023
ca0f257
fix build
edwardfoyle Sep 5, 2023
db007f8
Merge remote-tracking branch 'origin/main' into e2e-tests
edwardfoyle Sep 5, 2023
09be50e
update e2e runner
edwardfoyle Sep 5, 2023
b2c7ba1
add debugging config
edwardfoyle Sep 5, 2023
8a6b31b
update debug config
edwardfoyle Sep 5, 2023
980703c
update setup
edwardfoyle Sep 5, 2023
8bad67d
add debug config
edwardfoyle Sep 5, 2023
5b9eaf5
try this
edwardfoyle Sep 5, 2023
5e323fb
add randomness to project names
edwardfoyle Sep 5, 2023
8566546
update workflow deps
edwardfoyle Sep 5, 2023
e511c74
fix indexing
edwardfoyle Sep 5, 2023
a0c24a6
fix types
edwardfoyle Sep 5, 2023
75ea586
revert package json change
edwardfoyle Sep 5, 2023
6b9dae0
remove debug config
edwardfoyle Sep 5, 2023
12f66d0
Merge remote-tracking branch 'origin/main' into e2e-tests
edwardfoyle Sep 6, 2023
5dc0262
update test glob patterns
edwardfoyle Sep 6, 2023
f2de8fa
remove e2e prefix
edwardfoyle Sep 6, 2023
0852f6c
update gitignore
edwardfoyle Sep 6, 2023
0e5173b
refactor creating test dir
edwardfoyle Sep 6, 2023
3f0d9eb
renaming things
edwardfoyle Sep 6, 2023
1423594
update comment
edwardfoyle Sep 6, 2023
0855fa1
fix path
edwardfoyle Sep 6, 2023
ede58fd
ignore integration-test package in coverage analysis
edwardfoyle Sep 6, 2023
d996c8e
update parcel watcher
edwardfoyle Sep 6, 2023
c6c5fe6
regenerate package lock
edwardfoyle Sep 6, 2023
3cc7d7d
fix queue shifting
edwardfoyle Sep 6, 2023
a90e954
revert some auto renaming
edwardfoyle Sep 6, 2023
b7e5fd6
rename ControllerAction => StdioInteraction and related names
edwardfoyle Sep 7, 2023
9718ab6
add empty changeset
edwardfoyle Sep 7, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .c8rc.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"scripts",
"templates",
"**/*.test.ts",
"packages/plugin-types"
"packages/plugin-types",
"packages/integration-tests"
],
"all": true,
"check-coverage": true,
Expand Down
2 changes: 2 additions & 0 deletions .changeset/happy-ants-repair.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
1 change: 1 addition & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@
"passthrough",
"pathname",
"readdir",
"readline",
"readonly",
"repo",
"resolvers",
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/health_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ jobs:
run_e2e_tests:
runs-on: ubuntu-latest
needs:
- build
- do_include_e2e
permissions:
# these permissions are required for the configure-aws-credentials action to get a JWT from GitHub
Expand All @@ -70,14 +69,17 @@ jobs:
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # version 3.6.0
- uses: ./.github/actions/setup_node
- uses: ./.github/actions/restore_build_cache
# we have to build and install in this job rather than restore from cache because the
# symlinks in the node_modules folder are broken if we just restore the build from the cache
Comment on lines +72 to +73
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we know why?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because restoring from cache is a different file. So even though it's restoring a symlink, the link is now broken

- name: Install and build
run: npm run install:local
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@04b98b3f9e85f563fb061be8751a0352327246b0 # version 3.0.1
with:
role-to-assume: ${{ secrets.E2E_RUNNER_ROLE_ARN }}
aws-region: us-west-2
- name: Verify credentials
run: aws sts get-caller-identity
- name: Run E2E tests
run: npm run e2e
lint:
runs-on: ubuntu-latest
needs:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ tsconfig.tsbuildinfo
verdaccio-cache
verdaccio-logs.txt
cdk.out/
e2e-tests
678 changes: 390 additions & 288 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"clean:npm-proxy": "npm run stop:npm-proxy && rimraf verdaccio-cache verdaccio-logs.txt",
"diff:check": "tsx scripts/check_pr_size.ts",
"docs": "typedoc",
"e2e": "tsx --test --test-reporter spec packages/integration-tests/lib/test-e2e",
"install:local": "npm install && npm run build && npm run install:local --workspaces --if-present",
"lint": "eslint --max-warnings 0 . && prettier --check .",
"lint:fix": "eslint --cache --fix . && prettier --write .",
Expand All @@ -21,7 +22,7 @@
"publish:local": "tsx scripts/publish_local.ts",
"start:npm-proxy": "tsx scripts/start_npm_proxy.ts",
"stop:npm-proxy": "tsx scripts/stop_npm_proxy.ts",
"test": "tsx --test --test-reporter spec",
"test": "tsx --test --test-reporter spec $(glob packages/* | grep -v integration-tests) packages/integration-tests/lib/test-in-memory",
"test:coverage:generate": "NODE_V8_COVERAGE=coverage/ npm run test",
"test:coverage:threshold": "c8 npm run test",
"update:api": "npm run update:api --workspaces",
Expand Down
2 changes: 1 addition & 1 deletion packages/backend-graphql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@
},
"dependencies": {
"@aws-amplify/backend-output-schemas": "^0.1.1-alpha.0",
"@aws-amplify/graphql-construct-alpha": "^0.5.0"
"@aws-amplify/graphql-construct-alpha": "^0.6.1"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('InitialProjectFileGenerator', () => {
{ recursive: true },
]);
assert.deepStrictEqual(fsMock.cp.mock.calls[0].arguments, [
new URL('../templates/basic-auth-data', import.meta.url),
new URL('../templates/basic-auth-data/amplify', import.meta.url),
'/testProjectRoot/amplify',
{ recursive: true },
]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,8 @@ export class InitialProjectFileGenerator {
generateInitialProjectFiles = async (): Promise<void> => {
const targetDir = path.resolve(this.projectRoot, 'amplify');
await this.fs.mkdir(targetDir, { recursive: true });
/*
Note: Although the source code template directory contains expected-cdk-out test assets,
these assets are not published to npm and thus not copied when this code runs in production
*/
await this.fs.cp(
new URL('../templates/basic-auth-data', import.meta.url),
new URL('../templates/basic-auth-data/amplify', import.meta.url),
targetDir,
{ recursive: true }
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,45 @@
}
}
},
"e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642": {
"source": {
"path": "asset.e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip",
"packaging": "file"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "e2277687077a2abf9ae1af1cc9565e6715e2ebb62f79ec53aa75a1af9298f642.zip",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
},
"9eb41a5505d37607ac419321497a4f8c21cf0ee1f9b4a6b29aa04301aea5c7fd": {
"source": {
"path": "asset.9eb41a5505d37607ac419321497a4f8c21cf0ee1f9b4a6b29aa04301aea5c7fd",
"packaging": "zip"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "9eb41a5505d37607ac419321497a4f8c21cf0ee1f9b4a6b29aa04301aea5c7fd.zip",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
},
"ebcebf048afca40fc46da2b2a56e4c0bac61ce9168b91d78fe4ab3e358eb8a7c": {
"source": {
"path": "asset.ebcebf048afca40fc46da2b2a56e4c0bac61ce9168b91d78fe4ab3e358eb8a7c",
"packaging": "zip"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "ebcebf048afca40fc46da2b2a56e4c0bac61ce9168b91d78fe4ab3e358eb8a7c.zip",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
},
"7e502ba5303800830c46c6acd7cc27c4f49bfc8330e0c512159fd4f09db5ea4a": {
"source": {
"path": "asset.7e502ba5303800830c46c6acd7cc27c4f49bfc8330e0c512159fd4f09db5ea4a.graphql",
Expand Down Expand Up @@ -287,28 +326,28 @@
}
}
},
"d0b4f4d046ae1f182e7cb26c942ae4a7b1990b640110fa6eabb4c72e4f4d640b": {
"d30f87e63d0607c552c9561779fdd489870341f9da9aadcf3fabef85aaf96570": {
"source": {
"path": "amplifytestAppIdtestBranchNamedata9EF5D4B6.nested.template.json",
"packaging": "file"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "d0b4f4d046ae1f182e7cb26c942ae4a7b1990b640110fa6eabb4c72e4f4d640b.json",
"objectKey": "d30f87e63d0607c552c9561779fdd489870341f9da9aadcf3fabef85aaf96570.json",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
},
"f6fe9e9ae1d10aff22ef8dfc789f72df78ee12f6847ae489c1f61adab1b646d9": {
"386b1529eac923548efaf02ac1c71494f9d83b04d8706fb6382a8b4b3525bcea": {
"source": {
"path": "amplify-testAppId-testBranchName.template.json",
"packaging": "file"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "f6fe9e9ae1d10aff22ef8dfc789f72df78ee12f6847ae489c1f61adab1b646d9.json",
"objectKey": "386b1529eac923548efaf02ac1c71494f9d83b04d8706fb6382a8b4b3525bcea.json",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@
"graphqlOutput": {
"version": "1",
"stackOutputs": [
"awsAppsyncApiId",
"awsAppsyncApiEndpoint",
"awsAppsyncAuthenticationType",
"awsAppsyncRegion"
"awsAppsyncRegion",
"amplifyApiModelSchemaS3Uri"
]
}
}
Expand Down Expand Up @@ -66,7 +68,7 @@
{
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
},
"/d0b4f4d046ae1f182e7cb26c942ae4a7b1990b640110fa6eabb4c72e4f4d640b.json"
"/d30f87e63d0607c552c9561779fdd489870341f9da9aadcf3fabef85aaf96570.json"
]
]
},
Expand Down Expand Up @@ -117,6 +119,14 @@
"Ref": "AWS::Region"
}
},
"awsAppsyncApiId": {
"Value": {
"Fn::GetAtt": [
"data7552DF31",
"Outputs.amplifytestAppIdtestBranchNamedataamplifyDataGraphQLAPI93E95D03ApiId"
]
}
},
"awsAppsyncApiEndpoint": {
"Value": {
"Fn::GetAtt": [
Expand All @@ -132,6 +142,23 @@
"Value": {
"Ref": "AWS::Region"
}
},
"amplifyApiModelSchemaS3Uri": {
"Value": {
"Fn::Join": [
"",
[
"s3://",
{
"Fn::GetAtt": [
"data7552DF31",
"Outputs.amplifytestAppIdtestBranchNamedataamplifyDataCodegenAssetsCodegenAssetsBucketC42FF1E2Ref"
]
},
"/model-schema.graphql"
]
]
}
}
},
"Parameters": {
Expand Down
Loading