Skip to content

Commit

Permalink
fix: init v6 integ tests
Browse files Browse the repository at this point in the history
  • Loading branch information
David Lopez committed Nov 20, 2023
1 parent 69ece2f commit 52cd138
Show file tree
Hide file tree
Showing 72 changed files with 10,742 additions and 264 deletions.
3 changes: 3 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ module.exports = {
'commitlint.config.js',
'packages/integration-test',
'*.md',
'*.css',
],
extends: [
'plugin:@typescript-eslint/recommended',
Expand All @@ -21,6 +22,8 @@ module.exports = {
tsconfigRootDir: __dirname,
sourceType: 'module',
ecmaVersion: 6,
//for the css file in test-generator/integration-test-templates/src/GenerateTests.css.
// extraFileExtensions: ['.css']
},
rules: {
'max-len': ['error', 120, 2],
Expand Down
36 changes: 35 additions & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ jobs:
name: cypress-videos
path: /home/runner/work/amplify-codegen-ui/amplify-codegen-ui/e2e-test-app-v6/cypress/videos

functional-tests:
functional-tests-v5:
runs-on: ubuntu-latest
steps:
- name: Checkout Studio Codegen
Expand Down Expand Up @@ -231,3 +231,37 @@ jobs:
- name: Check Integ Test Coverage
working-directory: packages/integration-test
run: node cypress/scripts/generateCoverageSummary.mjs

functional-tests-v6:
runs-on: ubuntu-latest
steps:
- name: Checkout Studio Codegen
uses: actions/checkout@v2
- name: Setup Node.js LTS
uses: actions/setup-node@v2
with:
node-version: lts/*
- name: Install packages
run: npm ci
- name: Lerna bootstrap
run: npm run bootstrap
- name: Setup Integration Test
run: npm run integ:setupv6
- name: Cypress run
uses: cypress-io/github-action@v5
with:
working-directory: packages/integration-test
install: false
start: npm start
wait-on: 'http://localhost:3000'
wait-on-timeout: 210
config-file: cypress.config.ts
- name: Upload Cypress videos
if: failure()
uses: actions/upload-artifact@v3
with:
name: cypress-videos
path: /home/runner/work/amplify-codegen-ui/amplify-codegen-ui/packages/integration-test/cypress/videos
- name: Check Integ Test Coverage
working-directory: packages/integration-test
run: node cypress/scripts/generateCoverageSummary.mjs
7 changes: 7 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,17 @@
"integ:setup": "run-script-os",
"integ:setup:default": "./scripts/integ-setup.sh",
"integ:setup:win32": "scripts\\integ-setup.bat",
"integ:setupv6": "run-script-os",
"integ:setupv6:default": "./scripts/integ-setupv6.sh",
"integ:setupv6:win32": "scripts\\integ-setupv6.bat",
"integ:templates": "run-script-os",
"integ:templates:default": "./scripts/integ-templates.sh",
"integ:templates:win32": "scripts\\integ-templates.bat",
"integ:templates:watch": "nodemon --watch packages/test-generator/integration-test-templates/ --watch packages/test-generator/lib -e tsx,ts,js,json --exec 'npm run integ:templates'",
"integ:templatesv6": "run-script-os",
"integ:templatesv6:default": "./scripts/integ-templatesv6.sh",
"integ:templatesv6:win32": "scripts\\integ-templatesv6.bat",
"integ:templatesv6:watch": "nodemon --watch packages/test-generator/integration-test-templates/ --watch packages/test-generator/lib -e tsx,ts,js,json --exec 'npm run integ:templates'",
"integ:test": "run-script-os",
"integ:test:default": "./scripts/integ-test.sh",
"integ:test:win32": "scripts\\integ-test.bat",
Expand Down
100 changes: 0 additions & 100 deletions packages/codegen-ui-golden-files/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SKIP_PREFLIGHT_CHECK=true
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
rules: {
'import/no-unresolved': 'off',
'import/no-extraneous-dependencies': 'off',
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License").
You may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
module.exports = function override(config) {
return {
...config,
resolve: {
...config.resolve,
fallback: {
...config.resolve.fallback,
os: require.resolve('os-browserify/browser'),
path: require.resolve('path-browserify'),
fs: false,
perf_hooks: false,
},
},
// Avoid 'Critical dependency: the request of a dependency is an expression' warning from typescript
ignoreWarnings: [{ module: /node_modules/ }],
};
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License").
You may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import { defineConfig } from 'cypress';

export default defineConfig({
e2e: {
setupNodeEvents(on, config) {
// eslint-disable-next-line global-require, @typescript-eslint/no-var-requires
require('@cypress/code-coverage/task')(on, config);

return config;
},
},
chromeWebSecurity: false,
defaultCommandTimeout: 60000,
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: ['plugin:cypress/recommended'],
};
Loading

0 comments on commit 52cd138

Please sign in to comment.