-
Notifications
You must be signed in to change notification settings - Fork 505
METRON-2168 Elasticsearch Updates Not Tested in Integration Test #1451
Conversation
|
One point that reviewers should consider is do we have enough test coverage for the I don't think the update: My answer would lean on the "no" side, but I don't think the integration tests really covered any of the existing gaps. I might spend a bit of time expanding on |
|
I added more unit tests for MultiIndexDao. |
mmiklavc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One question on the guava version change.
| <properties> | ||
| <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
| <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> | ||
| <guava_version>${global_hbase_guava_version}</guava_version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this safe to change? ie do we have an hbase enrichment running to verify the classpath doesn't have problems?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like I don't need that change for this PR, so I reverted it. I may need to revisit this in #1454.
This reverts commit d637807.
|
lgtm, +1 |
The
ElasticsearchUpdateIntegrationTestis not testing that theElasticsearchDaocan update and retrieve values in a manner similar to what would occur in production.What?
Within the Elasticsearch index, the test fails to define the 'guid' field to be of type 'keyword', instead the type is defaulted to 'text'. In a production setting this mistake would prevent any documents from being found by guid. Unfortunately, the test passes despite this. The test needs to match the behavior of what a user would experience in production.
Why?
These problems arise because of the way the test is setup. Instead of directly testing an
ElasticsearchDaoas you might expect this test runs against aMultiIndexDaoinitialized with both anElasticseachDaoand anHBaseDao. On retrievals theMultIndexDaowill return the document from whichever index responds first.With the current test setup, the underlying
ElasticsearchDaowill never retrieve the document that the test case is expecting. In all cases where the test passes, the document is actually being returned from theHBaseDaowhich is actually just interacting with a mock backend. The test needs to actually test that we can update and retrieve documents from Elasticsearch.Proof?
If you alter the test to run against just an
ElasticsearchDaothe test will fail as follows in the attached log file.Testing
This only changes the integration tests. Run the integration tests to validate these changes.
Pull Request Checklist