apache / apache/lucene

Clean up unit tests for TestDrillSideways [LUCENE-10044]

Open
#11,082 0 comments 0 reactions 0 assignees View on GitHub
affects-version:9.0 legacy-jira-priority:Minor module:facet type:test
Dominant language
Java
Stars
3.6k
Forks
1.4k
Avg merge
2d 11h
Merged PRs (30d)
88

Description

All unit tests in `TestDrillSideways` currently do the same task for priming a `DrillDownQuery` and a `DrillSidewaysResult`. I would like to extract the common code here for the initialisation and capture it in `DrillSidewaysInitialiser` - a helper class for writing unit tests which would initialise a `DrillSidewaysResult` while retaining members like `FacetsConfig` for future access.

Something similar has been implemented for `Document` creation in `DocHelper`.

---
Migrated from [LUCENE-10044](https://issues.apache.org/jira/browse/LUCENE-10044) by Sejal Pawar (@sejal-pawar)

Contributor guide

Open the contributing guide

Research direction

Start by reading the unit tests in TestDrillSideways and compare their repeated initialization of DrillDownQuery and DrillSidewaysResult. Review DocHelper for the existing Document-creation pattern, then extract the shared setup into DrillSidewaysInitialiser while retaining members such as FacetsConfig for later access. Done means the duplicated setup is centralized without changing test behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
testing
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.