Skip to content

Commit 1f18338

Browse files
committed
JAVA-2346, JAVA:2347: Use the Evergreen matrix functionality to simplify the configuration
The matrix consists of: mongodb version: 3.2, 3.4 topology: standalone, replica set, sharded os: ubuntu 1604 authentication: enabled, disabled
1 parent bd61a82 commit 1f18338

File tree

1 file changed

+106
-114
lines changed

1 file changed

+106
-114
lines changed

.evg.yml

Lines changed: 106 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,6 @@
22
# Java Driver Config for Evergreen #
33
#########################################
44

5-
java_driver_variables:
6-
## Common download urls (merge in as hashes)
7-
mongo_download_url_prefixes:
8-
linux64: &mongo_url_linux64
9-
mongo_url_prefix: "http://downloads.mongodb.org/linux/mongodb-linux-x86_64-"
10-
ubuntu1604: &mongo_url_ubuntu1604
11-
mongo_url_platform: "ubuntu1604-"
12-
<<: *mongo_url_linux64
135

146
#######################################
157
# Functions #
@@ -21,53 +13,6 @@ functions:
2113
params:
2214
directory: "mongo-java-driver"
2315

24-
"set topology standalone" :
25-
command: expansions.update
26-
params:
27-
updates:
28-
- key: "orchestration_file"
29-
value: "basic.json"
30-
- key: "topology_type"
31-
value: "server"
32-
- key: "mongodb_test_uri"
33-
value: "mongodb://localhost:27017"
34-
- key: "rs_enabled"
35-
value: "false"
36-
37-
38-
"set topology replica set" :
39-
command: expansions.update
40-
params:
41-
updates:
42-
- key: "orchestration_file"
43-
value: "basic.json"
44-
- key: "topology_type"
45-
value: "replica_set"
46-
- key: "mongodb_test_uri"
47-
value: "mongodb://localhost:27017,localhost:27018"
48-
- key: "rs_enabled"
49-
value: "true"
50-
51-
"set topology sharded" :
52-
command: expansions.update
53-
params:
54-
updates:
55-
- key: "orchestration_file"
56-
value: "basic.json"
57-
- key: "topology_type"
58-
value: "sharded_cluster"
59-
- key: "mongodb_test_uri"
60-
value: "mongodb://localhost:27017"
61-
- key: "rs_enabled"
62-
value: "false"
63-
64-
"set version latest" :
65-
command: expansions.update
66-
params:
67-
updates:
68-
- key: "mongo_url"
69-
value: ${mongo_url_prefix}${mongo_url_platform|}latest.${mongo_url_extension|tgz}
70-
7116
"fetch mongodb" :
7217
command: shell.exec
7318
params:
@@ -85,11 +30,25 @@ functions:
8530
cp -r mongodb /cygdrive/c/mongodb
8631
fi
8732
33+
34+
"compile and analyze" :
35+
command: shell.exec
36+
params:
37+
working_dir: "mongo-java-driver"
38+
script: |
39+
set -o verbose
40+
set -o errexit
41+
42+
./gradlew -PxmlReports.enabled=true --info -x test clean check jar testClasses
43+
8844
"run tests" :
8945
command: shell.exec
9046
params:
9147
working_dir: "mongo-java-driver"
9248
script: |
49+
set -o verbose
50+
set -o errexit
51+
9352
export ORCHESTRATION_FILE="orchestration_configs/${topology_type}s/${orchestration_file}"
9453
9554
mkdir -p $(dirname "$ORCHESTRATION_FILE")
@@ -106,13 +65,18 @@ functions:
10665
10766
${start_mongo_orchestration}
10867
${start_topology}
109-
./gradlew -Dorg.mongodb.test.uri=${mongodb_test_uri} -Prs.enabled=${rs_enabled} --stacktrace --info test
68+
69+
70+
mongodb_test_uri="mongodb://${auth_uri_prefix}${hosts}"
71+
72+
./gradlew -Dorg.mongodb.test.uri=$mongodb_test_uri --stacktrace --info test
11073
11174
"attach junit results" :
11275
command: attach.xunit_results
11376
params:
11477
file: ./mongo-java-driver/*/build/test-results/TEST-*.xml
11578

79+
11680
#######################################
11781
# Tasks #
11882
#######################################
@@ -121,48 +85,22 @@ tasks:
12185
- name: compileAndAnalyze
12286
commands:
12387
- func: "fetch source"
124-
- command: git.apply_patch
125-
params:
126-
directory: "mongo-java-driver"
127-
- command: shell.exec
128-
params:
129-
working_dir: "mongo-java-driver"
130-
script: |
131-
./gradlew -PxmlReports.enabled=true --info -x test clean check jar testClasses
132-
- name: test-standalone
88+
- func: "compile and analyze"
89+
- name: test
90+
depends_on:
91+
- name: compileAndAnalyze
92+
variant: compile
13393
commands:
13494
- func: "fetch source"
135-
- command: git.apply_patch
136-
params:
137-
directory: "mongo-java-driver"
138-
- func: "set topology standalone"
139-
- func: "set version latest"
140-
- func: "fetch mongodb"
141-
- func: "run tests"
142-
- func: "attach junit results"
143-
- name: test-replica-set
144-
commands:
145-
- func: "fetch source"
146-
- command: git.apply_patch
147-
params:
148-
directory: "mongo-java-driver"
149-
- func: "set topology replica set"
150-
- func: "set version latest"
151-
- func: "fetch mongodb"
152-
- func: "run tests"
153-
- func: "attach junit results"
154-
- name: test-sharded
155-
commands:
156-
- func: "fetch source"
157-
- command: git.apply_patch
158-
params:
159-
directory: "mongo-java-driver"
160-
- func: "set topology sharded"
161-
- func: "set version latest"
16295
- func: "fetch mongodb"
16396
- func: "run tests"
16497
- func: "attach junit results"
16598

99+
100+
#######################################
101+
# Scripts #
102+
#######################################
103+
166104
scripts:
167105
## Scripts that are shared between buildvariants
168106
scripts:
@@ -190,29 +128,83 @@ scripts:
190128
./mongodb/bin/mongo $MONGO_SHELL_CONNECTION_FLAGS --eval 'printjson(db.adminCommand({getCmdLineOpts:1}))' admin
191129
./mongodb/bin/mongo $MONGO_SHELL_CONNECTION_FLAGS --eval 'printjson(db.isMaster())' admin
192130
131+
193132
#######################################
194-
# Variants #
133+
# Axes #
134+
#######################################
135+
136+
axes:
137+
- id: mongodb_version
138+
display_name: MongoDB Version
139+
values:
140+
- id: "3.4"
141+
display_name: "3.4"
142+
variables:
143+
mongodb_full_version: "3.4.0-rc0"
144+
- id: "3.2"
145+
display_name: "3.2"
146+
variables:
147+
mongodb_full_version: "3.2.9"
148+
- id: "3.0"
149+
display_name: "3.0"
150+
variables:
151+
mongodb_full_version: "3.0.11"
152+
- id: "2.6"
153+
display_name: "2.6"
154+
variables:
155+
mongodb_full_version: "2.6.12"
156+
- id: auth
157+
display_name: Authentication
158+
values:
159+
- id: "enabled"
160+
display_name: "Auth Enabled"
161+
variables:
162+
auth_uri_prefix: "bob:pwd123@"
163+
orchestration_file: "auth.json"
164+
- id: "disabled"
165+
display_name: "Auth Disabled"
166+
variables:
167+
auth_uri_prefix: ""
168+
orchestration_file: "basic.json"
169+
- id: os
170+
display_name: OS
171+
values:
172+
- id: ubuntu1604
173+
display_name: Ubuntu 16.04
174+
run_on: ubuntu1604-test
175+
variables:
176+
<<: *start_topology_command
177+
<<: *mongo_orchestration_unix
178+
mongo_url: "https://downloads.mongodb.org/linux/mongodb-linux-x86_64-${os}-${mongodb_full_version}.tgz"
179+
- id: topology_type
180+
display_name: Cluster Type
181+
values:
182+
- id: server
183+
display_name: Standalone
184+
variables:
185+
hosts: "localhost:27017"
186+
- id: replica_set
187+
display_name: Replica Set
188+
variables:
189+
hosts: "localhost:27017,localhost:27018"
190+
- id: sharded_cluster
191+
display_name: Sharded
192+
variables:
193+
hosts: "localhost:27017"
194+
195+
#######################################
196+
# Variants #
195197
#######################################
196198

197199
buildvariants:
198-
- name: ubuntu-1604
199-
display_name: "Ubuntu-1604"
200-
expansions:
201-
<<: *start_topology_command
202-
<<: *mongo_url_ubuntu1604 # sets ${mongo_url_prefix}
203-
<<: *mongo_orchestration_unix # sets start_topology and start_mongo_orchestration
204-
run_on:
205-
- ubuntu1604-test
206-
tasks:
207-
- name: compileAndAnalyze
208-
run_on:
209-
- ubuntu1604-build
210-
- name: test-standalone
211-
depends_on:
212-
- name: compileAndAnalyze
213-
- name: test-replica-set
214-
depends_on:
215-
- name: compileAndAnalyze
216-
- name: test-sharded
217-
depends_on:
218-
- name: compileAndAnalyze
200+
- name: compile
201+
display_name: "Compile and Analyze"
202+
tasks:
203+
- name: compileAndAnalyze
204+
run_on:
205+
- ubuntu1604-test
206+
- matrix_name: "test"
207+
matrix_spec: {os: "*", topology_type: "*", mongodb_version: ["3.2", "3.4"], auth: "*"}
208+
display_name: "${os} ${topology_type} ${mongodb_version} ${auth}"
209+
tasks:
210+
- name: test

0 commit comments

Comments
 (0)