@@ -21,6 +21,38 @@ aliases:
21
21
yarn
22
22
cd ./mobile && yarn && yarn setup
23
23
24
+ - &install-rethinkdb
25
+ name : Install RethinkDB 2.3.5
26
+ command :
27
+ |
28
+ echo "deb http://download.rethinkdb.com/apt jessie main" | sudo tee /etc/apt/sources.list.d/rethinkdb.list
29
+ wget -qO- http://download.rethinkdb.com/apt/pubkey.gpg | sudo apt-key add -
30
+ sudo apt-get update
31
+ sudo apt-get install rethinkdb=2.3.5~0jessie
32
+
33
+ - &start-rethinkdb
34
+ name : Start RethinkDB
35
+ command : rethinkdb --bind all
36
+ background : true
37
+
38
+ - &setup-and-build-web
39
+ name : Setup and build
40
+ command :
41
+ |
42
+ node -e "const setup = require('./shared/testing/setup.js')().then(() => process.exit())"
43
+ yarn run build:web
44
+ yarn run build:iris
45
+
46
+ - &start-iris
47
+ name : Start Iris in the background
48
+ command : TEST_DB=true yarn run dev:iris
49
+ background : true
50
+
51
+ - &start-web
52
+ name : Start web client in the background
53
+ command : yarn run dev:web
54
+ background : true
55
+
24
56
defaults : &defaults
25
57
working_directory : ~/spectrum
26
58
51
83
root : .
52
84
paths : .
53
85
54
- # Tests js of the mobile app
55
- test_mobile_js :
56
- << : *js_defaults
57
- steps :
58
- - attach_workspace :
59
- at : ~/spectrum
60
- - run : cd ./mobile && yarn test:unit
61
-
62
- # Test the web JS
63
- test_web_js :
86
+ # Start db and servers, then run e2e and unit tests
87
+ test_web :
64
88
<< : *defaults
65
89
docker :
66
90
- image : circleci/node:8-browsers
@@ -71,41 +95,13 @@ jobs:
71
95
steps :
72
96
- attach_workspace :
73
97
at : ~/spectrum
74
- - run :
75
- name : Install RethinkDB 2.3.5
76
- command :
77
- |
78
- echo "deb http://download.rethinkdb.com/apt jessie main" | sudo tee /etc/apt/sources.list.d/rethinkdb.list
79
- wget -qO- http://download.rethinkdb.com/apt/pubkey.gpg | sudo apt-key add -
80
- sudo apt-get update
81
- sudo apt-get install rethinkdb=2.3.5~0jessie
82
- - run :
83
- name : Start RethinkDB
84
- command : rethinkdb --bind all
85
- background : true
98
+ - run : *install-rethinkdb
99
+ - run : *start-rethinkdb
86
100
- run : sleep 10
87
- - run :
88
- name : Setup and build
89
- command :
90
- |
91
- node -e "const setup = require('./shared/testing/setup.js')().then(() => process.exit())"
92
- yarn run build:web
93
- yarn run build:iris
94
- - run :
95
- name : Start Iris in the background
96
- command : TEST_DB=true yarn run dev:iris
97
- background : true
98
- - run :
99
- name : Start web client in the background
100
- command : yarn run dev:web
101
- background : true
101
+ - run : *setup-and-build-web
102
+ - run : *start-iris
103
+ - run : *start-web
102
104
- run : sleep 60
103
- - run :
104
- name : Run Flow
105
- command : yarn run flow
106
- - run :
107
- name : Run ESLint
108
- command : yarn run lint
109
105
- run :
110
106
name : Run Unit Tests
111
107
command : yarn run test:ci
@@ -117,6 +113,26 @@ jobs:
117
113
when : always
118
114
command : yarn run danger ci
119
115
116
+ # Run eslint, flow etc.
117
+ test_static_js :
118
+ << : *js_defaults
119
+ steps :
120
+ - attach_workspace :
121
+ at : ~/spectrum
122
+ - run :
123
+ name : Run Flow
124
+ command : yarn run flow
125
+ - run :
126
+ name : Run ESLint
127
+ command : yarn run lint
128
+
129
+ # Tests js of the mobile app
130
+ test_mobile_js :
131
+ << : *js_defaults
132
+ steps :
133
+ - attach_workspace :
134
+ at : ~/spectrum
135
+ - run : cd ./mobile && yarn test:unit
120
136
121
137
# Tests native code of the mobile app
122
138
test_mobile_native :
@@ -148,8 +164,7 @@ jobs:
148
164
workflows :
149
165
version : 2
150
166
151
- # Tests mobile app
152
- test_mobile :
167
+ test :
153
168
jobs :
154
169
- checkout_environment
155
170
- test_mobile_js :
@@ -159,11 +174,9 @@ workflows:
159
174
# - test_mobile_native:
160
175
# requires:
161
176
# - checkout_environment
162
-
163
- # Tests web app
164
- test_web :
165
- jobs :
166
- - checkout_environment
167
- - test_web_js :
177
+ - test_web :
178
+ requires :
179
+ - checkout_environment
180
+ - test_static_js :
168
181
requires :
169
182
- checkout_environment
0 commit comments