Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .buildkite/scripts/fwc-branches.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash

# Configure FwC test branches
# We do not want 7.x branch and only to run for branches that:
# - have released at least one minor version (not main)
# - have previous minor unreleased (not the oldest development branch)
FWC_BRANCHES=()
for branch in "${BRANCHES[@]}"; do
if [[ ! "$branch" =~ ^7\..* ]]; then
FWC_BRANCHES+=("$branch")
fi
done
# Remove first and last element
FWC_BRANCHES=("${FWC_BRANCHES[@]:1:${#FWC_BRANCHES[@]}-2}")

shouldRunFwcFor() {
local branch=$1
for fwc_branch in "${FWC_BRANCHES[@]}"; do
if [[ "$fwc_branch" == "$branch" ]]; then
return 0
fi
done
return 1
}
Comment on lines +16 to +24
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This now also changes on which branches the FwC tests will run.

4 changes: 2 additions & 2 deletions .buildkite/scripts/periodic.trigger.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ set -euo pipefail
echo "steps:"

source .buildkite/scripts/branches.sh
source .buildkite/scripts/fwc-branches.sh

IS_FIRST=true
SKIP_DELAY="${SKIP_DELAY:-false}"
Expand Down Expand Up @@ -46,8 +47,7 @@ EOF
branch: "$BRANCH"
commit: "$LAST_GOOD_COMMIT"
EOF
# Include forward compatibility tests only for the bugfix branch
if [[ "${BRANCH}" == "${BRANCHES[2]}" ]]; then
if shouldRunFwcFor "$BRANCH"; then
cat <<EOF
- trigger: elasticsearch-periodic-fwc
label: Trigger periodic-fwc pipeline for $BRANCH
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,23 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/

import org.elasticsearch.gradle.VersionProperties
import org.elasticsearch.gradle.Version
import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask

def fwcVersions = buildParams.bwcVersions.released.findAll { it.major == VersionProperties.elasticsearchVersion.major && it.minor == VersionProperties.elasticsearchVersion.minor }
def previousMinorSnapshot = buildParams.bwcVersions.unreleased.find { it.major == VersionProperties.elasticsearchVersion.major && it.minor == VersionProperties.elasticsearchVersion.minor - 1 }

fwcVersions.each { fwcVersion ->
tasks.register("v${fwcVersion}#fwcTest", StandaloneRestIntegTestTask) {
usesBwcDistribution(previousMinorSnapshot)
usesBwcDistribution(fwcVersion)
systemProperty("tests.old_cluster_version", previousMinorSnapshot)
systemProperty("tests.new_cluster_version", fwcVersion)
nonInputProperties.systemProperty 'tests.fwc', 'true'
Version elasticsearchVersion = Version.fromString(versions.get("elasticsearch"))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replaces the VersionProperties with extension defined by VersionPropertiesPlugin.

def fwcVersions = buildParams.bwcVersions.released.findAll { it.major == elasticsearchVersion.major && it.minor == elasticsearchVersion.minor }
def targetMajor = elasticsearchVersion.minor > 0 ? elasticsearchVersion.major : elasticsearchVersion.major - 1
def targetMinor = elasticsearchVersion.minor > 0 ? elasticsearchVersion.minor - 1 : buildParams.bwcVersions.unreleased.findAll { it.major == targetMajor }*.minor.max()
def previousMinorSnapshot = buildParams.bwcVersions.unreleased.find { it.major == targetMajor && it.minor == targetMinor }
if (previousMinorSnapshot != null) {
fwcVersions.each { fwcVersion ->
tasks.register("v${fwcVersion}#fwcTest", StandaloneRestIntegTestTask) {
usesBwcDistribution(previousMinorSnapshot)
usesBwcDistribution(fwcVersion)
systemProperty("tests.old_cluster_version", previousMinorSnapshot)
systemProperty("tests.new_cluster_version", fwcVersion)
nonInputProperties.systemProperty 'tests.fwc', 'true'
}
}
}

Expand Down