elastic / elasticsearch-cloud-aws

AWS Cloud Plugin for Elasticsearch
https://github.com/elastic/elasticsearch/tree/master/plugins/discovery-ec2
577 stars 181 forks source link

Improve @AwsTests / fix credential mgmt in tests #210

Closed rmuir closed 9 years ago

rmuir commented 9 years ago

The AwsTests group, i really have no idea how to run this: somehow it requires some special credentials. This makes it hard to debug any issue. I think we need to get away from these integration-type tests as quickly as possible, just trying to fix plugin builds I had to do things like install erlang and startup various services manually.

We should test primarily with unit tests.

Separately, when these things do run, they try to read from strange places on the filesystem, presumably because special credentials location was passed in on the command line. For now I disabled security manager for this plugin, because I have no idea how to reproduce these tests, and it needs some work.

dadoonet commented 9 years ago

I do agree that we should try to add more unit tests which are always executed. That said, our Jenkins instance is running our integration tests using this doc and internal credentials we have.

In other projects such as Azure and GCE plugins, I tried to add Mock objects to simulate Azure or GCE API calls which helps a lot in that case. Do you suggest we do mocking here as well or may be split big methods in more "testable" methods?

rmuir commented 9 years ago

I like with azure there are lots of tests that always run! I will look into the doc, thanks!

rmuir commented 9 years ago

@dadoonet thanks for the links. I am digging into this. We have quite a few plugins that need this same mechanism so I will try to sort it out tonight.

rmuir commented 9 years ago

See https://github.com/elastic/elasticsearch/pull/11134 which will fix the security manager issues.

I want to follow-up after that with moving tests.config to elasticsearch-parent, and try to add some generic tests group/parameter to elasticsearch-parent as a replacement for tests.aws/tests.gce/tests.azure

This way, aws/gce/azure plugins don't need custom mvn test logic and can just re-use elasticearch-parent logic.

rmuir commented 9 years ago

Fixed by elastic/elasticsearch#11134 . I opened an issue in es-parent to discuss how to remove custom test logic (https://github.com/elastic/elasticsearch-parent/issues/41) in each of these builds so that es-parent logic can be reused.