| 1 |
#!/usr/bin/env python |
| 2 |
# |
| 3 |
# Copyright 2009-present MongoDB, Inc. |
| 4 |
# |
| 5 |
# Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 |
# you may not use this file except in compliance with the License. |
| 7 |
# You may obtain a copy of the License at |
| 8 |
# |
| 9 |
# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 |
# |
| 11 |
# Unless required by applicable law or agreed to in writing, software |
| 12 |
# distributed under the License is distributed on an "AS IS" BASIS, |
| 13 |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 |
# See the License for the specific language governing permissions and |
| 15 |
# limitations under the License. |
| 16 |
|
| 17 |
"""Generate C Driver's config.yml for Evergreen testing. |
| 18 |
|
| 19 |
We find that generating configuration from Python data structures is more |
| 20 |
legible than Evergreen's matrix syntax or a handwritten file. |
| 21 |
|
| 22 |
Requires the evergreen_config_generator package. |
| 23 |
""" |
| 24 |
|
| 25 |
from collections import OrderedDict as OD |
| 26 |
from os.path import dirname, normpath |
| 27 |
from os.path import join as joinpath |
| 28 |
|
| 29 |
from evergreen_config_generator import generate |
| 30 |
from evergreen_config_lib.functions import all_functions |
| 31 |
from evergreen_config_lib.taskgroups import all_task_groups |
| 32 |
from evergreen_config_lib.tasks import all_tasks |
| 33 |
from evergreen_config_lib.testazurekms import testazurekms_generate |
| 34 |
from evergreen_config_lib.testgcpkms import testgcpkms_generate |
| 35 |
from evergreen_config_lib.variants import all_variants |
| 36 |
|
| 37 |
task_groups = list(all_task_groups) |
| 38 |
testazurekms_generate(all_tasks, all_variants, task_groups) |
| 39 |
testgcpkms_generate(all_tasks, all_variants, task_groups) |
| 40 |
|
| 41 |
config = OD( |
| 42 |
[ |
| 43 |
('functions', all_functions), |
| 44 |
('tasks', all_tasks), |
| 45 |
('task_groups', task_groups), |
| 46 |
('buildvariants', all_variants), |
| 47 |
] |
| 48 |
) |
| 49 |
|
| 50 |
this_dir = dirname(__file__) |
| 51 |
generated_configs_dir = normpath(joinpath(this_dir, '../generated_configs')) |
| 52 |
generate(config, joinpath(generated_configs_dir, 'legacy-config.yml')) |