forked from mongodb/stitch-js-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.evg.yml
223 lines (212 loc) · 8.13 KB
/
.evg.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
functions:
"fetch_node":
- command: shell.exec
params:
shell: "bash"
script: |
set -e
curl -s ${node_url} | tar xJf -
mv node-* node
"fetch_go113":
- command: shell.exec
params:
shell: "bash"
script: |
set -e
wget --quiet ${go_url}
tar xvf ./go1.13*gz
"fetch_source":
- command: git.get_project
params:
directory: "stitch-js-sdk"
"setup_mongod":
- command: shell.exec
params:
shell: "bash"
script: |
set -v
curl --silent ${mongodb_url} | tar xvz
- command: shell.exec
params:
shell: "bash"
background: true
script: |
set -v
cd mongodb-*
echo "starting mongod..."
mkdir db_files
./bin/mongod --dbpath ./db_files --port 26000 --replSet "test" &
echo "waiting for mongod to start up"
- command: shell.exec
params:
shell: "bash"
script: |
set -e
cd mongodb-*
./bin/mongo --nodb --eval 'assert.soon(function(x){try{var d = new Mongo("localhost:26000"); return true}catch(e){return false}}, "timed out connecting")'
./bin/mongo --port 26000 --eval 'rs.initiate()'
echo "mongod is up."
"setup_stitch":
- command: shell.exec
params:
shell: "bash"
silent: true
script: |
set -e
echo export TEST_STITCH_AWS_ACCESS_KEY_ID=${test_aws_key} >> creds
echo export TEST_STITCH_AWS_SECRET_ACCESS_KEY=${test_aws_secret} >> creds
echo export TEST_STITCH_TWILIO_SID=${test_twilio_sid} >> creds
echo export TEST_STITCH_TWILIO_AUTH_TOKEN=${test_twilio_authtoken} >> creds
echo export FB_APP_ID=${test_facebook_app_id} >> creds
echo export FB_APP_SECRET=${test_facebook_app_secret} >> creds
echo export COVERALLS_REPO_TOKEN=${coveralls_repo_token} >> creds
- command: shell.exec
params:
shell: "bash"
script: |
set -e
echo "cloning stitch"
git clone [email protected]:10gen/stitch
echo "downloading libmongo"
wget --quiet "${libmongo_url}"
chmod +x libmongo.so
echo "downloading stitch dylib"
mkdir -p stitch/etc/dylib
cd stitch/etc/dylib
curl -s "${server_stitch_lib_url}" | tar xvfz - --strip-components=1
cd -
echo "building transpiler"
curl -OL https://yarnpkg.com/latest.tar.gz
tar zvxf latest.tar.gz
mv yarn-* yarn
export PATH="`pwd`/yarn/bin:`pwd`/node/bin:$PATH"
cd stitch/etc/transpiler
yarn install && yarn run build -t ${transpiler_target}
- command: shell.exec
params:
shell: "bash"
background: true
script: |
export ROOT_DIR=`pwd`
export PATH=$ROOT_DIR:$PATH
export STITCH_PATH=$ROOT_DIR/stitch
export PATH="$PATH:$STITCH_PATH/etc/transpiler/bin"
export LD_LIBRARY_PATH="$STITCH_PATH/etc/dylib/lib"
which transpiler
echo "running stitch"
export GOROOT=$ROOT_DIR/go
export PATH=$GOROOT/bin:$PATH
cd $STITCH_PATH
go run cmd/auth/user.go addUser -domainID 000000000000000000000000 -mongoURI mongodb://localhost:26000 -salt 'DQOWene1723baqD!_@#' -id "[email protected]" -password "password"
go run cmd/server/main.go --configFile $STITCH_PATH/etc/configs/test_config.json
- command: shell.exec
params:
shell: "bash"
script: |
counter=0
until $(curl --output /dev/null --silent --head --fail http://localhost:9090); do
echo "checking for API server to be up..."
sleep 1
let counter++
if [ $counter -gt 100 ]; then
exit 1
fi
done
post:
- command: attach.xunit_results
params:
files:
- "./stitch-js-sdk/core/sdk/build/test-results/*.xml"
- "./stitch-js-sdk/core/services/mongodb-remote/build/test-results/*.xml"
- "./stitch-js-sdk/core/services/aws-s3/build/test-results/*.xml"
- "./stitch-js-sdk/core/services/aws-ses/build/test-results/*.xml"
- "./stitch-js-sdk/core/services/http/build/test-results/*.xml"
- "./stitch-js-sdk/core/services/twilio/build/test-results/*.xml"
- "./stitch-js-sdk/packages/browser/coretest/build/test-results/*.xml"
- "./stitch-js-sdk/packages/browser/services/mongodb-remote/build/test-results/*.xml"
- "./stitch-js-sdk/packages/browser/services/aws-s3/build/test-results/*.xml"
- "./stitch-js-sdk/packages/browser/services/aws-ses/build/test-results/*.xml"
- "./stitch-js-sdk/packages/browser/services/http/build/test-results/*.xml"
- "./stitch-js-sdk/packages/browser/services/twilio/build/test-results/*.xml"
- "./stitch-js-sdk/packages/server/coretest/build/test-results/*.xml"
- "./stitch-js-sdk/packages/server/services/mongodb-remote/build/test-results/*.xml"
- "./stitch-js-sdk/packages/server/services/aws-s3/build/test-results/*.xml"
- "./stitch-js-sdk/packages/server/services/aws-ses/build/test-results/*.xml"
- "./stitch-js-sdk/packages/server/services/http/build/test-results/*.xml"
- "./stitch-js-sdk/packages/server/services/twilio/build/test-results/*.xml"
tasks:
- name: run_tests
commands:
- func: "fetch_node"
- func: "fetch_go113"
- func: "fetch_source"
- func: "setup_mongod"
- func: "setup_stitch"
- command: shell.exec
params:
shell: "bash"
script: |
set -e
echo "running client tests"
source ./creds
export PATH="`pwd`/node/bin:$PATH"
cd stitch-js-sdk
npm install lerna
npm install
./node_modules/.bin/lerna bootstrap --hoist
./node_modules/.bin/lerna run build
./node_modules/.bin/lerna run test
- command: shell.exec
params:
shell: "bash"
script: |
set -e
source ./creds
export PATH="`pwd`/node/bin:$PATH"
cd stitch-js-sdk
npm install coveralls
export COVERALLS_GIT_COMMIT=${revision}
if [ -z "${github_pr_number}" ]
then
if [ "${is_patch}" = "true" ]; then
exit 0
fi
else
PR_INFO=`curl https://api.github.com/repos/${github_org}/${github_repo}/pulls/${github_pr_number}`
BRANCH=`echo $PR_INFO | python -c "import sys, json; print json.load(sys.stdin)['head']['ref']"`
export COVERALLS_GIT_BRANCH=$BRANCH
export CI_PULL_REQUEST=${github_pr_number}
fi
npm run test:coverage
- name: lint
commands:
- func: "fetch_node"
- func: "fetch_source"
- command: shell.exec
params:
shell: "bash"
script: |
set -e
export PATH="`pwd`/node/bin:$PATH"
cd stitch-js-sdk
echo "linting"
npm install lerna
npm install
./node_modules/.bin/lerna bootstrap --hoist
./node_modules/.bin/lerna run lint
./node_modules/.bin/lerna run tslint-check
buildvariants:
- name: rhel70
display_name: rhel70
run_on:
- rhel70
expansions:
go_url: "https://dl.google.com/go/go1.13.6.linux-amd64.tar.gz"
mongodb_url: https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-4.0.2.tgz
server_stitch_lib_url: 'https://s3.amazonaws.com/mciuploads/mongodb-mongo-master/stitch-support/enterprise-rhel-70-64-bit/18ca0d551818d6c8274358b8e6444640bec93c88/stitch-support-4.3.0-120-g18ca0d5.tgz'
transpiler_target: node8-linux
node_url: "https://nodejs.org/dist/v10.15.1/node-v10.15.1-linux-x64.tar.xz"
libmongo_url: 'https://s3.amazonaws.com//stitch-artifacts/stitch-mongo-libs/stitch_mongo_libs_linux_64_patch_b1c679a26ecb975372de41238ea44e4719b8fbf0_5f3d91c10ae6066889184912_20_08_19_20_57_17/libmongo.so'
tasks:
- name: run_tests
- name: lint