Skip to content

Commit

Permalink
test: use build cli for integ test (#7374)
Browse files Browse the repository at this point in the history
  • Loading branch information
SwaySway committed May 20, 2021
1 parent 572ddbd commit 76d8d22
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 54 deletions.
51 changes: 30 additions & 21 deletions .circleci/config.base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -357,27 +357,36 @@ jobs:

integration_test:
working_directory: ~/repo
resource_class: large
docker:
- image: cypress/base:12
environment:
TERM: dumb
resource_class: large
steps:
- checkout
- run: apt-get update
- run: apt-get install -y sudo
- run: sudo apt-get install -y tcl
- run: sudo apt-get install -y expect
- run: sudo apt-get install -y zip
- run: sudo apt-get install -y lsof
- run: sudo apt-get install -y python
- run: sudo apt-get install -y python-pip libpython-dev
- run: sudo apt-get install -y jq
- run: pip install awscli
- attach_workspace:
at: ./
- restore_cache:
key: amplify-verdaccio-cache-{{ .Branch }}-{{ .Revision }}
- run:
name: Setup Dependencies
command: |
apt-get update
apt-get install -y sudo
sudo apt-get install -y tcl
sudo apt-get install -y expect
sudo apt-get install -y zip
sudo apt-get install -y lsof
sudo apt-get install -y python python-pip libpython-dev
sudo apt-get install -y jq
pip install awscli
- run: cd .circleci/ && chmod +x aws.sh
- run: expect .circleci/aws_configure.exp
- run: yarn setup-dev
- run: amplify-dev
- run:
name: Configure Amplify CLI
command: |
yarn rm-dev-link && yarn link-dev && yarn rm-aa-dev-link && yarn link-aa-dev
echo 'export PATH="$(yarn global bin):$PATH"' >> $BASH_ENV
amplify-dev
- run:
name: Clone auth test package
command: |
Expand Down Expand Up @@ -408,7 +417,7 @@ jobs:
yarn add cypress@6.8.0 --save
cp ../repo/cypress.json .
cp -R ../repo/cypress .
node_modules/.bin/cypress run --spec $(find . -type f -name 'auth_spec*')
yarn cypress run --spec $(find . -type f -name 'auth_spec*')
- run: sudo kill -9 $(lsof -t -i:3000)
- run: cd .circleci/ && chmod +x delete_auth.sh
- run: expect .circleci/delete_auth.exp
Expand All @@ -435,21 +444,21 @@ jobs:
- run:
name: Run cypress tests for api
command: |
cd ../aws-amplify-cypress-auth
cd ../aws-amplify-cypress-api
yarn add cypress@6.8.0 --save
cp ../repo/cypress.json .
cp -R ../repo/cypress .
node_modules/.bin/cypress run --spec $(find . -type f -name 'api_spec*')
yarn cypress run --spec $(find . -type f -name 'api_spec*')
- run: cd .circleci/ && chmod +x delete_api.sh
- run: expect .circleci/delete_api.exp
- store_artifacts:
path: ../../aws-amplify-cypress-auth/cypress/videos
path: /root/aws-amplify-cypress-auth/cypress/videos
- store_artifacts:
path: ../aws-amplify-cypress-auth/cypress/screenshots
path: /root/aws-amplify-cypress-auth/cypress/screenshots
- store_artifacts:
path: ../aws-amplify-cypress-api/cypress/videos
path: /root/aws-amplify-cypress-api/cypress/videos
- store_artifacts:
path: ../aws-amplify-cypress-api/cypress/screenshots
path: /root/aws-amplify-cypress-api/cypress/screenshots

deploy:
<<: *defaults
Expand Down
68 changes: 35 additions & 33 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -366,27 +366,39 @@ jobs:
~/repo/packages/amplify-console-integration-tests/console-integration-reports
integration_test:
working_directory: ~/repo
resource_class: large
docker:
- image: cypress/base:12
environment:
TERM: dumb
resource_class: large
steps:
- checkout
- run: apt-get update
- run: apt-get install -y sudo
- run: sudo apt-get install -y tcl
- run: sudo apt-get install -y expect
- run: sudo apt-get install -y zip
- run: sudo apt-get install -y lsof
- run: sudo apt-get install -y python
- run: sudo apt-get install -y python-pip libpython-dev
- run: sudo apt-get install -y jq
- run: pip install awscli
- attach_workspace:
at: ./
- restore_cache:
key: amplify-verdaccio-cache-{{ .Branch }}-{{ .Revision }}
- run:
name: Setup Dependencies
command: |
apt-get update
apt-get install -y sudo
sudo apt-get install -y tcl
sudo apt-get install -y expect
sudo apt-get install -y zip
sudo apt-get install -y lsof
sudo apt-get install -y python python-pip libpython-dev
sudo apt-get install -y jq
pip install awscli
- run: cd .circleci/ && chmod +x aws.sh
- run: expect .circleci/aws_configure.exp
- run: yarn setup-dev
- run: amplify-dev
- run:
name: Configure Amplify CLI
command: >
yarn rm-dev-link && yarn link-dev && yarn rm-aa-dev-link && yarn
link-aa-dev
echo 'export PATH="$(yarn global bin):$PATH"' >> $BASH_ENV
amplify-dev
- run:
name: Clone auth test package
command: |
Expand Down Expand Up @@ -414,17 +426,12 @@ jobs:
- run: cat $(find ../repo -type f -name 'auth_spec*')
- run:
name: Run cypress tests for auth
command: >
command: |
cd ../aws-amplify-cypress-auth
yarn add cypress@6.8.0 --save
cp ../repo/cypress.json .
cp -R ../repo/cypress .
node_modules/.bin/cypress run --spec $(find . -type f -name
'auth_spec*')
yarn cypress run --spec $(find . -type f -name 'auth_spec*')
- run: sudo kill -9 $(lsof -t -i:3000)
- run: cd .circleci/ && chmod +x delete_auth.sh
- run: expect .circleci/delete_auth.exp
Expand Down Expand Up @@ -452,27 +459,22 @@ jobs:
background: true
- run:
name: Run cypress tests for api
command: >
cd ../aws-amplify-cypress-auth
command: |
cd ../aws-amplify-cypress-api
yarn add cypress@6.8.0 --save
cp ../repo/cypress.json .
cp -R ../repo/cypress .
node_modules/.bin/cypress run --spec $(find . -type f -name
'api_spec*')
yarn cypress run --spec $(find . -type f -name 'api_spec*')
- run: cd .circleci/ && chmod +x delete_api.sh
- run: expect .circleci/delete_api.exp
- store_artifacts:
path: ../../aws-amplify-cypress-auth/cypress/videos
path: /root/aws-amplify-cypress-auth/cypress/videos
- store_artifacts:
path: ../aws-amplify-cypress-auth/cypress/screenshots
path: /root/aws-amplify-cypress-auth/cypress/screenshots
- store_artifacts:
path: ../aws-amplify-cypress-api/cypress/videos
path: /root/aws-amplify-cypress-api/cypress/videos
- store_artifacts:
path: ../aws-amplify-cypress-api/cypress/screenshots
path: /root/aws-amplify-cypress-api/cypress/screenshots
deploy:
working_directory: ~/repo
docker: *ref_1
Expand Down

0 comments on commit 76d8d22

Please sign in to comment.