forked from mongodb/mongo-java-driver
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.evg.yml
More file actions
153 lines (137 loc) · 5.11 KB
/
.evg.yml
File metadata and controls
153 lines (137 loc) · 5.11 KB
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
#########################################
# Java Driver Config for Evergreen #
#########################################
java_driver_variables:
## Common download urls (merge in as hashes)
mongo_download_url_prefixes:
linux64: &mongo_url_linux64
mongo_url_prefix: "http://downloads.mongodb.org/linux/mongodb-linux-x86_64-"
ubuntu1404: &mongo_url_ubuntu1404
mongo_url_platform: "ubuntu1404-"
<<: *mongo_url_linux64
#######################################
# Functions #
#######################################
functions:
"fetch source" :
command: git.get_project
params:
directory: "mongo-java-driver"
"set topology standalone no auth" :
command: expansions.update
params:
updates:
- key: "orchestration_file"
value: "basic.json"
- key: "topology_type"
value: "server"
"set version latest" :
command: expansions.update
params:
updates:
- key: "mongo_url"
value: ${mongo_url_prefix}${mongo_url_platform|}latest.${mongo_url_extension|tgz}
"fetch mongodb" :
command: shell.exec
params:
working_dir: "mongo-java-driver"
script: |
set -o verbose
set -o errexit
ls -la
curl -s ${mongo_url} --output mongo-archive.${ext|tgz}
${decompress} mongo-archive.${ext|tgz}
mv mongodb* mongodb
chmod +x ./mongodb/bin/mongod${extension}
if [ ${windows|false} = true ]; then
rm -rf /cygdrive/c/mongodb
cp -r mongodb /cygdrive/c/mongodb
fi
"run tests" :
command: shell.exec
params:
working_dir: "mongo-java-driver"
script: |
export ORCHESTRATION_FILE="orchestration_configs/${topology_type}s/${orchestration_file}"
mkdir -p $(dirname "$ORCHESTRATION_FILE")
# Borrow MO config from the C driver
#
curl --location "https://raw.githubusercontent.com/mongodb/mongo-c-driver/master/orchestration_configs/${topology_type}s/${orchestration_file}" > "$ORCHESTRATION_FILE"
export ORCHESTRATION_URL="http://localhost:8889/v1/${topology_type}s"
export MONGO_ORCHESTRATION_HOME=/tmp/mongo-java-test-certificates
${start_mongo_orchestration}
${start_topology}
./gradlew --stacktrace --info test
#######################################
# Tasks #
#######################################
tasks:
- name: compileAndAnalyze
commands:
- func: "fetch source"
- command: git.apply_patch
params:
directory: "mongo-java-driver"
- command: shell.exec
params:
working_dir: "mongo-java-driver"
script: |
./gradlew -PxmlReports.enabled=true --info -x test clean check jar testClasses
- name: test
commands:
- func: "fetch source"
- command: git.apply_patch
params:
directory: "mongo-java-driver"
- func: "set topology standalone no auth"
- func: "set version latest"
- func: "fetch mongodb"
- func: "run tests"
scripts:
## Scripts that are shared between buildvariants
scripts:
mongo_orchestration:
unix: &mongo_orchestration_unix
start_mongo_orchestration: |
trap 'set +o errexit; mongo-orchestration --pidfile /data/mo.pid stop;' EXIT
pidfile=/data/mo.pid
if [ -f $pidfile ]; then
echo "Existing pidfile $pidfile"
cat $pidfile
mongo-orchestration --pidfile /data/mo.pid stop;
rm -f $pidfile
fi
df -h
ls -la
if [ ! -d /tmp/mongo-java-test-certificates ]; then
mkdir /tmp/mongo-java-test-certificates
fi
echo "Starting Mongo Orchestration..."
echo "{ \"releases\": { \"default\": \"`pwd`/mongodb/bin\" } }" > orchestration.config
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
curl -s http://localhost:8889/
start_topology_command: &start_topology_command
start_topology: |
curl -s --data @"$ORCHESTRATION_FILE" "$ORCHESTRATION_URL"
./mongodb/bin/mongo $MONGO_SHELL_CONNECTION_FLAGS --eval 'printjson(db.serverBuildInfo())' admin
./mongodb/bin/mongo $MONGO_SHELL_CONNECTION_FLAGS --eval 'printjson(db.adminCommand({getCmdLineOpts:1}))' admin
./mongodb/bin/mongo $MONGO_SHELL_CONNECTION_FLAGS --eval 'printjson(db.isMaster())' admin
#######################################
# Variants #
#######################################
buildvariants:
- name: ubuntu-1404
display_name: "Ubuntu-1404"
expansions:
<<: *start_topology_command
<<: *mongo_url_ubuntu1404 # sets ${mongo_url_prefix}
<<: *mongo_orchestration_unix # sets start_topology and start_mongo_orchestration
run_on:
- ubuntu1404-test
tasks:
- name: compileAndAnalyze
run_on:
- ubuntu1404-build
- name: test
depends_on:
- name: compileAndAnalyze