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

Refactor metric PipelineAggregation integration test #77548

Merged

Conversation

iverase
Copy link
Contributor

@iverase iverase commented Sep 10, 2021

Follow up #77481, there are several pipeline aggregation integration test that seems to have been cloned and can easily be refactor in a test case.

This PR extract BucketMetricsPipeLineAggregationTestCase and simplifies the testing of several pipeline aggregations.

@elasticmachine elasticmachine added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label Sep 10, 2021
@elasticmachine
Copy link
Collaborator

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

Copy link
Member

@nik9000 nik9000 left a comment

Choose a reason for hiding this comment

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

This is great!

// so that there is an UnmappedTerms in the list to reduce.
createIndex("foo_1");

XContentBuilder builder = jsonBuilder().startObject()
Copy link
Member

Choose a reason for hiding this comment

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

Could fix this one's format while you are here? It looks like the kind of thing someone hand indented and then the auto-formatter zapped.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

umm, yes this is how spotless has formatted this code. What do you mean to fix the formatting? Once we are using spotless, I think it has the last word on 'correct' formatting :)

Copy link
Member

Choose a reason for hiding this comment

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

You can disable spotless for blocks or whole files via directives in the comments: // @formatter:off and // @formatter:on. We shouldn't overuse it, but formatting XContentBuilder is a good place for it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @not-napoleon, I formatted this bit of code.

Copy link
Member

Choose a reason for hiding this comment

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

I was thinking of splitting it into multiple lines or something. I dunno about spotless being the last word on formatting - if the code is hard to read we should do something.

@iverase
Copy link
Contributor Author

iverase commented Sep 15, 2021

ping @not-napoleon @nik9000 what needs to be done here?

Copy link
Member

@nik9000 nik9000 left a comment

Choose a reason for hiding this comment

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

I think it's good. Sorry, I hadn't noticed the changes.

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.

I'm also good with this if Nik is.

@iverase iverase merged commit 5143521 into elastic:master Sep 16, 2021
@iverase iverase deleted the BucketMetricsPipeLineAggregationTestCase branch September 16, 2021 05:46
@iverase iverase added the auto-backport Automatically create backport pull requests when merged label Sep 16, 2021
@elasticsearchmachine
Copy link
Collaborator

💔 Backport failed

Status Branch Result
7.x Commit could not be cherrypicked due to conflicts

You can use sqren/backport to manually backport by running backport --upstream elastic/elasticsearch --pr 77548

iverase added a commit to iverase/elasticsearch that referenced this pull request Sep 16, 2021
This commit extracts BucketMetricsPipeLineAggregationTestCase and simplifies the testing of several
pipeline aggregations.
iverase added a commit that referenced this pull request Sep 16, 2021
This commit extracts BucketMetricsPipeLineAggregationTestCase and simplifies the testing of several
pipeline aggregations.
wjp719 added a commit to wjp719/elasticsearch that referenced this pull request Sep 18, 2021
* master: (185 commits)
  Implement get and containsKey in terms of the wrapped innerMap (elastic#77965)
  Adjust Lucene version and enable BWC tests (elastic#77933)
  Disable BWC to upgrade to Lucene-8.10-snapshot
  Reenable MlDistributedFailureIT
  [DOCS] Fix typo for `script.painless.regex.enabled` setting value (elastic#77853)
  Upgrade to Lucene-8.10.0-snapshot-bf2fcb53079 (elastic#77801)
  [DOCS] Fix ESS install lead-in (elastic#77887)
  Resolve thirdparty gradle plugin artifacts from mavencentral (elastic#77865)
  Reduce the number of times that `LifecycleExecutionState` is parsed when running a policy. (elastic#77863)
  Utility methods to add and remove backing indices from data streams (elastic#77778)
  Use Objects.equals() instead of == to compare strings (elastic#77840)
  [ML] prefer least allocated model when a new node is added to the cluster (elastic#77756)
  Deprecate ignore_throttled parameter (elastic#77479)
  Improve LifecycleExecutionState parsing. (elastic#77855)
  [DOCS] Removes deprecated word from HLRC title. (elastic#77851)
  Remove legacy geo code from AggregationResultUtils (elastic#77702)
  Adjust SearchableSnapshotsBlobStoreCacheIntegTests.testBlobStoreCache (elastic#77758)
  Laxify SecureSM to allow creation of the JDK's innocuous threads (elastic#77789)
  [Test] Reduce concurrency when testing creation of security index (elastic#75293)
  Refactor metric PipelineAggregation integration test (elastic#77548)
  ...

# Conflicts:
#	server/src/main/java/org/elasticsearch/cluster/metadata/DataStream.java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/Aggregations Aggregations auto-backport Automatically create backport pull requests when merged >refactoring Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) v7.16.0 v8.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants