forked from apache/kafka
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from confluentinc/system_tests
Bootstrap Kafka system tests
- Loading branch information
Showing
17 changed files
with
1,028 additions
and
3 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 |
---|---|---|
|
@@ -29,3 +29,8 @@ config/server-* | |
config/zookeeper-* | ||
core/data/* | ||
gradle/wrapper/* | ||
|
||
results | ||
tests/results | ||
.ducktape | ||
tests/.ducktape |
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,11 @@ | ||
Vagrantfile.local | ||
|
||
.idea/ | ||
|
||
*.pyc | ||
*.ipynb | ||
|
||
.DS_Store | ||
|
||
.ducktape | ||
results/ |
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,44 @@ | ||
System Integration & Performance Testing | ||
======================================== | ||
|
||
This directory contains Kafka system integration and performance tests. | ||
[Ducktape](https://github.com/confluentinc/ducktape) is used to run the tests. | ||
|
||
Ducktape is a distributed testing framework which provides test runner, | ||
result reporter and utilities to pull up and tear down services. It automatically | ||
discovers tests from a directory and generate an HTML report for each run. | ||
|
||
To run the tests: | ||
|
||
1. Build a specific branch of Kafka | ||
|
||
$ cd kafka | ||
$ git checkout $BRANCH | ||
$ gradle | ||
$ ./gradlew jar | ||
|
||
2. Setup a testing cluster. You can use Vagrant to create a cluster of local | ||
VMs or on EC2. Configure your Vagrant setup by creating the file | ||
`Vagrantfile.local` in the directory of your Kafka checkout. At a minimum | ||
, you *MUST* set `mode = "test"` and the value of `num_workers` high enough for | ||
the test you're trying to run. If you run on AWS, you also need to set | ||
enable_dns = true. | ||
|
||
3. Bring up the cluster, making sure you have enough workers. For Vagrant, | ||
use `vagrant up`. If you want to run on AWS, use `vagrant up | ||
--provider=aws --no-parallel`. | ||
4. Install ducktape: | ||
|
||
$ git clone https://github.com/confluentinc/ducktape | ||
$ cd ducktape | ||
$ pip install ducktape | ||
5. Run the system tests using ducktape, you can view results in the `results` | ||
directory. | ||
|
||
$ cd tests | ||
$ ducktape tests | ||
6. To iterate/run again if you made any changes: | ||
|
||
$ cd kafka | ||
$ ./gradlew jar | ||
$ vagrant rsync # Re-syncs build output to cluster |
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 @@ | ||
|
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 @@ | ||
export AWS_ACCESS_KEY=`curl -s http://169.254.169.254/latest/meta-data/iam/security-credentials/ducttape-master | grep AccessKeyId | awk -F\" '{ print $4 }'` | ||
export AWS_SECRET_KEY=`curl -s http://169.254.169.254/latest/meta-data/iam/security-credentials/ducttape-master | grep SecretAccessKey | awk -F\" '{ print $4 }'` | ||
export AWS_SESSION_TOKEN=`curl -s http://169.254.169.254/latest/meta-data/iam/security-credentials/ducttape-master | grep Token | awk -F\" '{ print $4 }'` |
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,9 @@ | ||
ec3_instance_type = "m3.medium" | ||
enable_dns = true | ||
mode = "test" | ||
num_workers = 1 | ||
ec2_keypair_name = | ||
ec2_keypair_file = | ||
ec2_security_groups = ['ducttape-insecure'] | ||
ec2_region = 'us-west-2' | ||
ec2_ami = "ami-29ebb519" |
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,57 @@ | ||
#!/bin/bash | ||
|
||
# This script should be run once on your aws test driver machine before | ||
# attempting to run any ducktape tests | ||
|
||
# Install dependencies | ||
sudo apt-get install -y maven openjdk-6-jdk build-essential \ | ||
ruby-dev zlib1g-dev realpath python-setuptools | ||
|
||
base_dir=`dirname $0`/.. | ||
|
||
if [ -z `which vagrant` ]; then | ||
echo "Installing vagrant..." | ||
wget https://dl.bintray.com/mitchellh/vagrant/vagrant_1.7.2_x86_64.deb | ||
sudo dpkg -i vagrant_1.7.2_x86_64.deb | ||
rm -f vagrant_1.7.2_x86_64.deb | ||
fi | ||
|
||
# Install necessary vagrant plugins | ||
# Note: Do NOT install vagrant-cachier since it doesn't work on AWS and only | ||
# adds log noise | ||
vagrant_plugins="vagrant-aws vagrant-hostmanager" | ||
existing=`vagrant plugin list` | ||
for plugin in $vagrant_plugins; do | ||
echo $existing | grep $plugin > /dev/null | ||
if [ $? != 0 ]; then | ||
vagrant plugin install $plugin | ||
fi | ||
done | ||
|
||
# Create Vagrantfile.local as a convenience | ||
if [ ! -e "$base_dir/Vagrantfile.local" ]; then | ||
cp $base_dir/aws/aws-example-Vagrantfile.local $base_dir/Vagrantfile.local | ||
fi | ||
|
||
gradle="gradle-2.2.1" | ||
if [ -z `which gradle` ] && [ ! -d $base_dir/$gradle ]; then | ||
if [ ! -e $gradle-bin.zip ]; then | ||
wget https://services.gradle.org/distributions/$gradle-bin.zip | ||
fi | ||
unzip $gradle-bin.zip | ||
rm -rf $gradle-bin.zip | ||
mv $gradle $base_dir/$gradle | ||
fi | ||
|
||
# Ensure aws access keys are in the environment when we use a EC2 driver machine | ||
LOCAL_HOSTNAME=$(hostname -d) | ||
if [[ ${LOCAL_HOSTNAME} =~ .*\.compute\.internal ]]; then | ||
grep "AWS ACCESS KEYS" ~/.bashrc > /dev/null | ||
if [ $? != 0 ]; then | ||
echo "# --- AWS ACCESS KEYS ---" >> ~/.bashrc | ||
echo ". `realpath $base_dir/aws/aws-access-keys-commands`" >> ~/.bashrc | ||
echo "# -----------------------" >> ~/.bashrc | ||
source ~/.bashrc | ||
fi | ||
fi | ||
|
Empty file.
Oops, something went wrong.