Skip to content
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

Fix constand_keyword test run and properly test recent behavior change #117284

Merged
merged 5 commits into from
Nov 22, 2024

Conversation

lkts
Copy link
Contributor

@lkts lkts commented Nov 21, 2024

This is a follow-up to #117182.

That PR didn't change yaml tests since they were not running and didn't introduce a test feature. Tests didn't run because legacy yaml rest tests don't provide tests features and the test was using previously introduced mapper.source.mode_from_index_setting. As a result this test was always skipped.

This PR introduces new test feature, fixes the test and migrates this project to proper yaml test runner.

@lkts lkts added >non-issue auto-backport Automatically create backport pull requests when merged :StorageEngine/Mapping The storage related side of mappings v8.18.0 labels Nov 21, 2024
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-storage-engine (Team:StorageEngine)

* License v3.0 only", or the "Server Side Public License, v 1".
*/

module org.elasticsearch.xpack.constantkeyword {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am not confident in this files contents.

Copy link
Contributor

Choose a reason for hiding this comment

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

@rjernst is modularizing this plugin strictly necessary or is the services info file sufficient?

Copy link
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.

I'd confirm with @elastic/es-core-infra on the module stuff, but otherwise LGTM.

@@ -1,7 +1,8 @@
import org.elasticsearch.gradle.internal.info.BuildParams

apply plugin: 'elasticsearch.internal-es-plugin'
apply plugin: 'elasticsearch.legacy-yaml-rest-test'
apply plugin: 'elasticsearch.internal-yaml-rest-test'
apply plugin: 'elasticsearch.internal-test-artifact'
Copy link
Contributor

Choose a reason for hiding this comment

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

The test artifact plugin shouldn't be required here. This is only necessarily if another project needs to consume the tests of this project as an artifact dependency.

* License v3.0 only", or the "Server Side Public License, v 1".
*/

module org.elasticsearch.xpack.constantkeyword {
Copy link
Contributor

Choose a reason for hiding this comment

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

@rjernst is modularizing this plugin strictly necessary or is the services info file sufficient?

import java.util.Set;

public class ConstantKeywordFeatures implements FeatureSpecification {
public static final NodeFeature SYNTHETIC_SOURCE_WRITE_FIX = new NodeFeature("constant_keyword.synthetic_source_write_fix");
Copy link
Member

Choose a reason for hiding this comment

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

Can we add this to MapperFeatures instead? I think that should be okay, although the mapping type is in x-pack.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can i just thought this is cleaner.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because MapperFeatures can't depend on ConstantKeywordFieldMapper.

Copy link
Member

Choose a reason for hiding this comment

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

I think we can define a NodeFeature in MapperFeatures class?

Copy link
Member

Choose a reason for hiding this comment

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

But I am fine if we continue with this approach too.

@lkts lkts added the v8.17.0 label Nov 21, 2024
Copy link
Member

@dnhatn dnhatn left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks Sasha!

@lkts
Copy link
Contributor Author

lkts commented Nov 22, 2024

@elasticmachine update branch

@ldematte
Copy link
Contributor

the services info file sufficient?

It depends :) it would have been necessary (and sufficient) for tests that run un-modularized. Not 100% about rest tests; they run with a full cluster, so modular I think.
But I see it is gone :)

@lkts lkts merged commit dae59da into elastic:main Nov 22, 2024
16 checks passed
@lkts lkts deleted the fix-yaml-test-runs branch November 22, 2024 18:15
lkts added a commit to lkts/elasticsearch that referenced this pull request Nov 22, 2024
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
8.17
8.x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Automatically create backport pull requests when merged >non-issue :StorageEngine/Mapping The storage related side of mappings Team:StorageEngine v8.17.0 v8.18.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants