Skip to content

Commit

Permalink
Apply recent changes from PHPC config
Browse files Browse the repository at this point in the history
This moves templates and generated files to separate folders and changes the loadbalanced tests to use its own topology instead of "sharded".
  • Loading branch information
alcaeus committed Oct 13, 2023
1 parent e213255 commit 310ed92
Show file tree
Hide file tree
Showing 39 changed files with 102 additions and 91 deletions.
67 changes: 33 additions & 34 deletions .evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@ command_type: system
# Fail builds when pre tasks fail.
pre_error_fails_task: true

# Protect ourselves against rogue test case that runs forever
# Good rule of thumb: the average length a task takes, times 5, which roughly accounts for variable system performance
# for various build variants
exec_timeout_secs: 1800
# Protect ourselves against rogue test case that runs forever. Tasks are killed after 10 minutes, which shouldn't occur
# under normal circumstances.
exec_timeout_secs: 600

# These pre and post rules apply to all tasks not part of a task group, which should only ever be tests against local
# MongoDB instances. All other tasks that require special preparation should be run from within a task group
Expand Down Expand Up @@ -51,33 +50,33 @@ include:
- filename: .evergreen/config/test-variants.yml

# Automatically generated files
- filename: .evergreen/config/build/build-php-8.2.yml
- filename: .evergreen/config/build/build-php-8.1.yml
- filename: .evergreen/config/build/build-php-8.0.yml
- filename: .evergreen/config/build/build-php-7.4.yml
- filename: .evergreen/config/test/local-latest.yml
- filename: .evergreen/config/test/local-rapid.yml
- filename: .evergreen/config/test/local-7.0.yml
- filename: .evergreen/config/test/local-6.0.yml
- filename: .evergreen/config/test/local-5.0.yml
- filename: .evergreen/config/test/local-4.4.yml
- filename: .evergreen/config/test/local-4.2.yml
- filename: .evergreen/config/test/local-4.0.yml
- filename: .evergreen/config/test/local-3.6.yml
- filename: .evergreen/config/test/load-balanced-latest.yml
- filename: .evergreen/config/test/load-balanced-rapid.yml
- filename: .evergreen/config/test/load-balanced-7.0.yml
- filename: .evergreen/config/test/load-balanced-6.0.yml
- filename: .evergreen/config/test/load-balanced-5.0.yml
- filename: .evergreen/config/test/require-api-version-latest.yml
- filename: .evergreen/config/test/require-api-version-rapid.yml
- filename: .evergreen/config/test/require-api-version-7.0.yml
- filename: .evergreen/config/test/require-api-version-6.0.yml
- filename: .evergreen/config/test/require-api-version-5.0.yml
- filename: .evergreen/config/test/csfle-latest.yml
- filename: .evergreen/config/test/csfle-rapid.yml
- filename: .evergreen/config/test/csfle-7.0.yml
- filename: .evergreen/config/test/csfle-6.0.yml
- filename: .evergreen/config/test/csfle-5.0.yml
- filename: .evergreen/config/test/csfle-4.4.yml
- filename: .evergreen/config/test/csfle-4.2.yml
- filename: .evergreen/config/generated/build/build-php-8.2.yml
- filename: .evergreen/config/generated/build/build-php-8.1.yml
- filename: .evergreen/config/generated/build/build-php-8.0.yml
- filename: .evergreen/config/generated/build/build-php-7.4.yml
- filename: .evergreen/config/generated/test/local-latest.yml
- filename: .evergreen/config/generated/test/local-rapid.yml
- filename: .evergreen/config/generated/test/local-7.0.yml
- filename: .evergreen/config/generated/test/local-6.0.yml
- filename: .evergreen/config/generated/test/local-5.0.yml
- filename: .evergreen/config/generated/test/local-4.4.yml
- filename: .evergreen/config/generated/test/local-4.2.yml
- filename: .evergreen/config/generated/test/local-4.0.yml
- filename: .evergreen/config/generated/test/local-3.6.yml
- filename: .evergreen/config/generated/test/load-balanced-latest.yml
- filename: .evergreen/config/generated/test/load-balanced-rapid.yml
- filename: .evergreen/config/generated/test/load-balanced-7.0.yml
- filename: .evergreen/config/generated/test/load-balanced-6.0.yml
- filename: .evergreen/config/generated/test/load-balanced-5.0.yml
- filename: .evergreen/config/generated/test/require-api-version-latest.yml
- filename: .evergreen/config/generated/test/require-api-version-rapid.yml
- filename: .evergreen/config/generated/test/require-api-version-7.0.yml
- filename: .evergreen/config/generated/test/require-api-version-6.0.yml
- filename: .evergreen/config/generated/test/require-api-version-5.0.yml
- filename: .evergreen/config/generated/test/csfle-latest.yml
- filename: .evergreen/config/generated/test/csfle-rapid.yml
- filename: .evergreen/config/generated/test/csfle-7.0.yml
- filename: .evergreen/config/generated/test/csfle-6.0.yml
- filename: .evergreen/config/generated/test/csfle-5.0.yml
- filename: .evergreen/config/generated/test/csfle-4.4.yml
- filename: .evergreen/config/generated/test/csfle-4.2.yml
39 changes: 26 additions & 13 deletions .evergreen/config/generate-config.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,23 @@
<?php

// Supported PHP versions. Add new versions to the beginning of the list
$supportedPhpVersions = ['8.2', '8.1', '8.0', '7.4'];
$supportedPhpVersions = [
'8.2',
'8.1',
'8.0',
'7.4'
];

// Supported MongoDB versions. Add new versions after "rapid"
$supportedMongoDBVersions = [
'latest', 'rapid',
'7.0', '6.0', '5.0',
'4.4', '4.2', '4.0',
'latest',
'rapid',
'7.0',
'6.0',
'5.0',
'4.4',
'4.2',
'4.0',
'3.6',
];

Expand All @@ -33,13 +43,13 @@
$allFiles = [];

// Build tasks
$allFiles[] = generateConfigs('build', 'phpVersion', '_template-build-extension.yml', 'build-php-%s', $supportedPhpVersions);
$allFiles[] = generateConfigs('build', 'phpVersion', 'build-extension.yml', 'build-php-%s', $supportedPhpVersions);

// Test tasks
$allFiles[] = generateConfigs('test', 'mongodbVersion', '_template-local.yml', 'local-%s', $localServerVersions);
$allFiles[] = generateConfigs('test', 'mongodbVersion', '_template-load-balanced.yml', 'load-balanced-%s', $loadBalancedServerVersions);
$allFiles[] = generateConfigs('test', 'mongodbVersion', '_template-require-api-version.yml', 'require-api-version-%s', $requireApiServerVersions);
$allFiles[] = generateConfigs('test', 'mongodbVersion', '_template-csfle.yml', 'csfle-%s', $csfleServerVersions);
$allFiles[] = generateConfigs('test', 'mongodbVersion', 'local.yml', 'local-%s', $localServerVersions);
$allFiles[] = generateConfigs('test', 'mongodbVersion', 'load-balanced.yml', 'load-balanced-%s', $loadBalancedServerVersions);
$allFiles[] = generateConfigs('test', 'mongodbVersion', 'require-api-version.yml', 'require-api-version-%s', $requireApiServerVersions);
$allFiles[] = generateConfigs('test', 'mongodbVersion', 'csfle.yml', 'csfle-%s', $csfleServerVersions);

echo "Generated config. Use the following list to import files:\n";
echo implode("\n", array_map('getImportConfig', array_merge(...$allFiles))) . "\n";
Expand All @@ -56,13 +66,17 @@ function generateConfigs(
string $outputFormat,
array $versions,
): array {
$template = file_get_contents(__DIR__ . '/' . $directory . '/' . $templateFile);
$header = '# This file is generated automatically - please edit the corresponding template file!';
$templateRelativePath = 'templates/' . $directory . '/' . $templateFile;
$template = file_get_contents(__DIR__ . '/' . $templateRelativePath);
$header = sprintf(
'# This file is generated automatically - please edit the "%s" template file instead.',
$templateRelativePath
);

$files = [];

foreach ($versions as $version) {
$filename = sprintf('/%s/' . $outputFormat . '.yml', $directory, $version);
$filename = sprintf('/generated/%s/' . $outputFormat . '.yml', $directory, $version);
$files[] = '.evergreen/config' . $filename;

$replacements = ['%' . $replacementName . '%' => $version];
Expand All @@ -72,4 +86,3 @@ function generateConfigs(

return $files;
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
tasks:
- name: "test-mongodb-%mongodbVersion%-loadbalanced"
tags: ["sharded", "local", "%mongodbVersion%", "loadbalanced"]
tags: ["loadbalanced", "local", "%mongodbVersion%"]
commands:
- func: "bootstrap mongo-orchestration"
vars:
Expand Down
File renamed without changes.
2 changes: 2 additions & 0 deletions .evergreen/config/test-variants.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ buildvariants:
- ".standalone .local !.3.6 !.4.0 !.4.2 !.4.4 !.5.0"
- ".replicaset .local !.csfle !.3.6 !.4.0 !.4.2 !.4.4 !.5.0"
- ".sharded .local !.3.6 !.4.0 !.4.2 !.4.4 !.5.0"
- ".loadbalanced .local !.3.6 !.4.0 !.4.2 !.4.4 !.5.0"
- ".serverless"
- "test-atlas-data-lake"
- name: test-debian92-php82-local
Expand All @@ -37,6 +38,7 @@ buildvariants:
- ".standalone .local !.6.0 !.7.0 !.rapid !.latest"
- ".replicaset .local !.csfle !.6.0 !.7.0 !.rapid !.latest"
- ".sharded .local !.6.0 !.7.0 !.rapid !.latest"
- ".loadbalanced .local !.6.0 !.7.0 !.rapid !.latest"

# Test remaining PHP versions with replica sets on Debian 11 with MongoDB 7.0
- name: test-debian11-php81-local
Expand Down
5 changes: 1 addition & 4 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,4 @@ psalm.xml.dist export-ignore
psalm-baseline.xml export-ignore

# Prevent generated build files from showing diffs in pull requests
.evergreen/config/build/*.yml linguist-generated=true
.evergreen/config/build/_template*.yml linguist-generated=false
.evergreen/config/test/*.yml linguist-generated=true
.evergreen/config/test/_template*.yml linguist-generated=false
.evergreen/config/generated/** linguist-generated=true

0 comments on commit 310ed92

Please sign in to comment.