From 9823c1a61473bd5eb19ea55beb76b797181bc2f3 Mon Sep 17 00:00:00 2001 From: LieutenantRoger Date: Fri, 9 Sep 2022 10:39:21 +0800 Subject: [PATCH 01/10] refine e2e --- .circleci/config.yml | 42 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 39 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ccbd83edc..cbab2e9be 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,13 +8,16 @@ deploy_defaults: &deploy_defaults docker: - image: cimg/python:3.10.2 +test_defaults: &test_defaults + docker: + - image: cypress/browsers:node16.14.2-slim-chrome100-ff99-edge + install_build_dependency: &install_build_dependency name: Installation of build and deployment dependencies. command: | apt update apt install jq -y apt install python3-pip -y - apt install libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb -y pip3 install awscli --upgrade install_dependency: &install_dependency @@ -37,7 +40,6 @@ save_cache_settings: &save_cache_settings key: connect-node-modules-{{ checksum "yarn.lock" }} paths: - node_modules - - /root/.cache/Cypress running_yarn_tslint: &running_yarn_tslint name: Running Yarn tslint @@ -47,6 +49,13 @@ running_yarn_tslint: &running_yarn_tslint running_yarn_build: &running_yarn_build name: Running Yarn Build + command: | + source buildenvvar + yarn install + yarn build + +running_yarn_test: &running_yarn_test + name: Running Yarn Test Build command: | source buildenvvar yarn install @@ -83,6 +92,20 @@ build_steps: &build_steps - run: *install_deploysuite - run: *build_configuration_fetch - run: *running_yarn_build + - persist_to_workspace: *workspace_persist + +test_steps: &test_steps + # Initialization. + - checkout + - setup_remote_docker + - restore_cache: + key: test-node-modules-{{ checksum "yarn.lock" }} + - save_cache: + key: test-node-modules-{{ checksum "yarn.lock" }} + paths: + - node_modules + - /root/.cache/Cypress + - run: *running_yarn_test - store_test_results: path: cypress/test-report - store_artifacts: @@ -91,7 +114,6 @@ build_steps: &build_steps path: cypress/videos - store_artifacts: path: cypress/screenshots - - persist_to_workspace: *workspace_persist deploy_steps: &deploy_steps - checkout @@ -139,6 +161,14 @@ jobs: LOGICAL_ENV: "prod" APPNAME: "platform-ui-mvp" steps: *build_steps + + test-dev: + <<: *test_defaults + environment: + DEPLOY_ENV: "DEV" + LOGICAL_ENV: "dev" + APPNAME: "platform-ui-mvp" + steps: *test_steps # Just tests commited code. deployDev: @@ -208,3 +238,9 @@ workflows: branches: only: - master + + - test-dev: + filters: + branches: + ignore: + - develop \ No newline at end of file From d77db70c7d2d90820b65cbf5e6b1f5a0848f3303 Mon Sep 17 00:00:00 2001 From: LieutenantRoger Date: Fri, 9 Sep 2022 11:03:13 +0800 Subject: [PATCH 02/10] include env var --- .circleci/config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index cbab2e9be..7eef21350 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -105,6 +105,8 @@ test_steps: &test_steps paths: - node_modules - /root/.cache/Cypress + - run: *install_deploysuite + - run: *build_configuration_fetch - run: *running_yarn_test - store_test_results: path: cypress/test-report From db39b001de72af7e8ebe6cb60fc971ea5c486b0c Mon Sep 17 00:00:00 2001 From: LieutenantRoger Date: Fri, 9 Sep 2022 11:05:33 +0800 Subject: [PATCH 03/10] env prepare --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7eef21350..0c3b92bfd 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -105,6 +105,7 @@ test_steps: &test_steps paths: - node_modules - /root/.cache/Cypress + - run: *install_build_dependency - run: *install_deploysuite - run: *build_configuration_fetch - run: *running_yarn_test From 2175923bb47a51e89aabd7d8a66ff6ffea6b5574 Mon Sep 17 00:00:00 2001 From: LieutenantRoger Date: Fri, 9 Sep 2022 11:09:41 +0800 Subject: [PATCH 04/10] remove test env --- .circleci/config.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0c3b92bfd..1d4499df3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -57,7 +57,6 @@ running_yarn_build: &running_yarn_build running_yarn_test: &running_yarn_test name: Running Yarn Test Build command: | - source buildenvvar yarn install yarn cypress install yarn build @@ -105,9 +104,6 @@ test_steps: &test_steps paths: - node_modules - /root/.cache/Cypress - - run: *install_build_dependency - - run: *install_deploysuite - - run: *build_configuration_fetch - run: *running_yarn_test - store_test_results: path: cypress/test-report From 33eac904a50a97c0cde730e3a64eb4f719d84581 Mon Sep 17 00:00:00 2001 From: LieutenantRoger Date: Fri, 9 Sep 2022 15:34:47 +0800 Subject: [PATCH 05/10] merge dev --- cypress/e2e/home/home.spec.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cypress/e2e/home/home.spec.ts b/cypress/e2e/home/home.spec.ts index a1b877a9b..09e9bfc94 100644 --- a/cypress/e2e/home/home.spec.ts +++ b/cypress/e2e/home/home.spec.ts @@ -3,11 +3,11 @@ describe('Landing Page', () => { beforeEach(() => cy.visit('/')) // TCA-336 temporarily skip this bc the site isn't loading - it.skip('loads landing page should be successfully', () => { + it('loads landing page should be successfully', () => { cy.get('[data-id="root"]').should('be.visible') }) - it.skip('loads landing page should fail', () => { + it('loads landing page should fail', () => { cy.get('[data-id="root"]').should('not.be.visible') }) }) From 6ecf7f3926b985092997755190cccf94fc15d716 Mon Sep 17 00:00:00 2001 From: LieutenantRoger Date: Fri, 9 Sep 2022 15:35:54 +0800 Subject: [PATCH 06/10] try fail and deploy --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1d4499df3..26afa921e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -228,6 +228,7 @@ workflows: branches: only: - dev + - circle-ci-setup-v7 - deployProd: context : org-global From 10ce989b1e4d7652e0cf8496dd5a1ebafc7e02df Mon Sep 17 00:00:00 2001 From: LieutenantRoger Date: Fri, 9 Sep 2022 15:41:45 +0800 Subject: [PATCH 07/10] reset --- .circleci/config.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 26afa921e..1d4499df3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -228,7 +228,6 @@ workflows: branches: only: - dev - - circle-ci-setup-v7 - deployProd: context : org-global From 83446a1a552b535fc35f5c2561dfabebe3b7ab36 Mon Sep 17 00:00:00 2001 From: LieutenantRoger Date: Fri, 9 Sep 2022 21:51:42 +0800 Subject: [PATCH 08/10] execute test --- .circleci/config.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1d4499df3..58f6e8ae9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -239,7 +239,4 @@ workflows: - master - test-dev: - filters: - branches: - ignore: - - develop \ No newline at end of file + context : org-global \ No newline at end of file From f6ce5cba2c316ca991a66d997a2bc00bbac19d11 Mon Sep 17 00:00:00 2001 From: LieutenantRoger Date: Fri, 9 Sep 2022 22:16:47 +0800 Subject: [PATCH 09/10] switch the command seqneuce --- .circleci/config.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 58f6e8ae9..1c16fe79b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -99,12 +99,12 @@ test_steps: &test_steps - setup_remote_docker - restore_cache: key: test-node-modules-{{ checksum "yarn.lock" }} - - save_cache: - key: test-node-modules-{{ checksum "yarn.lock" }} - paths: - - node_modules - - /root/.cache/Cypress - run: *running_yarn_test + - save_cache: + key: test-node-modules-{{ checksum "yarn.lock" }} + paths: + - node_modules + - /root/.cache/Cypress - store_test_results: path: cypress/test-report - store_artifacts: From efe4e018107a70e7c665a68bdf15224d23e027d7 Mon Sep 17 00:00:00 2001 From: Brooke Date: Fri, 9 Sep 2022 08:16:47 -0700 Subject: [PATCH 10/10] TCA-408 clean up for dev #time 10m --- cypress/e2e/home/home.spec.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cypress/e2e/home/home.spec.ts b/cypress/e2e/home/home.spec.ts index 09e9bfc94..43c584180 100644 --- a/cypress/e2e/home/home.spec.ts +++ b/cypress/e2e/home/home.spec.ts @@ -2,12 +2,11 @@ describe('Landing Page', () => { beforeEach(() => cy.visit('/')) - // TCA-336 temporarily skip this bc the site isn't loading it('loads landing page should be successfully', () => { cy.get('[data-id="root"]').should('be.visible') }) - it('loads landing page should fail', () => { + it.skip('loads landing page should fail', () => { cy.get('[data-id="root"]').should('not.be.visible') }) })