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/add custom analyzer old versions #119759

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

drempapis
Copy link
Contributor

Create tests to cover archive-indices and searchable-snapshots created for versions v5/v6 containing a custom analyzer with standard-token-filter.

The test case

  1. Creates an index with a custom-analyzer in v5/v6
  2. Creates a snapshot of the index
  3. Restores the snapshot in version current-1 (currently 8)
  4. Upgrades the cluster to version current (currently 9)
  5. Verifies compatibility of the index.

The code in review #118154, fails to pass the test

@drempapis drempapis self-assigned this Jan 8, 2025
@elasticsearchmachine elasticsearchmachine added needs:triage Requires assignment of a team area label v9.0.0 labels Jan 8, 2025
@drempapis drempapis added >test Issues or PRs that are addressing/adding tests Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch :Search Foundations/Search Catch all for Search Foundations and removed needs:triage Requires assignment of a team area label labels Jan 8, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-search-foundations (Team:Search Foundations)

@drempapis drempapis requested review from javanna and benwtrent January 8, 2025 14:14
Copy link
Member

@benwtrent benwtrent left a comment

Choose a reason for hiding this comment

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

I like the clarity of the tests. I think the enum is a bit too much and we should simply use static final strings for the names.

/**
* This is a mapping to the created snapshot zip files, covering test cases for "old repositories"
*/
public enum Snapshot {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
public enum Snapshot {
/**
* Snapshot zip file names for archive and searchable snapshot tests
*/
public final class TestSnapshotCases {
//Index created in vES_5 - Basic mapping
public static final String ES_VERSION_5 = "5";
// Index created in vES_5 - Custom-Analyzer - standard token filter
public static final String ES_VERSION_5_STANDARD_TOKEN_FILTER = "5_custom_analyzer"
...
}

Let's make this a simple static class with some static string members. The descriptions are not anything more than what we could provide with a simple java comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Search Foundations/Search Catch all for Search Foundations Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch >test Issues or PRs that are addressing/adding tests v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants