...
We'll need both Vagrant and Virtualbox to create a test cluster
Widget Connector |
---|
width | 16001000 |
---|
url | https://www.youtube.com/watch?v=Jk2CWyM_GDU |
---|
height | 900563 |
---|
|
Code Block |
---|
|
$ # Easy to check with these commands:
$ vagrant --version # We want vagrant >= 1.6.4
$ vboxmanage --version |
...
Install necessary Vagrant plugins
Widget Connector |
---|
width | 16001000 |
---|
url | https://www.youtube.com/watch?v=_4LmORy-v8I |
---|
height | 900563 |
---|
|
Code Block |
---|
|
$ vagrant plugin install vagrant-cachier
$ vagrant plugin install vagrant-hostmanager --plugin-version 1.5.0 |
...
This step isn't strictly necessary, but if you do this once on your local machine, you'll significantly reduce the amount of time it takes to create each new virtual machine.
Widget Connector |
---|
width | 16001000 |
---|
url | https://www.youtube.com/watch?v=5MlSBH0QS0Q |
---|
height | 900563 |
---|
|
Code Block |
---|
|
$ cd kafka
$ cp vagrant/system-test-Vagrantfile.local Vagrantfile.local
$
$ # Now open Vagrantfile.local, and set num_workers = 1
$
$ vagrant up # This will build one vm from "scratch"
$ vagrant halt # Shut down the newly created vm
$ vagrant package worker1 # This creates a reusable "packaged" version of the new vm, stored in package.box
$ vagrant box add kafkatest-worker package.box # This will take a little while...
$
$ # Now you have a reusable box!
$
$ # Now open Vagrantfile.local, and set base_box = "kafkatest-worker"
$
$ # We're all done, so we can clean up after ourselves:
$ rm -f package.box
$ vagrant destroy -f |
...
This part is fairly simple, but can take a while, so bring a good book.
Widget Connector |
---|
width | 16001000 |
---|
url | https://www.youtube.com/watch?v=sxjnVd7eudM |
---|
height | 900563 |
---|
|
Code Block |
---|
|
$ # If you skipped the previous step, make sure you have a Vagrantfile.local in your Kafka directory
$ cp vagrant/system-test-Vagrantfile.local Vagrantfile.local
$
$ # Update Vagrantfile.local, and set num_workers = 10
$ # If you packaged a box, set base_box = "kafkatest-worker"
$
$ vagrant up # This will bring up your cluster
$
$ # Other useful vagrant commands
$ vagrant status # See how many vms you have, whether they're running, etc.
$ vagrant ssh <vm_name> # ssh into a vm
$ vagrant hostmanager # update /etc/hosts on each vm
$ vagrant halt # shut down without destroying
$ vagrant destroy -f # destroy the vms
|
...
Here I'll install ducktape, introduce a few useful ducktape commands, show how to actually run the tests, and give an overview of test output.
Widget Connector |
---|
width | 16001000 |
---|
url | https://www.youtube.com/watch?v=ve_dL4ftKkw |
---|
height | 900563 |
---|
|
Code Block |
---|
|
$ # Install ducktape:
$ pip install ducktape
$
$ cd tests
$
$ ducktape --version # Good way to check if ducktape is properly installed
$ ducktape <path> --collect-only # See which tests ducktape discovers underneath <path>
$
$ # Run "test_console_consumer.py" with the debug flag turned on
$ ducktape kafkatest/sanity_checks/test_console_consumer.py --debug
$
$ # Run all tests
$ ducktape kafkatest/tests
|
...