Add snapshot only test modules#61954
Conversation
This commit adds external test modules. These are modules meant for external systems to test edge cases in elasticsearch, but only within snapshots. They are not meant to be used in production, so protections are also added from their accidental inclusion in release builds. Note that this commit does not actually add any new modules, it only adds the infrastructure for the new modules, under `test/external-modules`.
|
Pinging @elastic/es-core-infra (:Core/Infra/Build) |
mark-vieira
left a comment
There was a problem hiding this comment.
Couple minor comments but LGTM.
| static void setupRunnerTask(Project project, RestIntegTestTask testTask, SourceSet sourceSet) { | ||
| testTask.setTestClassesDirs(sourceSet.getOutput().getClassesDirs()); | ||
| testTask.setClasspath(sourceSet.getRuntimeClasspath()); | ||
|
|
There was a problem hiding this comment.
Why is this no longer needed?
There was a problem hiding this comment.
The test task depending on the module is handled within testclusters now. The plugin extension dependsOn is handled inside PluginBuildPlugin.
| dependsOn "${module.path}:bundlePlugin" | ||
| from({ zipTree(module.bundlePlugin.outputs.files.singleFile) }) { | ||
| dependsOn moduleConfig | ||
| from({ zipTree(moduleConfig.singleFile) }) { |
There was a problem hiding this comment.
We should open an issue to use artifact transforms for this stuff as well so we don't have to keep doing this zipTree and singleFile nonsense. This is the same as the stuff @breskeby is working on to avoid a lot of unnecessary packing/unpacking in build processes.
| if (bundles.add(bundle) == false) { | ||
| throw new IllegalStateException("duplicate " + type + ": " + info); | ||
| } | ||
| if (type.equals("module") && info.getName().startsWith("test-") && Build.CURRENT.isSnapshot() == false) { |
There was a problem hiding this comment.
Seems basing this on name is a little brittle. Is there no way to add arbitrary metadata to modules?
There was a problem hiding this comment.
There is not. We can add to the plugin properties, but I did not want to add an "official" property here, as it is really only about modules, yet the properties apply to all plugins and modules. I think the name checking is fine for now, since we completely own the namespace of modules.
|
@elasticmachine run elasticsearch-ci/2 |
This commit adds external test modules. These are modules meant for external systems to test edge cases in elasticsearch, but only within snapshots. They are not meant to be used in production, so protections are also added from their accidental inclusion in release builds. Note that this commit does not actually add any new modules, it only adds the infrastructure for the new modules, under `test/external-modules`.
This change adds an aggregation that can be used to delay the
query phase execution on shards with a configurable time:
{
"aggs": {
"delay": {
"shard_delay": {
"value": "30s"
},
"aggs": {
"host": {
"terms": {
"field": "hostname"
}
}
}
}
}
}
This test module is built on top of elastic#61954 so the aggregation will be available only within
snapshots since this module is not meant to be used in production.
Closes elastic#54159
This change adds an aggregation that can be used to delay the
query phase execution on shards with a configurable time:
{
"aggs": {
"delay": {
"shard_delay": {
"value": "30s"
},
"aggs": {
"host": {
"terms": {
"field": "hostname"
}
}
}
}
}
}
This test module is built on top of #61954 so the aggregation will be available only within
snapshots since this module is not meant to be used in production.
Closes #54159
This change adds an aggregation that can be used to delay the
query phase execution on shards with a configurable time:
{
"aggs": {
"delay": {
"shard_delay": {
"value": "30s"
},
"aggs": {
"host": {
"terms": {
"field": "hostname"
}
}
}
}
}
}
This test module is built on top of #61954 so the aggregation will be available only within
snapshots since this module is not meant to be used in production.
Closes #54159
This commit adds external test modules. These are modules meant for
external systems to test edge cases in elasticsearch, but only within
snapshots. They are not meant to be used in production, so protections
are also added from their accidental inclusion in release builds.
Note that this commit does not actually add any new modules, it only
adds the infrastructure for the new modules, under
test/external-modules.