Skip to content

Commit 1a485ef

Browse files
committed
Use our own configs
1 parent ec16fec commit 1a485ef

File tree

2 files changed

+79
-229
lines changed

2 files changed

+79
-229
lines changed

.evergreen/config.yml

Lines changed: 16 additions & 229 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ functions:
330330
params:
331331
script: |
332332
${PREPARE_SHELL}
333-
MONGODB_VERSION=${VERSION} TOPOLOGY=${TOPOLOGY} AUTH=${AUTH} SSL=${SSL} STORAGE_ENGINE=${STORAGE_ENGINE} sh ${DRIVERS_TOOLS}/.evergreen/run-orchestration.sh
333+
MONGODB_VERSION=${VERSION} PROJECT_DIR=${PROJECT_DIR} CONFIG=${CONFIG} TOPOLOGY=${TOPOLOGY} sh ${PROJECT_DIRECTORY}/.evergreen/run-orchestration.sh
334334
# run-orchestration generates expansion file with the MONGODB_URI for the cluster
335335
- command: expansions.update
336336
params:
@@ -457,223 +457,34 @@ tasks:
457457
458458
# Standard test tasks {{{
459459

460-
- name: "test-2.4-standalone"
461-
tags: ["2.4", "standalone"]
462-
commands:
463-
- func: "bootstrap mongo-orchestration"
464-
vars:
465-
VERSION: "2.4"
466-
TOPOLOGY: "server"
467-
- func: "run tests"
468-
469-
- name: "test-2.4-replica_set"
470-
tags: ["2.4", "replica_set"]
471-
commands:
472-
- func: "bootstrap mongo-orchestration"
473-
vars:
474-
VERSION: "2.4"
475-
TOPOLOGY: "replica_set"
476-
- func: "run tests"
477-
478-
- name: "test-2.4-sharded_cluster"
479-
tags: ["2.4", "sharded_cluster"]
480-
commands:
481-
- func: "bootstrap mongo-orchestration"
482-
vars:
483-
VERSION: "2.4"
484-
TOPOLOGY: "sharded_cluster"
485-
- func: "run tests"
486-
487-
- name: "test-2.6-standalone"
488-
tags: ["2.6", "standalone"]
489-
commands:
490-
- func: "bootstrap mongo-orchestration"
491-
vars:
492-
VERSION: "2.6"
493-
TOPOLOGY: "server"
494-
- func: "run tests"
495-
496-
- name: "test-2.6-replica_set"
497-
tags: ["2.6", "replica_set"]
498-
commands:
499-
- func: "bootstrap mongo-orchestration"
500-
vars:
501-
VERSION: "2.6"
502-
TOPOLOGY: "replica_set"
503-
- func: "run tests"
504-
505-
- name: "test-2.6-sharded_cluster"
506-
tags: ["2.6", "sharded_cluster"]
507-
commands:
508-
- func: "bootstrap mongo-orchestration"
509-
vars:
510-
VERSION: "2.6"
511-
TOPOLOGY: "sharded_cluster"
512-
- func: "run tests"
513-
514-
- name: "test-3.0-standalone"
515-
tags: ["3.0", "standalone"]
516-
commands:
517-
- func: "bootstrap mongo-orchestration"
518-
vars:
519-
VERSION: "3.0"
520-
TOPOLOGY: "server"
521-
- func: "run tests"
522-
523-
- name: "test-3.0-replica_set"
524-
tags: ["3.0", "replica_set"]
525-
commands:
526-
- func: "bootstrap mongo-orchestration"
527-
vars:
528-
VERSION: "3.0"
529-
TOPOLOGY: "replica_set"
530-
- func: "run tests"
531-
532-
- name: "test-3.0-sharded_cluster"
533-
tags: ["3.0", "sharded_cluster"]
534-
commands:
535-
- func: "bootstrap mongo-orchestration"
536-
vars:
537-
VERSION: "3.0"
538-
TOPOLOGY: "sharded_cluster"
539-
- func: "run tests"
540-
541-
- name: "test-3.2-standalone"
542-
tags: ["3.2", "standalone"]
543-
commands:
544-
- func: "bootstrap mongo-orchestration"
545-
vars:
546-
VERSION: "3.2"
547-
TOPOLOGY: "server"
548-
- func: "run tests"
549-
550-
- name: "test-3.2-replica_set"
551-
tags: ["3.2", "replica_set"]
552-
commands:
553-
- func: "bootstrap mongo-orchestration"
554-
vars:
555-
VERSION: "3.2"
556-
TOPOLOGY: "replica_set"
557-
- func: "run tests"
558-
559-
- name: "test-3.2-sharded_cluster"
560-
tags: ["3.2", "sharded_cluster"]
561-
commands:
562-
- func: "bootstrap mongo-orchestration"
563-
vars:
564-
VERSION: "3.2"
565-
TOPOLOGY: "sharded_cluster"
566-
- func: "run tests"
567-
568-
- name: "test-3.4-standalone"
569-
tags: ["3.4", "standalone"]
570-
commands:
571-
- func: "bootstrap mongo-orchestration"
572-
vars:
573-
VERSION: "3.4"
574-
TOPOLOGY: "server"
575-
- func: "run tests"
576-
577-
- name: "test-3.4-replica_set"
578-
tags: ["3.4", "replica_set"]
579-
commands:
580-
- func: "bootstrap mongo-orchestration"
581-
vars:
582-
VERSION: "3.4"
583-
TOPOLOGY: "replica_set"
584-
- func: "run tests"
585-
586-
- name: "test-3.4-sharded_cluster"
587-
tags: ["3.4", "sharded_cluster"]
588-
commands:
589-
- func: "bootstrap mongo-orchestration"
590-
vars:
591-
VERSION: "3.4"
592-
TOPOLOGY: "sharded_cluster"
593-
- func: "run tests"
594-
595-
- name: "test-3.6-standalone"
596-
tags: ["3.6", "standalone"]
597-
commands:
598-
- func: "bootstrap mongo-orchestration"
599-
vars:
600-
VERSION: "3.6"
601-
TOPOLOGY: "server"
602-
- func: "run tests"
603-
604-
- name: "test-3.6-replica_set"
605-
tags: ["3.6", "replica_set"]
606-
commands:
607-
- func: "bootstrap mongo-orchestration"
608-
vars:
609-
VERSION: "3.6"
610-
TOPOLOGY: "replica_set"
611-
- func: "run tests"
612-
613-
- name: "test-3.6-sharded_cluster"
614-
tags: ["3.6", "sharded_cluster"]
615-
commands:
616-
- func: "bootstrap mongo-orchestration"
617-
vars:
618-
VERSION: "3.6"
619-
TOPOLOGY: "sharded_cluster"
620-
- func: "run tests"
621-
622-
- name: "test-4.0-standalone"
623-
tags: ["4.0", "standalone"]
460+
- name: "test-standalone"
461+
tags: ["standalone"]
624462
commands:
625463
- func: "compile driver"
626464
- func: "bootstrap mongo-orchestration"
627465
vars:
628-
VERSION: "4.0"
629-
TOPOLOGY: "server"
466+
TOPOLOGY: "standalone"
467+
CONFIG: "standalone.json"
630468
- func: "run tests"
631469

632-
- name: "test-4.0-replica_set"
633-
tags: ["4.0", "replica_set"]
470+
- name: "test-replicaset"
471+
tags: ["replicaset"]
634472
commands:
635473
- func: "compile driver"
636474
- func: "bootstrap mongo-orchestration"
637475
vars:
638-
VERSION: "4.0"
639476
TOPOLOGY: "replica_set"
477+
CONFIG: "replicaset.json"
640478
- func: "run tests"
641479

642-
- name: "test-4.0-sharded_cluster"
643-
tags: ["4.0", "sharded_cluster"]
480+
- name: "test-sharded"
481+
tags: ["sharded"]
644482
commands:
645483
- func: "compile driver"
646484
- func: "bootstrap mongo-orchestration"
647485
vars:
648-
VERSION: "4.0"
649-
TOPOLOGY: "sharded_cluster"
650-
- func: "run tests"
651-
652-
- name: "test-latest-standalone"
653-
tags: ["latest", "standalone"]
654-
commands:
655-
- func: "bootstrap mongo-orchestration"
656-
vars:
657-
VERSION: "latest"
658-
TOPOLOGY: "server"
659-
- func: "run tests"
660-
661-
- name: "test-latest-replica_set"
662-
tags: ["latest", "replica_set"]
663-
commands:
664-
- func: "bootstrap mongo-orchestration"
665-
vars:
666-
VERSION: "latest"
667-
TOPOLOGY: "replica_set"
668-
- func: "run tests"
669-
670-
- name: "test-latest-sharded_cluster"
671-
tags: ["latest", "sharded_cluster"]
672-
commands:
673-
- func: "bootstrap mongo-orchestration"
674-
vars:
675-
VERSION: "latest"
676486
TOPOLOGY: "sharded_cluster"
487+
CONFIG: "cluster.json"
677488
- func: "run tests"
678489

679490
# }}}
@@ -728,30 +539,6 @@ axes:
728539
variables:
729540
TOPOLOGY: "sharded_cluster"
730541

731-
- id: auth
732-
display_name: Authentication
733-
values:
734-
- id: auth
735-
display_name: Auth
736-
variables:
737-
AUTH: "auth"
738-
- id: noauth
739-
display_name: NoAuth
740-
variables:
741-
AUTH: "noauth"
742-
743-
- id: ssl
744-
display_name: SSL
745-
values:
746-
- id: ssl
747-
display_name: SSL
748-
variables:
749-
SSL: "ssl"
750-
- id: nossl
751-
display_name: NoSSL
752-
variables:
753-
SSL: "nossl"
754-
755542
- id: storage-engine
756543
display_name: Storage
757544
values:
@@ -772,9 +559,9 @@ axes:
772559
buildvariants:
773560

774561
- matrix_name: "tests-os-requires-40"
775-
matrix_spec: {"os-requires-40": "*", auth: "*", ssl: "*", "php-versions": "*" }
776-
display_name: "${php-versions} ${os-requires-40} ${auth} ${ssl}"
562+
matrix_spec: {"os-requires-40": "*", "versions": "*", "php-versions": "*" }
563+
display_name: "${php-versions} ${os-requires-40}: ${versions}"
777564
tasks:
778-
- name: "test-4.0-replica_set"
779-
- name: "test-4.0-sharded_cluster"
780-
- name: "test-4.0-standalone"
565+
- name: "test-standalone"
566+
- name: "test-replicaset"
567+
- name: "test-sharded"

.evergreen/run-orchestration.sh

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
#!/bin/sh
2+
set -o xtrace # Write all commands first to stderr
3+
set -o errexit # Exit the script with error if any of the commands fail
4+
5+
6+
AUTH=${AUTH:-noauth}
7+
SSL=${SSL:-nossl}
8+
TOPOLOGY=${TOPOLOGY:-server}
9+
STORAGE_ENGINE=${STORAGE_ENGINE}
10+
MONGODB_VERSION=${MONGODB_VERSION:-latest}
11+
12+
DL_START=$(date +%s)
13+
DIR=$(dirname $0)
14+
# Functions to fetch MongoDB binaries
15+
. ${DRIVER_TOOLS}/.evergreen/download-mongodb.sh
16+
17+
get_distro
18+
if [ -z "$MONGODB_DOWNLOAD_URL" ]; then
19+
get_mongodb_download_url_for "$DISTRO" "$MONGODB_VERSION"
20+
else
21+
# Even though we have the MONGODB_DOWNLOAD_URL, we still call this to get the proper EXTRACT variable
22+
get_mongodb_download_url_for "$DISTRO"
23+
fi
24+
download_and_extract "$MONGODB_DOWNLOAD_URL" "$EXTRACT"
25+
26+
DL_END=$(date +%s)
27+
MO_START=$(date +%s)
28+
29+
export ORCHESTRATION_FILE="$PROJECT_DIRECTORY/scripts/presets/travis/${TOPOLOGY}"
30+
export ORCHESTRATION_URL="http://localhost:8889/v1/${TOPOLOGY}s"
31+
32+
# Start mongo-orchestration
33+
sh ${DRIVER_TOOLS}/start-orchestration.sh "$MONGO_ORCHESTRATION_HOME"
34+
35+
pwd
36+
curl --silent --show-error --data @"$ORCHESTRATION_FILE" "$ORCHESTRATION_URL" --max-time 600 --fail -o tmp.json
37+
cat tmp.json
38+
URI=$(python -c 'import sys, json; j=json.load(open("tmp.json")); print(j["mongodb_auth_uri" if "mongodb_auth_uri" in j else "mongodb_uri"])' | tr -d '\r')
39+
echo 'MONGODB_URI: "'$URI'"' > mo-expansion.yml
40+
echo "Cluster URI: $URI"
41+
42+
MO_END=$(date +%s)
43+
MO_ELAPSED=$(expr $MO_END - $MO_START)
44+
DL_ELAPSED=$(expr $DL_END - $DL_START)
45+
cat <<EOT >> $DRIVERS_TOOLS/results.json
46+
{"results": [
47+
{
48+
"status": "PASS",
49+
"test_file": "Orchestration",
50+
"start": $MO_START,
51+
"end": $MO_END,
52+
"elapsed": $MO_ELAPSED
53+
},
54+
{
55+
"status": "PASS",
56+
"test_file": "Download MongoDB",
57+
"start": $DL_START,
58+
"end": $DL_END,
59+
"elapsed": $DL_ELAPSED
60+
}
61+
]}
62+
63+
EOT

0 commit comments

Comments
 (0)