Github user logc commented on the pull request:
https://github.com/apache/spark/pull/134#issuecomment-40924504
Hi @shivaram , thanks for your comments!
The purpose of the unit test is to start defining invariants in the code,
and later be sure that changes do not break invariants. That means, even if
the ultimate purpose of the code is to start a machine on EC2, we can consider
the purpose fulfilled if we send the corresponding request out (leaving the
actual start of the machine as a responsibility of AWS). The moto library is
in charge of faithfully replicating the AWS interface -- which, to my
knowledge, it does -- but avoiding to start actual machines and incur in costs.
The situation is similar to when you mock out your database: you want to
check your logic, and leave the intended secondary effects as a concern of the
database.
You are right that this first test is quite uninteresting: it just checks
that no exceptions are raised. But this was intended as a way to start setting
up the test infrastructure. I intend to expand this in order to test other
functions; at some point, this test will receive a (mocked) started cluster on
EC2, and check that terminating it does eliminate all of its instances.
I am submitting this change set as it is because it is self-contained, and
it is complete: others can start developing tests of their own, and the first
test does guarantee that other changes do not break the `destroy_cluster`
functionality.
Regarding licenses: moto is under the Apache license as you can see
[here](https://github.com/spulec/moto/blob/master/LICENSE), and mock is under
the BSD license. As far as I know, [BSD and Apache are
compatible](http://programmers.stackexchange.com/questions/40561/is-bsd-license-compatible-with-apache).
The only restriction I can think of is that you should leave the BSD notice
on the library.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---