forked from ilimi-in/secor
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit introduces a way to run the integration tests in a purely local fashion, using `fakes3` (a Ruby gem) rather than using an actual S3 bucket. In order to accomplish this a few configuration options needs to be set (AWS keys and S3 bucket), and I’ve included “defaults” that will work on Travis (in separate config. files). One also needs to add an entry to `/etc/hosts` (or equivalent), that points `test-bucket.localhost` to `127.0.0.1`. I’ve added a rather naive function, `check_for_native_libs`, that checks whether `HADOOP_NATIVE_LIB_PATH` actually contains any `*.so` files, and if it doesn’t it’ll ignore the “compressed tests” for sequence files, as it's not possible to run them without the native libs, and it's pretty darn difficult to build them on Mac OS X, not even sure if it's supported at all. Furthermore there’s a Makefile that simplifies running the integration tests, a simple `make integration` is all that’s needed. It’ll build, package and extract Secor to a directory in `/tmp` and the run the tests. Perhaps there should be a section in the README dedicated to how the test setup works, and how to run the tests.
- Loading branch information
1 parent
fe5ee21
commit b1c620e
Showing
11 changed files
with
135 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,20 @@ | ||
language: java | ||
addons: | ||
hosts: | ||
- test-bucket.localhost | ||
env: | ||
- PATH=$PATH:$HOME/.s3cmd SECOR_LOCAL_S3=true S3CMD=1.0.1 | ||
jdk: | ||
- oraclejdk8 | ||
- openjdk7 | ||
- oraclejdk7 | ||
- openjdk6 | ||
- openjdk7 | ||
- oraclejdk8 | ||
before_install: | ||
- wget https://github.com/s3tools/s3cmd/archive/v$S3CMD.tar.gz -O /tmp/s3cmd.tar.gz | ||
- tar -xzf /tmp/s3cmd.tar.gz -C $HOME | ||
- mv $HOME/s3cmd-$S3CMD $HOME/.s3cmd | ||
- cd $HOME/.s3cmd && python setup.py install --user && cd - | ||
- gem install fakes3 -v 0.1.7 | ||
script: | ||
- make unit | ||
- make integration | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
CONFIG=src/main/config | ||
TEST_HOME=/tmp/secor_test | ||
TEST_CONFIG=src/test/config | ||
JAR_FILE=target/secor-*-SNAPSHOT-bin.tar.gz | ||
MVN_OPTS=-DskipTests=true -Dmaven.javadoc.skip=true | ||
|
||
build: | ||
@mvn package $(MVN_OPTS) | ||
|
||
unit: | ||
@mvn test | ||
|
||
integration: build | ||
@rm -rf $(TEST_HOME) | ||
@mkdir -p $(TEST_HOME) | ||
@tar -xzf $(JAR_FILE) -C $(TEST_HOME) | ||
@cp $(TEST_CONFIG)/* $(TEST_HOME) | ||
@[ ! -e $(CONFIG)/jets3t.properties ] && jar uf $(TEST_HOME)/secor-*.jar -C $(TEST_CONFIG) jets3t.properties | ||
cd $(TEST_HOME) && ./scripts/run_tests.sh | ||
|
||
test: build unit integration | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
include=secor.test.properties | ||
include=secor.dev.backup.properties | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
include=secor.test.properties | ||
include=secor.dev.partition.properties | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
secor.s3.bucket=test-bucket | ||
aws.access.key=TESTKEY | ||
aws.secret.key=TESTKEY | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
s3service.https-only=false | ||
s3service.s3-endpoint-http-port=5000 | ||
s3service.s3-endpoint=localhost |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[default] | ||
access_key = TESTACCESSKEY | ||
bucket_location = US | ||
default_mime_type = binary/octet-stream | ||
encoding = UTF-8 | ||
get_continue = False | ||
guess_mime_type = True | ||
host_base = localhost:5000 | ||
host_bucket = %(bucket)s.localhost:5000 | ||
secret_key = TESTSECRETKEY | ||
use_https = False | ||
verbosity = WARNING |