Skip to content

Add snapshot only test modules#61954

Merged
rjernst merged 6 commits intoelastic:masterfrom
rjernst:build_test_modules
Sep 4, 2020
Merged

Add snapshot only test modules#61954
rjernst merged 6 commits intoelastic:masterfrom
rjernst:build_test_modules

Conversation

@rjernst
Copy link
Copy Markdown
Member

@rjernst rjernst commented Sep 4, 2020

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 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`.
@elasticmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-core-infra (:Core/Infra/Build)

@elasticmachine elasticmachine added the Team:Core/Infra Meta label for core/infra team label Sep 4, 2020
@rjernst rjernst requested a review from mark-vieira September 4, 2020 02:47
Copy link
Copy Markdown
Contributor

@mark-vieira mark-vieira left a comment

Choose a reason for hiding this comment

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

Couple minor comments but LGTM.

static void setupRunnerTask(Project project, RestIntegTestTask testTask, SourceSet sourceSet) {
testTask.setTestClassesDirs(sourceSet.getOutput().getClassesDirs());
testTask.setClasspath(sourceSet.getRuntimeClasspath());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why is this no longer needed?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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) }) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Seems basing this on name is a little brittle. Is there no way to add arbitrary metadata to modules?

Copy link
Copy Markdown
Member Author

@rjernst rjernst Sep 4, 2020

Choose a reason for hiding this comment

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

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.

@rjernst
Copy link
Copy Markdown
Member Author

rjernst commented Sep 4, 2020

@elasticmachine run elasticsearch-ci/2

@rjernst rjernst merged commit a56952a into elastic:master Sep 4, 2020
@rjernst rjernst deleted the build_test_modules branch September 4, 2020 23:34
rjernst added a commit that referenced this pull request Sep 4, 2020
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`.
jimczi added a commit to jimczi/elasticsearch that referenced this pull request Sep 8, 2020
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
jimczi added a commit that referenced this pull request Sep 15, 2020
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
jimczi added a commit that referenced this pull request Sep 15, 2020
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
@mark-vieira mark-vieira added Team:Delivery Meta label for Delivery team and removed Team:Core/Infra Meta label for core/infra team labels Nov 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Delivery/Build Build or test infrastructure >enhancement Team:Delivery Meta label for Delivery team v7.10.0 v8.0.0-alpha1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants