Skip to content

Migrate x-pack-deprecation REST tests #131444

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

Merged
merged 16 commits into from
Aug 12, 2025

Conversation

ldematte
Copy link
Contributor

@ldematte ldematte commented Jul 17, 2025

This PR migrates legacy rest tests in the x-pack deprecation module.

I tried to use the INTEG_TEST distribution and add just the basic modules needed (ml, data-streams, deprecation) but this way the indices are not persisted and the tests fails. Need more investigation to identify the set of required modules.

Also, I preferred not to move and "flatten" the project here, but maintain a separate "qa" sub-project, as the IT tests use two different test plugins, specific to this module.

@ldematte ldematte requested a review from a team July 17, 2025 13:18
@ldematte ldematte added :Core/Infra/Core Core issues without another label >refactoring auto-backport Automatically create backport pull requests when merged v9.1.1 v8.19.1 labels Jul 17, 2025
@elasticsearchmachine elasticsearchmachine added Team:Core/Infra Meta label for core/infra team v9.2.0 labels Jul 17, 2025
@elasticsearchmachine
Copy link
Collaborator

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

@ldematte ldematte requested a review from a team as a code owner July 17, 2025 13:23
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.

LGTM but one comment:

Also, I preferred not to move and "flatten" the project here, but maintain a separate "qa" sub-project, as the IT tests use two different test plugins, specific to this module.

Could we at least combine to two separate QA projects into one? I don't see any reason to keep them separate.

@rjernst
Copy link
Member

rjernst commented Jul 17, 2025

as the IT tests use two different test plugins

FWIW this is a big advantage of the new IT tests, that we can control plugins for the cluster per test suite. Moving the qa tests into one sourceset doesn't affect that, but does make the entire set of tests more discoverable together.

@ldematte
Copy link
Contributor Author

ldematte commented Jul 18, 2025

Could we at least combine to two separate QA projects into one? I don't see any reason to keep them separate.

Oh yes, definitely, I can do that.

FWIW this is a big advantage of the new IT tests, that we can control plugins for the cluster per test suite. Moving the qa tests into one sourceset doesn't affect that, but does make the entire set of tests more discoverable together.

What I cannot (or don't want) to do is to remove the QA sub-project altogether: keep me honest here and correct me if I'm wrong, but if I remove it and move everything under :x-pack:deprecation I have to find a new "home" for the plugins source. And I'm reluctant to do that in this case, because the plugins are very specific to these tests.

@ldematte
Copy link
Contributor Author

Could we at least combine to two separate QA projects into one? I don't see any reason to keep them separate.

Merged them. @mark-vieira still LG to you?

@mark-vieira
Copy link
Contributor

I'm pretty sure the module you need here is x-pack-stack, since it's what registers the logs-* index templates.

@ldematte
Copy link
Contributor Author

I'm pretty sure the module you need here is x-pack-stack, since it's what registers the logs-* index templates.

Tried to add it, still failing :/

@mark-vieira
Copy link
Contributor

I'm pretty sure the module you need here is x-pack-stack, since it's what registers the logs-* index templates.

Tried to add it, still failing :/

Same error or a different one? It's often a bit of a whack-a-mole with these things.

@ldematte
Copy link
Contributor Author

Exact same indexnotfoud exception: https://gradle-enterprise.elastic.co/s/ef6jzgb7p337w

@ClassRule
public static ElasticsearchCluster cluster = ElasticsearchCluster.local()
.distribution(DistributionType.DEFAULT)
.plugin("deprecation-plugin")
Copy link
Contributor

Choose a reason for hiding this comment

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

We should be installing this as a module not a plugin. Also, it should already be included in the default distro, so installing it as a plugin here is unnecessary. In fact, I'm surprised this even works and doesn't result in an error since we basically have this thing loaded twice.

@mark-vieira
Copy link
Contributor

Exact same indexnotfoud exception: https://gradle-enterprise.elastic.co/s/ef6jzgb7p337w

Hmm. Yeah, there's something registering that index. I would expect it to be the deprecation plugin itself. Perhaps the test is implicitly relying on something to trigger a deprecation and therefore create the index? I'm not sure.

@ldematte
Copy link
Contributor Author

ldematte commented Aug 5, 2025

After a lot of trial and error, I narrowed down the plugin (module) set:

clusterModules project(':modules:ingest-common')
  clusterModules project(':modules:mapper-extras')
  clusterModules project(':modules:data-streams')
  clusterModules project(xpackModule('stack'))
  clusterModules project(xpackModule('deprecation'))
  clusterModules project(xpackModule('ilm'))
  clusterModules project(xpackModule('ml'))
  clusterModules project(xpackModule('mapper-constant-keyword'))
  clusterModules project(xpackModule('wildcard'))
  clusterModules project(xpackModule('transform'))

Not trivial, but better than using the default distribution I think.

@ldematte ldematte merged commit 7c95c50 into elastic:main Aug 12, 2025
33 checks passed
@elasticsearchmachine
Copy link
Collaborator

💔 Backport failed

Status Branch Result
9.1
8.19 Commit could not be cherrypicked due to conflicts

You can use sqren/backport to manually backport by running backport --upstream elastic/elasticsearch --pr 131444

ldematte added a commit to ldematte/elasticsearch that referenced this pull request Aug 12, 2025
@ldematte ldematte deleted the refactor-xpack-deprecation-tests branch August 13, 2025 06:37
ldematte added a commit to ldematte/elasticsearch that referenced this pull request Aug 13, 2025
szybia added a commit to szybia/elasticsearch that referenced this pull request Aug 15, 2025
* upstream/8.19: (62 commits)
  Use consistent terminology for transport version resources/references (elastic#132882) (elastic#132898)
  Move inner records out of TransportVersionUtils (elastic#132872) (elastic#132886)
  Forward port release notes for v8.18.5 (elastic#132758)
  Add more transport version files validation (elastic#132373) (elastic#132777)
  Forward port release notes for v8.17.10 (elastic#132760)
  Refactor TransportVersion loading to support external consumers (elastic#132694) (elastic#132862)
  manual backporting| (elastic#132783)
  9.1 docs backports for 8.19 features (elastic#132605)
  Migrate x-pack-deprecation REST tests (elastic#131444) (elastic#132802)
  Update 8.19.1.asciidoc (elastic#132755)
  Update wolfi (versioned) (elastic#132752)
  Update 8.19.0.asciidoc (elastic#132754)
  Prune changelogs after 8.19.2 release
  Bump versions after 8.19.2 release
  Finalize release notes for v8.19.2
  Bump versions after 8.17.10 release
  Prune changelogs after 8.18.5 release
  Bump versions after 8.18.5 release
  Add release notes for v8.19.2 release (elastic#132696)
  [ML] Improve EIS auth call logs and fix revocation bug (elastic#132546) (elastic#132690)
  ...
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 :Core/Infra/Core Core issues without another label >refactoring Team:Core/Infra Meta label for core/infra team v8.19.3 v9.1.3 v9.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants