-
Notifications
You must be signed in to change notification settings - Fork 25.3k
Add lucene version compatibility tests #121104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
fdf77e0
0717359
83cb872
15be0a8
c60c486
c87720e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -102,6 +102,29 @@ private void registerInternalDistributionResolutions(List<DistributionResolution | |
} | ||
return null; | ||
})); | ||
|
||
// Distribution resolution for "override" versions. This allows for building from source for any version, including the current | ||
// version of existing released versions from a commit form the main branch. This is done by passing certain system properties, ex: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. minor, typo "... form the main branch" |
||
// | ||
// -Dtests.bwc.refspec.main=deadbeef -Dtests.bwc.main.version=9.0.0 | ||
// | ||
// The 'test.bwc.main.version' property should map to the version returned by the commit referenced in 'tests.bwc.refspec.main'. | ||
resolutions.add(new DistributionResolution("override", (project, distribution) -> { | ||
String versionProperty = System.getProperty("tests.bwc.main.version"); | ||
// We use this phony version as a placeholder for the real version | ||
if (distribution.getVersion().equals("0.0.0")) { | ||
BwcVersions.UnreleasedVersionInfo unreleasedVersionInfo = new BwcVersions.UnreleasedVersionInfo( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we want to assert that |
||
Version.fromString(versionProperty), | ||
"main", | ||
":distribution:bwc:main" | ||
); | ||
String projectConfig = getProjectConfig(distribution, unreleasedVersionInfo); | ||
return new ProjectBasedDistributionDependency( | ||
(config) -> projectDependency(project.getDependencies(), unreleasedVersionInfo.gradleProjectPath(), projectConfig) | ||
); | ||
} | ||
return null; | ||
})); | ||
} | ||
|
||
private boolean isCurrentVersion(ElasticsearchDistribution distribution) { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the "Elastic License | ||
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side | ||
* Public License v 1"; you may not use this file except in compliance with, at | ||
* your election, the "Elastic License 2.0", the "GNU Affero General Public | ||
* License v3.0 only", or the "Server Side Public License, v 1". | ||
*/ | ||
|
||
// This project is used only for overriding bwc distributions. See InternalDistributionDownloadPlugin for details. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ | |
* License v3.0 only", or the "Server Side Public License, v 1". | ||
*/ | ||
|
||
import org.elasticsearch.gradle.Version | ||
import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask | ||
|
||
apply plugin: 'elasticsearch.internal-java-rest-test' | ||
|
@@ -20,6 +21,13 @@ buildParams.bwcVersions.withIndexCompatible { bwcVersion, baseName -> | |
} | ||
} | ||
|
||
tasks.register("luceneBwcTest", StandaloneRestIntegTestTask) { | ||
// We use a phony version here as the real version is provided via `tests.bwc.main.version` system property | ||
usesBwcDistribution(Version.fromString("0.0.0")) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ha! this is a cute trick. Nice! |
||
systemProperty("tests.old_cluster_version", "0.0.0") | ||
onlyIf("tests.bwc.main.version system property exists") { System.getProperty("tests.bwc.main.version") != null } | ||
} | ||
|
||
tasks.withType(Test).configureEach { | ||
// CI doesn't like it when there's multiple clusters running at once | ||
maxParallelForks = 1 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we wanna coordinate on this commit hash, or just go with what is here and update it after the Lucene 10.1.0 upgrade has been merged?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tying testing to a specific commit is ok, yet I wonder if it would be possible in the future to tie to index version changes. I think that besides codec changes, we are totally lacking test coverage for index version changes that we make. And a codec change implies an index version change.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have to know what hash to checkout. So if we do based on index version we still have to have some mapping of version -> commit somewhere.