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

Test pipeline run after reroute #108693

Merged

Conversation

parkertimmins
Copy link
Contributor

Add a yaml rest test to verify that after a reroute
the destination index's default pipeline is run.

Also, fix the preceding existing test to match its description.

Add a yaml rest test to verify that after a reroute
the destination index's default pipeline is run
Based on test description and an unused pipeline
it appears that the index document should be
initial sent to a different index.
@parkertimmins parkertimmins self-assigned this May 15, 2024
@parkertimmins parkertimmins added >enhancement :Data Management/Ingest Node Execution or management of Ingest Pipelines including GeoIP labels May 15, 2024
@elasticsearchmachine
Copy link
Collaborator

Hi @parkertimmins, I've created a changelog YAML for you.

@@ -121,7 +121,7 @@ teardown:
- do:
index:
refresh: true
index: logs-nginx-default
index: logs-router-default
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Based on the test name and the fact that the logs-router pipeline is unused, I suspect this is the intended index name.

@parkertimmins parkertimmins marked this pull request as ready for review May 15, 2024 19:42
@elasticsearchmachine
Copy link
Collaborator

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

@elasticsearchmachine elasticsearchmachine added the Team:Data Management Meta label for data/management team label May 15, 2024
@@ -139,3 +139,66 @@ teardown:
query:
match: {"_id": "example-log"}
- match: { hits.hits.0._source.message: "this is an error log" }

---
"Test pipeline run after reroute":
Copy link
Contributor Author

Choose a reason for hiding this comment

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

With the fix to the previous test, that test does cover what this is testing. But I still think it's worth having this simpler test to confirm the behavior.

@parkertimmins parkertimmins requested review from a team as code owners May 17, 2024 14:40
@parkertimmins parkertimmins force-pushed the test-pipeline-run-after-reroute branch from d7443de to 96effcd Compare May 17, 2024 14:48
parkertimmins and others added 6 commits May 17, 2024 14:08
Cleanup yaml test by deleting pipelines in teardown.
Keeping pipeline around was breaking test in 15_ingest_info
due to using the same pipeline. Also delete indices which
have pipelines set as default
The pipelines don't end in '-default', but some of the indices do.
@joegallo
Copy link
Contributor

I did a little tidying as a review, but in the process of that I ended up realizing the existing test was pretty far off from actually doing what it was intended to do (beyond the issue you'd already found). I rewrote it so that it does what it was intended to do (at least IMHO).

@@ -139,3 +168,73 @@ teardown:
query:
match: {"_id": "example-log"}
- match: { hits.hits.0._source.message: "this is an error log" }
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add to the pipelines and to this test clause so that there's the equivalent of these lines associated with this test, too?

  - match: { _source.added-in-pipeline-before-reroute : true }
  - match: { _source.added-in-pipeline-after-reroute : true }

That is, I want a set processor in each of the logs-router and logs-nginx pipelines, and a match against hits.hits.0 for each of the values that those set processors set. There's no need for the existing-field, that's already covered here by "this is an error log".

Copy link
Contributor

@joegallo joegallo left a comment

Choose a reason for hiding this comment

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

LGTM

@parkertimmins parkertimmins merged commit c5a3342 into elastic:main May 20, 2024
15 checks passed
@parkertimmins parkertimmins deleted the test-pipeline-run-after-reroute branch May 20, 2024 15:02
jedrazb pushed a commit to jedrazb/elasticsearch that referenced this pull request May 21, 2024
Add test confirming that pipelines are run after a reroute.
Fix test of two stage reroute. Delete pipelines during teardown
so as to not break other tests using name pipeline name.

Co-authored-by: Joe Gallo <joegallo@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Data Management/Ingest Node Execution or management of Ingest Pipelines including GeoIP >enhancement Team:Data Management Meta label for data/management team v8.15.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants