Skip to content

Commit

Permalink
Download official binaries from apache.org for integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Dana Powers committed Aug 13, 2014
1 parent 1908ee8 commit 7238e5a
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ build
dist
MANIFEST
env
servers/*/kafka-bin
29 changes: 26 additions & 3 deletions build_integration.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
#!/bin/bash

git submodule update --init
(cd servers/0.8.0/kafka-src && ./sbt update package assembly-package-dependency)
(cd servers/0.8.1/kafka-src && ./gradlew jar)
#git submodule update --init
#(cd servers/0.8.0/kafka-src && ./sbt update package assembly-package-dependency)
#(cd servers/0.8.1/kafka-src && ./gradlew jar)

SCALA_VERSION=2.8.0
KAFKA_VERSIONS="0.8.0 0.8.1 0.8.1.1"
pushd servers
mkdir -p dist
pushd dist
for kafka in $KAFKA_VERSIONS; do
echo "-------------------------------------"
echo "Checking kafka binaries for v${kafka}"
echo
wget -N https://archive.apache.org/dist/kafka/$kafka/kafka_${SCALA_VERSION}-${kafka}.tgz || wget -N https://archive.apache.org/dist/kafka/$kafka/kafka_${SCALA_VERSION}-${kafka}.tar.gz
echo
if [ ! -d "../$kafka/kafka-bin" ]; then
echo "Extracting kafka binaries for v${kafka}"
tar xzvf kafka_${SCALA_VERSION}-${kafka}.t* -C ../$kafka/
mv ../$kafka/kafka_${SCALA_VERSION}-${kafka} ../$kafka/kafka-bin
else
echo "$kafka/kafka-bin directory already exists -- skipping tgz extraction"
fi
echo
done
popd
popd
6 changes: 5 additions & 1 deletion test/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Fixture(object):
kafka_version = os.environ.get('KAFKA_VERSION', '0.8.0')
scala_version = os.environ.get("SCALA_VERSION", '2.8.0')
project_root = os.environ.get('PROJECT_ROOT', os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
kafka_root = os.environ.get("KAFKA_ROOT", os.path.join(project_root, 'servers', kafka_version, "kafka-src"))
kafka_root = os.environ.get("KAFKA_ROOT", os.path.join(project_root, 'servers', kafka_version, "kafka-bin"))
ivy_root = os.environ.get('IVY_ROOT', os.path.expanduser("~/.ivy2/cache"))

@classmethod
Expand Down Expand Up @@ -77,6 +77,10 @@ def test_classpath(cls):

@classmethod
def kafka_run_class_args(cls, *args):
result = [os.path.join(cls.kafka_root, 'bin', 'kafka-run-class.sh')]
result.extend(args)
return result

# ./kafka-src/bin/kafka-run-class.sh is the authority.
result = ["java", "-Xmx512M", "-server"]
result.append("-Dlog4j.configuration=file:%s" % cls.test_resource("log4j.properties"))
Expand Down

0 comments on commit 7238e5a

Please sign in to comment.