Skip to content
This repository has been archived by the owner on Jan 29, 2022. It is now read-only.

Running the Tests

Luke Lovett edited this page May 19, 2015 · 3 revisions

This page describes how to run any of the tests included in this project.

Setup

There are a few influential environment variables that you may want to set before running the tests. These are:

  • MONGO_INPUT_URI is the value for mongo.input.uri to use when running any of the examples.
  • MONGO_AUTH_URI is the value for mongo.auth.uri to use when running any of the examples.
  • MONGO_USER is the username to use when trying to authenticate against the "admin" database. This is currently only used for mongorestore when importing the Enron emails data set for the "enronEmails" example.
  • MONGO_PASSWORD is the password for the above user.

MongoDB not included. Make sure to start MongoDB on port 27017 listening on "localhost" before running the tests. The test suite will automatically download, install, and run a Hadoop cluster, however.

Running the Tests

You can run this entire test suite with Gradle:

./gradlew test

This will also start a Hadoop cluster and a Hive server automatically. It does not start MongoDB, so make sure that there is a mongod running on 27017 before running the tests.

You can also run tests for each module individually:

./gradlew hive:test

will run all the tests for Hive, for example.

Test Assumptions and Dependencies

Some of the tests need to connect to MongoDB to run. The test suite does not automatically start MongoDB, so make sure to start MongoDB on port 27017 before running the tests.

The tests assume that you have mongoimport and mongoexport installed, and that these tools live in /usr/local/bin. If this is not where they live, then you can edit the ext.mongoimport and ext.mongoexport variables in build.gradle to point to the right location.

Clone this wiki locally