Skip to content

Add data-streams tests to restResourcesZip #130424

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 4 commits into from
Jul 3, 2025

Conversation

pquentin
Copy link
Member

@pquentin pquentin commented Jul 2, 2025

After running ./gradlew restResourcesZip, x-pack/rest-resources-zip/build/distributions/rest-resources-zip-9.2.0-SNAPSHOT.zip contains the new data stream tests.

@elasticsearchmachine elasticsearchmachine added needs:triage Requires assignment of a team area label v9.2.0 labels Jul 2, 2025
@pquentin pquentin added >non-issue :Data Management/Data streams Data streams and their lifecycles auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) v8.18.4 v9.1.1 v8.19.1 and removed needs:triage Requires assignment of a team area label labels Jul 2, 2025
@elasticsearchmachine elasticsearchmachine added the Team:Data Management Meta label for data/management team label Jul 2, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-data-management (Team:Data Management)

@@ -20,6 +20,7 @@ dependencies {
freeTests project(path: ':rest-api-spec', configuration: 'restTests')
freeTests project(path: ':modules:aggregations', configuration: 'restTests')
freeTests project(path: ':modules:analysis-common', configuration: 'restTests')
freeTests project(path: ':modules:data-streams', configuration: 'basicRestSpecs')
Copy link
Contributor

Choose a reason for hiding this comment

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

I only exposed these YAML tests in 1fd8a8b for the multi-project work, and these changes are temporary - in the future we'll run these tests in MP mode directly, instead of including them in a dedicated MP suite. Therefore, I'm inclined to say we shouldn't have this line here. However, that does beg the question of whether these tests are currently included or not. Do you know if there's a way we can determine whether that's the case? TBH, I'm not really sure what this rest-resources-zip is used for exactly. A lot of modules seem to be missing here.

Copy link
Member Author

Choose a reason for hiding this comment

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

rest-resources-zip is only used for https://github.com/elastic/elasticsearch-specification validation where we run a subset of YAML tests separately from the Elasticsearch YAML test runner. I'm adding modules and plugins one by one because each new one adds a lot of work on our side.

Is there a better way to add data stream YAML tests to rest-resources-zip?

Copy link
Member

Choose a reason for hiding this comment

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

I believe rest-resources-zip is used for testing the elasticsearch-specification project.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, thanks both!

Is there a better way to add data stream YAML tests to rest-resources-zip?

This looks like the way to me. I think I'd be inclined to rename the artifact to restTests for consistency with the other artifacts you've added. That would look something like this:

diff --git a/modules/data-streams/build.gradle b/modules/data-streams/build.gradle
index b5fcae8115c..51bb04185cf 100644
--- a/modules/data-streams/build.gradle
+++ b/modules/data-streams/build.gradle
@@ -87,7 +87,7 @@ tasks.named("yamlRestCompatTestTransform").configure({ task ->
 })
 
 configurations {
-  basicRestSpecs {
+  restTests {
     attributes {
       attribute(ArtifactTypeDefinition.ARTIFACT_TYPE_ATTRIBUTE, ArtifactTypeDefinition.DIRECTORY_TYPE)
     }
@@ -95,5 +95,5 @@ configurations {
 }
 
 artifacts {
-  basicRestSpecs(new File(projectDir, "src/yamlRestTest/resources/rest-api-spec/test"))
+  restTests(new File(projectDir, "src/yamlRestTest/resources/rest-api-spec/test"))
 }
diff --git a/x-pack/qa/multi-project/core-rest-tests-with-multiple-projects/build.gradle b/x-pack/qa/multi-project/core-rest-tests-with-multiple-projects/build.gradle
index 2d33cccb00b..80602818356 100644
--- a/x-pack/qa/multi-project/core-rest-tests-with-multiple-projects/build.gradle
+++ b/x-pack/qa/multi-project/core-rest-tests-with-multiple-projects/build.gradle
@@ -28,7 +28,7 @@ dependencies {
   clusterModules project(xpackModule('mapper-constant-keyword'))
   clusterModules project(xpackModule('wildcard'))
   clusterModules project(':test:external-modules:test-multi-project')
-  restTestConfig project(path: ':modules:data-streams', configuration: "basicRestSpecs")
+  restTestConfig project(path: ':modules:data-streams', configuration: "restTests")
   restTestConfig project(path: ':modules:ingest-common', configuration: "basicRestSpecs")
   restTestConfig project(path: ':modules:reindex', configuration: "basicRestSpecs")
   restTestConfig project(path: ':modules:streams', configuration: "basicRestSpecs")

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks, done!

@pquentin pquentin added auto-backport Automatically create backport pull requests when merged and removed auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) labels Jul 2, 2025
@nielsbauman
Copy link
Contributor

Just a heads-up: you'll have some conflicts because I only added that artifact for multi-project in version 9.1, so you'll have to add the artifact yourself in the backported commits.

Copy link
Contributor

@nielsbauman nielsbauman 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 @pquentin!

@pquentin pquentin merged commit f99cf38 into elastic:main Jul 3, 2025
31 checks passed
pquentin added a commit to pquentin/elasticsearch that referenced this pull request Jul 3, 2025
* Add data-streams tests to restResourcesZip

* Rename to restTests
@elasticsearchmachine
Copy link
Collaborator

💔 Backport failed

Status Branch Result
8.18 Commit could not be cherrypicked due to conflicts
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 130424

elasticsearchmachine pushed a commit that referenced this pull request Jul 3, 2025
* Add data-streams tests to restResourcesZip

* Rename to restTests
mridula-s109 pushed a commit to mridula-s109/elasticsearch that referenced this pull request Jul 3, 2025
* Add data-streams tests to restResourcesZip

* Rename to restTests
@pquentin
Copy link
Member Author

pquentin commented Jul 3, 2025

💚 All backports created successfully

Status Branch Result
8.19
8.18

Questions ?

Please refer to the Backport tool documentation

pquentin added a commit to pquentin/elasticsearch that referenced this pull request Jul 3, 2025
* Add data-streams tests to restResourcesZip

* Rename to restTests

(cherry picked from commit f99cf38)

# Conflicts:
#	modules/data-streams/build.gradle
#	x-pack/qa/multi-project/core-rest-tests-with-multiple-projects/build.gradle
pquentin added a commit to pquentin/elasticsearch that referenced this pull request Jul 3, 2025
* Add data-streams tests to restResourcesZip

* Rename to restTests

(cherry picked from commit f99cf38)

# Conflicts:
#	modules/data-streams/build.gradle
#	x-pack/qa/multi-project/core-rest-tests-with-multiple-projects/build.gradle
pquentin added a commit that referenced this pull request Jul 3, 2025
* Add data-streams tests to restResourcesZip

* Rename to restTests

(cherry picked from commit f99cf38)

# Conflicts:
#	modules/data-streams/build.gradle
#	x-pack/qa/multi-project/core-rest-tests-with-multiple-projects/build.gradle
pquentin added a commit that referenced this pull request Jul 3, 2025
* Add data-streams tests to restResourcesZip

* Rename to restTests

(cherry picked from commit f99cf38)

# Conflicts:
#	modules/data-streams/build.gradle
#	x-pack/qa/multi-project/core-rest-tests-with-multiple-projects/build.gradle
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 backport pending :Data Management/Data streams Data streams and their lifecycles >non-issue Team:Data Management Meta label for data/management team v8.18.4 v8.19.1 v9.1.1 v9.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants