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

Significant terms test refactor for extendability #75452

Merged
merged 3 commits into from
Jul 21, 2021

Conversation

benwtrent
Copy link
Member

The original PR #75264 made some test mistakes

NXY Significant term heuristics have additional values that need to be set when testing
basicScore properties.

Additionally, previous refactor kept the abstract test class in a package that other plugins
don't have access to.

closes #75442

@benwtrent benwtrent added >test Issues or PRs that are addressing/adding tests :Analytics/Aggregations Aggregations v8.0.0 v7.15.0 labels Jul 19, 2021
@benwtrent benwtrent requested a review from not-napoleon July 19, 2021 12:16
@elasticmachine elasticmachine added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label Jul 19, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-analytics-geo (Team:Analytics)

Copy link
Member

@not-napoleon not-napoleon left a comment

Choose a reason for hiding this comment

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

This looks okay to me. I left a couple of notes on javadoc I'd like to see expanded a bit though.

public void testAssertions() {
testBackgroundAssertions(new ChiSquare(true, true), new ChiSquare(true, false));
protected SignificanceHeuristic getHeuristic(boolean includeNegatives, boolean backgroundIsSuperset) {
return new ChiSquare(includeNegatives, backgroundIsSuperset);
}
Copy link
Member

Choose a reason for hiding this comment

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

...okay github, that's an interesting way to interpret that change

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah, sorry :(. It looked cleaner on a local git diff

Copy link
Member

Choose a reason for hiding this comment

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

Not your fault. I think github optimizes for minimal edit distance, not fewest lines changed. I got the point though, and that's all that matters.

import org.elasticsearch.search.aggregations.bucket.terms.heuristic.SignificanceHeuristic;

/**
* Abstract test case for testing significant term heuristics
Copy link
Member

Choose a reason for hiding this comment

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

Maybe a little more detail here? What makes the NXY version different than plain old AbstractSignigicanceHeuristicTestCase. What does NXY even mean 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.

I wish I knew what NXY meant, but that is what they are called...Will add some stuff.

Copy link
Member

Choose a reason for hiding this comment

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

:lolsob: Well, at least I'm not the only one.


/**
* @param includeNegatives value for this test run
* @param backgroundIsSuperset value for this test run
Copy link
Member

Choose a reason for hiding this comment

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

Again, I think a little more detail would be helpful. Think about reading this as a new developer coming to this code. Include negative what? What does backgroundIsSuperset mean? Superset of what?

Copy link
Member Author

@benwtrent benwtrent Jul 20, 2021

Choose a reason for hiding this comment

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

backgroundIsSuperset is that its the super set of the "subset". Otherwise they are treated as two disjoint sets. Will add some better javadocs.

@benwtrent benwtrent merged commit 9b88db7 into elastic:master Jul 21, 2021
@benwtrent benwtrent deleted the tests/sigterms-heuristic branch July 21, 2021 12:12
elasticsearchmachine pushed a commit that referenced this pull request Jul 21, 2021
The original PR #75264 made some test mistakes

NXY Significant term heuristics have additional values that need to be set when testing
basicScore properties.

Additionally, previous refactor kept the abstract test class in a package that other plugins
don't have access to.

closes #75442, #75561
ywangd pushed a commit to ywangd/elasticsearch that referenced this pull request Jul 30, 2021
The original PR elastic#75264 made some test mistakes

NXY Significant term heuristics have additional values that need to be set when testing
basicScore properties.

Additionally, previous refactor kept the abstract test class in a package that other plugins
don't have access to.

closes elastic#75442, elastic#75561
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/Aggregations Aggregations Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) >test Issues or PRs that are addressing/adding tests v7.15.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CI] ChiSquareTests testBasicScoreProperties failing
4 participants