FAQ
Hello,

So we created a project that uses the cloudera manager Java API to automate
our cluster deployments. Thought of throwing this out there to get some
thoughts on how to unit test the project.

A couple of ideas I had were:

1. Create a mock service and mock all the rest endpoints on the service
that are getting called. This seems feasible but too tedious and unit tests
have low confidence.

2. Use up a vagrant image with pre-deployed cloudera manager that the unit
tests can hit. This seems like an OK approach but very slow and prone to
flakiness.

If I haven't missed it, there is not a similar testing utility like
HBaseTestingUtility to spin up a local instance for testing correct? Any
other ideas on this would be highly appreciated.

Thanks,

Swarnim

To unsubscribe from this group and stop receiving emails from it, send an email to scm-users+unsubscribe@cloudera.org.

Search Discussions

  • Marcelo Vanzin at Feb 1, 2014 at 5:05 am
    Hi Swarnim,

    Unfortunately I don't have an easy suggestion here. Mocking all the
    needed endpoints does seem like a lot of work; you could get away with
    bringing up a web server and using a mocked HTTP handler, but that
    will probably be a lot of work too. Or maybe have a test CM backed by
    a test database that you clean up before running the tests (similar to
    your "pre-deployed image" approach).

    What we've done internally in the few cases where we use the Java
    client without the complete server to back it up is to wrap the API
    calls in a helper class; that class encapsulate the API calls needed
    to execute a specific task in coarser methods, and those are much
    easier to mock during tests. It's not perfect but it makes some amount
    of testing possible.

    Hope that helps.


    On Fri, Jan 31, 2014 at 9:25 AM, kulkarni.swarnim@gmail.com
    wrote:
    Hello,

    So we created a project that uses the cloudera manager Java API to automate
    our cluster deployments. Thought of throwing this out there to get some
    thoughts on how to unit test the project.

    A couple of ideas I had were:

    1. Create a mock service and mock all the rest endpoints on the service that
    are getting called. This seems feasible but too tedious and unit tests have
    low confidence.

    2. Use up a vagrant image with pre-deployed cloudera manager that the unit
    tests can hit. This seems like an OK approach but very slow and prone to
    flakiness.

    If I haven't missed it, there is not a similar testing utility like
    HBaseTestingUtility to spin up a local instance for testing correct? Any
    other ideas on this would be highly appreciated.

    Thanks,

    Swarnim

    To unsubscribe from this group and stop receiving emails from it, send an
    email to scm-users+unsubscribe@cloudera.org.


    --
    Marcelo

    To unsubscribe from this group and stop receiving emails from it, send an email to scm-users+unsubscribe@cloudera.org.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupscm-users @
categorieshadoop
postedJan 31, '14 at 5:25p
activeFeb 1, '14 at 5:05a
posts2
users2
websitecloudera.com
irc#hadoop

People

Translate

site design / logo © 2022 Grokbase