Skip to content

Commit d17af84

Browse files
committed
First cut at a MCI YAML file
1 parent f549f64 commit d17af84

File tree

1 file changed

+208
-0
lines changed

1 file changed

+208
-0
lines changed

.evg.yml

Lines changed: 208 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,208 @@
1+
#########################################
2+
# Java Driver Config for Evergreen #
3+
#########################################
4+
5+
java_driver_variables:
6+
7+
topology_test_list: &topology_tests
8+
- name: "integration-test-latest"
9+
# - name: "integration-test-latest-replica-set"
10+
# - name: "integration-test-latest-sharded"
11+
12+
## Scripts that are shared between buildvariants
13+
scripts:
14+
mongo_orchestration:
15+
windows: &mongo_orchestration_windows
16+
start_mongo_orchestration: |
17+
trap 'set +o errexit; mongo-orchestration --pidfile c:\\mo.pid stop;' EXIT
18+
pidfile=/cygdrive/c/mo.pid
19+
if [ -f $pidfile ]; then
20+
echo "Existing pidfile $pidfile"
21+
cat $pidfile
22+
mongo-orchestration --pidfile c:\\mo.pid stop
23+
rm -f $pidfile
24+
fi
25+
ls -la
26+
fsutil volume diskfree c:
27+
if [ ! -d /cygdrive/c/tmp/mongoc-test-certificates ]; then
28+
mkdir -p /cygdrive/c/tmp/mongoc-test-certificates
29+
fi
30+
echo "Starting Mongo Orchestration..."
31+
echo "{ \"releases\": { \"default\": \"c:\\\\mongodb\\\\bin\" }}" > orchestration.config
32+
mongo-orchestration -f orchestration.config -e default -s wsgiref start --socket-timeout-ms=60000 --bind=127.0.0.1 --enable-majority-read-concern --pidfile c:\\mo.pid
33+
sleep 10
34+
cat c:\\mo.pid
35+
cat orchestration.config
36+
curl -s http://localhost:8889/
37+
unix: &mongo_orchestration_unix
38+
start_mongo_orchestration: |
39+
trap 'set +o errexit; mongo-orchestration --pidfile /data/mo.pid stop;' EXIT
40+
pidfile=/data/mo.pid
41+
if [ -f $pidfile ]; then
42+
echo "Existing pidfile $pidfile"
43+
cat $pidfile
44+
mongo-orchestration --pidfile /data/mo.pid stop;
45+
rm -f $pidfile
46+
fi
47+
df -h
48+
ls -la
49+
if [ ! -d /tmp/mongoc-test-certificates ]; then
50+
mkdir /tmp/mongoc-test-certificates
51+
fi
52+
echo "Starting Mongo Orchestration..."
53+
echo "{ \"releases\": { \"default\": \"`pwd`/mongodb/bin\" } }" > orchestration.config
54+
TMPDIR=/data/db mongo-orchestration -f orchestration.config -e default start --socket-timeout-ms=60000 --bind=127.0.0.1 --enable-majority-read-concern --pidfile $pidfile
55+
curl -s http://localhost:8889/
56+
start_topology_command: &start_topology_command
57+
start_topology: |
58+
curl -s --data @"$ORCHESTRATION_FILE" "$ORCHESTRATION_URL"
59+
./mongodb/bin/mongo $MONGO_SHELL_CONNECTION_FLAGS --eval 'printjson(db.serverBuildInfo())' admin
60+
./mongodb/bin/mongo $MONGO_SHELL_CONNECTION_FLAGS --eval 'printjson(db.adminCommand({getCmdLineOpts:1}))' admin
61+
./mongodb/bin/mongo $MONGO_SHELL_CONNECTION_FLAGS --eval 'printjson(db.isMaster())' admin
62+
63+
#######################################
64+
# Functions #
65+
#######################################
66+
67+
functions:
68+
"fetch source" :
69+
command: git.get_project
70+
params:
71+
directory: "mongo-java-driver"
72+
73+
"start_mongod":
74+
command: shell.exec
75+
params:
76+
background: true
77+
working_dir: "."
78+
script: |
79+
wget -O mongodb.tgz https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-latest.tgz
80+
tar --extract --file mongodb.tgz --strip-components=2 --wildcards --no-anchored "*/bin/mongod"
81+
mkdir -p /data/log
82+
mkdir -p /data/db
83+
./mongod --logpath=/data/log --dbpath=/data/db --pidfilepath=/data/pid
84+
85+
"stop_mongod":
86+
command: shell.exec
87+
params:
88+
working_dir: "."
89+
script:
90+
kill -TERM $(cat /data/pid)
91+
92+
93+
#######################################
94+
# Pre Task #
95+
#######################################
96+
97+
pre:
98+
- command: shell.exec
99+
params:
100+
script: |
101+
rm -rf "mongo-java-driver"
102+
rm mongod
103+
104+
#######################################
105+
# Tasks #
106+
#######################################
107+
108+
tasks:
109+
- name: compileAndAnalyze
110+
commands:
111+
- func: "fetch source"
112+
- command: git.apply_patch
113+
params:
114+
directory: "mongo-java-driver"
115+
- command: shell.exec
116+
params:
117+
working_dir: "mongo-java-driver"
118+
script: |
119+
./gradlew -PxmlReports.enabled=true --info -x test clean check jar testClasses
120+
- name: test
121+
commands:
122+
- func: "fetch source"
123+
- command: git.apply_patch
124+
params:
125+
directory: "mongo-java-driver"
126+
# - command: shell.exec
127+
# params:
128+
# working_dir: "mongo-java-driver"
129+
# script: |
130+
# ./gradlew -PxmlReports.enabled=true --info -x test clean check jar testClasses javadoc
131+
- func: "start_mongod"
132+
# - command: shell.exec
133+
# params:
134+
# working_dir: "mongo-java-driver"
135+
# script: |
136+
# ./gradlew --stacktrace --info -x classes -x testClasses --rerun-tasks test
137+
- command: shell.exec
138+
params:
139+
working_dir: "mongo-java-driver"
140+
script: |
141+
./gradlew --stacktrace --info test
142+
- func: "stop_mongod"
143+
144+
145+
scripts:
146+
## Scripts that are shared between buildvariants
147+
scripts:
148+
mongo_orchestration:
149+
windows: &mongo_orchestration_windows
150+
start_mongo_orchestration: |
151+
trap 'set +o errexit; mongo-orchestration --pidfile c:\\mo.pid stop;' EXIT
152+
pidfile=/cygdrive/c/mo.pid
153+
if [ -f $pidfile ]; then
154+
echo "Existing pidfile $pidfile"
155+
cat $pidfile
156+
mongo-orchestration --pidfile c:\\mo.pid stop
157+
rm -f $pidfile
158+
fi
159+
ls -la
160+
fsutil volume diskfree c:
161+
if [ ! -d /cygdrive/c/tmp/mongoc-test-certificates ]; then
162+
mkdir -p /cygdrive/c/tmp/mongoc-test-certificates
163+
fi
164+
echo "Starting Mongo Orchestration..."
165+
echo "{ \"releases\": { \"default\": \"c:\\\\mongodb\\\\bin\" }}" > orchestration.config
166+
mongo-orchestration -f orchestration.config -e default -s wsgiref start --socket-timeout-ms=60000 --bind=127.0.0.1 --enable-majority-read-concern --pidfile c:\\mo.pid
167+
sleep 10
168+
cat c:\\mo.pid
169+
cat orchestration.config
170+
curl -s http://localhost:8889/
171+
unix: &mongo_orchestration_unix
172+
start_mongo_orchestration: |
173+
trap 'set +o errexit; mongo-orchestration --pidfile /data/mo.pid stop;' EXIT
174+
pidfile=/data/mo.pid
175+
if [ -f $pidfile ]; then
176+
echo "Existing pidfile $pidfile"
177+
cat $pidfile
178+
mongo-orchestration --pidfile /data/mo.pid stop;
179+
rm -f $pidfile
180+
fi
181+
df -h
182+
ls -la
183+
if [ ! -d /tmp/mongoc-test-certificates ]; then
184+
mkdir /tmp/mongoc-test-certificates
185+
fi
186+
echo "Starting Mongo Orchestration..."
187+
echo "{ \"releases\": { \"default\": \"`pwd`/mongodb/bin\" } }" > orchestration.config
188+
TMPDIR=/data/db mongo-orchestration -f orchestration.config -e default start --socket-timeout-ms=60000 --bind=127.0.0.1 --enable-majority-read-concern --pidfile $pidfile
189+
curl -s http://localhost:8889/
190+
start_topology_command: &start_topology_command
191+
start_topology: |
192+
curl -s --data @"$ORCHESTRATION_FILE" "$ORCHESTRATION_URL"
193+
./mongodb/bin/mongo $MONGO_SHELL_CONNECTION_FLAGS --eval 'printjson(db.serverBuildInfo())' admin
194+
./mongodb/bin/mongo $MONGO_SHELL_CONNECTION_FLAGS --eval 'printjson(db.adminCommand({getCmdLineOpts:1}))' admin
195+
./mongodb/bin/mongo $MONGO_SHELL_CONNECTION_FLAGS --eval 'printjson(db.isMaster())' admin
196+
197+
#######################################
198+
# Variants #
199+
#######################################
200+
201+
buildvariants:
202+
- name: ubuntu-1404
203+
display_name: "Ubuntu-1404"
204+
expansions:
205+
run_on:
206+
- ubuntu1404-build
207+
tasks:
208+
- name: compileAndAnalyze

0 commit comments

Comments
 (0)