@@ -8,6 +8,10 @@ deploy_defaults: &deploy_defaults
88 docker :
99 - image : cimg/python:3.10.2
1010
11+ test_defaults : &test_defaults
12+ docker :
13+ - image : cypress/browsers:node16.14.2-slim-chrome100-ff99-edge
14+
1115install_build_dependency : &install_build_dependency
1216 name : Installation of build and deployment dependencies.
1317 command : |
@@ -50,6 +54,14 @@ running_yarn_build: &running_yarn_build
5054 yarn install
5155 yarn build
5256
57+ running_yarn_test : &running_yarn_test
58+ name : Running Yarn Test Build
59+ command : |
60+ yarn install
61+ yarn cypress install
62+ yarn build
63+ yarn cy:ci
64+
5365workspace_persist : &workspace_persist
5466 root : .
5567 paths :
@@ -81,6 +93,27 @@ build_steps: &build_steps
8193 - run : *running_yarn_build
8294 - persist_to_workspace : *workspace_persist
8395
96+ test_steps : &test_steps
97+ # Initialization.
98+ - checkout
99+ - setup_remote_docker
100+ - restore_cache :
101+ key : test-node-modules-{{ checksum "yarn.lock" }}
102+ - run : *running_yarn_test
103+ - save_cache :
104+ key : test-node-modules-{{ checksum "yarn.lock" }}
105+ paths :
106+ - node_modules
107+ - /root/.cache/Cypress
108+ - store_test_results :
109+ path : cypress/test-report
110+ - store_artifacts :
111+ path : cypress/test-report
112+ - store_artifacts :
113+ path : cypress/videos
114+ - store_artifacts :
115+ path : cypress/screenshots
116+
84117deploy_steps : &deploy_steps
85118 - checkout
86119 - attach_workspace : *workspace_attach
@@ -127,6 +160,14 @@ jobs:
127160 LOGICAL_ENV : " prod"
128161 APPNAME : " platform-ui-mvp"
129162 steps : *build_steps
163+
164+ test-dev :
165+ << : *test_defaults
166+ environment :
167+ DEPLOY_ENV : " DEV"
168+ LOGICAL_ENV : " dev"
169+ APPNAME : " platform-ui-mvp"
170+ steps : *test_steps
130171
131172 # Just tests commited code.
132173 deployDev :
@@ -147,35 +188,6 @@ jobs:
147188 APPNAME : " platform-ui-mvp"
148189 steps : *deploy_steps
149190
150- # Test job for the cases when we don not need deployment.
151- e2e-test :
152- docker :
153- - image : cypress/browsers:node16.14.2-slim-chrome100-ff99-edge
154- steps :
155- - checkout
156- - restore_cache :
157- key : test-node-modules-{{ checksum "yarn.lock" }}
158- - run :
159- name : Config Git
160- command : git config --global url."https://git@".insteadOf git://
161- - run :
162- name : Install Dependencies
163- command : yarn install
164- no_output_timeout : 20m
165- - run :
166- name : Install Cypress Binary
167- command : yarn cypress install
168- - run :
169- name : Build the application
170- command : yarn build
171- no_output_timeout : 20m
172- - save_cache :
173- key : test-node-modules-{{ checksum "yarn.lock" }}
174- paths :
175- - node_modules
176- - /root/.cache/Cypress
177- - run : yarn cy:ci
178-
179191workflows :
180192 version : 2
181193 build :
@@ -201,9 +213,6 @@ workflows:
201213 ignore :
202214 - master
203215
204- - e2e-test :
205- context : org-global
206-
207216 - build-prod :
208217 context : org-global
209218 filters :
@@ -215,7 +224,6 @@ workflows:
215224 context : org-global
216225 requires :
217226 - build-dev
218- - e2e-test
219227 filters :
220228 branches :
221229 only :
@@ -229,3 +237,6 @@ workflows:
229237 branches :
230238 only :
231239 - master
240+
241+ - test-dev :
242+ context : org-global
0 commit comments