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

Implement getMutateFunction in all AbstractWireSerializingTestCase and AbstractStreamableTestCase subclasses #25929

Open
51 of 53 tasks
colings86 opened this issue Jul 27, 2017 · 5 comments
Labels
:Core/Infra/Core Core issues without another label help wanted adoptme Meta Team:Core/Infra Meta label for core/infra team >test Issues or PRs that are addressing/adding tests

Comments

@colings86
Copy link
Contributor

colings86 commented Jul 27, 2017

#25910 changed AbstractWireSerializingTestCase and AbstractStreamableTestCase to add a getMutateFunction method that is used when testing hashCode and equals to ensure that changing properties on the test instance makes it not equal to the original. At present this method defaults to returning null which disables the inequality checks (the equality checks are still run).

We should make getMutateFunction abstract so we force all subclasses to implement this method and so improve test coverage. Before we can do that we need to implement the method for the ~90 classes that already extend AbstractWireSerializingTestCase and AbstractStreamableTestCase. This issue serves to track the implementation of the method on those classes.

Subclasses of AbstractWireSerializingTestCase:

Subclasses of AbstractStreamableTestCase:

Cleanup

  • Make AbstractWireSerializingTestCase.mutateInstance() abstract
  • Make AbstractStreamableTestCase.mutateInstance() abstract
@colings86 colings86 added >test Issues or PRs that are addressing/adding tests v7.0.0 labels Jul 27, 2017
@colings86 colings86 self-assigned this Jul 27, 2017
@colings86 colings86 changed the title Implement getMutateFunction in all AbstractWireSerializingTestCase subclasses Implement getMutateFunction in all AbstractWireSerializingTestCase and AbstractStreamableTestCase subclasses Jul 27, 2017
@colings86 colings86 added the Meta label Jul 27, 2017
colings86 added a commit that referenced this issue Aug 2, 2017
* Adds mutate function to various tests

Relates to #25929

* fix test

* implements mutate function for all single bucket aggs

* review comments

* convert getMutateFunction to mutateIInstance
colings86 added a commit that referenced this issue Aug 2, 2017
* Adds mutate function to various tests

Relates to #25929

* fix test

* implements mutate function for all single bucket aggs

* review comments

* convert getMutateFunction to mutateIInstance
colings86 added a commit that referenced this issue Aug 2, 2017
* Adds mutate function to various tests

Relates to #25929

* fix test

* implements mutate function for all single bucket aggs

* review comments

* convert getMutateFunction to mutateIInstance
colings86 added a commit that referenced this issue Aug 7, 2017
* Adds mutate function for all metric aggregation tests

 Relates to #25929

* Fixes review comments
colings86 added a commit that referenced this issue Aug 7, 2017
* Adds mutate function for all metric aggregation tests

 Relates to #25929

* Fixes review comments
colings86 added a commit that referenced this issue Aug 7, 2017
* Adds mutate function for all metric aggregation tests

 Relates to #25929

* Fixes review comments
colings86 added a commit that referenced this issue Aug 7, 2017
* Adds mutate function for all metric aggregation tests

Relates to #25929

* fixes tests

* fixes review comments

* Fixes cardinality equals method

* Fixes scripted metric test
colings86 added a commit that referenced this issue Aug 7, 2017
* Adds mutate function for all metric aggregation tests

Relates to #25929

* fixes tests

* fixes review comments

* Fixes cardinality equals method

* Fixes scripted metric test
colings86 added a commit that referenced this issue Aug 7, 2017
* Adds mutate function for all metric aggregation tests

Relates to #25929

* fixes tests

* fixes review comments

* Fixes cardinality equals method

* Fixes scripted metric test
colings86 added a commit that referenced this issue Aug 8, 2017
* Adds mutate method to more tests

Relates to #25929

* fixes tests
colings86 added a commit that referenced this issue Aug 8, 2017
* Adds mutate method to more tests

Relates to #25929

* fixes tests
colings86 added a commit that referenced this issue Aug 8, 2017
* Adds mutate method to more tests

Relates to #25929

* fixes tests
@colings86 colings86 removed their assignment Nov 3, 2017
@colings86 colings86 added the :Core/Infra/Core Core issues without another label label Apr 24, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra

@polyfractal polyfractal removed the v7.0.0 label Apr 9, 2019
@jakelandis jakelandis added v7.3.0 and removed v7.2.0 labels Jun 17, 2019
@jpountz jpountz removed the v7.3.0 label Jul 5, 2019
@rjernst rjernst added the help wanted adoptme label Sep 24, 2019
@rjernst rjernst added the Team:Core/Infra Meta label for core/infra team label May 4, 2020
@rjernst rjernst added the needs:triage Requires assignment of a team area label label Dec 3, 2020
@jaymode jaymode removed the needs:triage Requires assignment of a team area label label Dec 14, 2020
fixmebot bot referenced this issue in VectorXz/elasticsearch Apr 22, 2021
fixmebot bot referenced this issue in VectorXz/elasticsearch May 28, 2021
fixmebot bot referenced this issue in VectorXz/elasticsearch Aug 4, 2021
@idegtiarenko
Copy link
Contributor

Should we make AbstractWireSerializingTestCase.mutateInstance() abstract now and implement with empty return null; in all remaining sub-classes? This way we would not accidentally introduce more test cases that are silently skipping instance mutation.

@rjernst
Copy link
Member

rjernst commented Jan 9, 2023

Are there new tests created since this issue was created? If so can they be added to the list in the original description? That would help guide whether they can be cutover to avoid more new instances as you suggest.

@idegtiarenko
Copy link
Contributor

This is the compile failures I got after trying to compile only the server module after making mutateInstance() abstract:

  • RetentionLeaseStatsWireSerializingTests
  • ShardCountStatsTest
  • ExplainResponseTests
  • GetStoredScriptResponseTests
  • IndexFeatureStatsTests
  • ClusterStateResponseTests
  • SnapshotStatusTests
  • SnapshotsStatusResponseTests
  • ResolveIndexResponseTests
  • ResolveIndexRequestTests
  • GetIndexResponseTests
  • CloseIndexResponseTests
  • GetFieldMappingsResponseTests
  • GetIndexTemplatesResponseTests
  • QueryExplanationTests
  • CreateIndexRequestTests
  • ResizeRequestTests
  • GetSettingsResponseTests
  • HealthMetadataSerializationTests
  • HealthStatusTests
  • HealthNodeTaskParamsTests
  • DataStreamAliasTests
  • DesiredNodesMetadataSerializationTests
  • ItemUsageTests
  • DataStreamTests
  • DataStreamTemplateTests
  • ClusterApplierRecordingServiceStatsTests
  • RoundingWireTests
  • UpdatePersistentTaskRequestTests
  • PersistentTasksExecutorResponseTests
  • StartPersistentActionRequestTests
  • CancelPersistentTaskRequestTests
  • PersistentTasksCustomMetadataTests
  • CompletionPersistentTaskRequestTests
  • PersistentTasksNodeServiceStatusTests
  • SystemIndexMigrationTaskParamsTests
  • FetchSourceContextTests
  • PointInTimeBuilderTests
  • SearchHitTests
  • CollectorResultTests
  • QueryProfileShardResultTests
  • AggregationProfileShardResultTests
  • SearchProfileResultsTests
  • SearchProfileShardResultTests
  • ProfileResultTests
  • SearchProfileDfsPhaseResultTests
  • SearchProfileQueryPhaseResultTests
  • InternalIpPrefixTests
  • MultiValuesSourceFieldConfigTests
  • WeightedAvgAggregationBuilderTests
  • AggregatorFactoriesBuilderTests

@rjernst
Copy link
Member

rjernst commented Jan 10, 2023

It seems like some tests were missed in the generation of the original list. If you think you can cleanly cut these all over to to returning null so that the base method can be made abstract, it would seem worthwhile to stop more tests from being added that do not implement mutateInstance().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Core/Infra/Core Core issues without another label help wanted adoptme Meta Team:Core/Infra Meta label for core/infra team >test Issues or PRs that are addressing/adding tests
Projects
None yet
Development

No branches or pull requests

8 participants