Allow choosing latest default codec (not random) [LUCENE-5874]
- Dominant language
- Java
- Stars
- 3.6k
- Forks
- 1.4k
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 88
Description
Within the Lucene/Solr tests, I can see that we want to widely test the various Lucene Codecs. And so a test can use a black-list `@SuppressCodecs` when certain codecs are known not to work with certain tests. But there is no white-list nor white-list by capabilities (e.g. saying you need term vectors that support payloads).
In external applications that are using the test infrastructure, this is annoying. An application generally wants to test with only the codec that ships as default with the particular Lucene version they use. Now sure, this could be done by using "-Dtests.codec=Lucene46" , or having your \@BeforeClass explicitly do Codec.setDefault(Codec.forName("Lucene46")). But in both these cases, you have to call out a specific version; you can't simply ask for whatever the latest is for the Lucene version you're using that's on your classpath. So what I propose is two things: a whitelist annotation \@LuceneTestCase.Codecs and a value "CURRENT" (to align with the LUCENE_CURRENT naming convention). In this way a test could use the latest Codec and not hit a random failure the first time around just because Lucene3x or some other old codec was chosen.
---
Migrated from [LUCENE-5874](https://issues.apache.org/jira/browse/LUCENE-5874) by David Smiley (@dsmiley), updated Aug 08 2014
Contributor guide
Research direction
Start by tracing the Lucene/Solr test infrastructure around @SuppressCodecs, Codec.setDefault, Codec.forName, and the tests.codec option. Define the @LuceneTestCase.Codecs whitelist and CURRENT behavior so external tests can select the latest default codec without naming a version, then verify that existing codec-selection tests still behave correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- search, testing-qa
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100