From fb7f51e13eba4ca33f529c3e0dfb008d12b583db Mon Sep 17 00:00:00 2001 From: Carlos Salguero Date: Fri, 14 Oct 2016 15:03:31 -0300 Subject: [PATCH 1/4] Updated docs. How to set up the dev env --- CONTRIBUTE.md | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/CONTRIBUTE.md b/CONTRIBUTE.md index 536b5493..da7b3698 100644 --- a/CONTRIBUTE.md +++ b/CONTRIBUTE.md @@ -42,3 +42,57 @@ Once you’ve opened a pull request, a discussion will start around your propose #Licensing Along with the pull request, include a message indicating that the submited code is your own creation and it can be distributed under the BSD licence. + + +##Setting up the development environment + +####Setting up the source code +To start, fork the Percona Toolkit repo to be able to submit pull requests and clone it locally: +``` +mkdir ${HOME}/perldev +git clone https://github.com//percona-toolkit.git ${HOME}/perldev/percona-toolkit +``` + +For testing, we are going to need to have MySQL with slaves. For that, we already have scripts in the sandbox directory but first we need to download MySQL binaries. Please download the Linux Generic tar file for your distrubution from [https://www.percona.com/downloads/Percona-Server-5.6/](https://www.percona.com/downloads/Percona-Server-5.6/). + +###Set up MySQL sandbox +In this example, we are going to download Percona Server 5.6.32. Since I am using Ubuntu, according to the documentation [here](https://www.percona.com/doc/percona-server/5.6/installation.html#installing-percona-server-from-a-binary-tarball), I am going to need this tar file: [Percona-Server-5.6.32-rel78.1-Linux.x86_64.ssl100.tar.gz](https://www.percona.com/downloads/Percona-Server-5.6/Percona-Server-5.6.32-78.1/binary/tarball/Percona-Server-5.6.32-rel78.1-Linux.x86_64.ssl100.tar.gz). + +``` +mkdir -p ${HOME}/mysql/percona-server-5.6.32 +``` +``` +wget https://www.percona.com/downloads/Percona-Server-5.6/Percona-Server-5.6.32-78.1/binary/tarball/Percona-Server-5.6.32-rel78.1-Linux.x86_64.ssl100.tar.gz +``` +``` +tar xvzf Percona-Server-5.6.32-rel78.1-Linux.x86_64.ssl100.tar.gz --strip 1 -C ${HOME}/mysql/percona-server-6.6.32 +``` +###Set up environment variables: +We need these environment variables to start the MySQL sandbox and to run the tests. Probably it is a good idea to add them to your `.bashrc` file. +``` +export PERL5LIB=${HOME}/perldev/percona-toolkit/lib +export PERCONA_TOOLKIT_SANDBOX=${HOME}/mysql/percona-server-5.6.32 +``` + +###Starting the sandbox +``` +cd ${HOME}/perldev/percona-toolkit +``` +``` +sandbox/test-env start +``` +To stop the MySQL sandbox: `sandbox/test-env stop` + +###Running tests +``` +cd ${HOME}/perldev/percona-toolkit +``` +Run all tests for a particular program (pt-stalk in this example): +``` +prove -v t/pt-stalk/ +``` +or run a specific test: +``` +prove -v t/pt-stalk/option_sanity.t +``` + From b12c0f9a8f468e85a9b685d8643b71a6a21c569a Mon Sep 17 00:00:00 2001 From: Carlos Salguero Date: Fri, 14 Oct 2016 15:05:23 -0300 Subject: [PATCH 2/4] Small cosmetic fix to the docs --- CONTRIBUTE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTE.md b/CONTRIBUTE.md index da7b3698..b42fac14 100644 --- a/CONTRIBUTE.md +++ b/CONTRIBUTE.md @@ -44,7 +44,7 @@ Once you’ve opened a pull request, a discussion will start around your propose Along with the pull request, include a message indicating that the submited code is your own creation and it can be distributed under the BSD licence. -##Setting up the development environment +#Setting up the development environment ####Setting up the source code To start, fork the Percona Toolkit repo to be able to submit pull requests and clone it locally: From 59fe3f0ba53152ad28df2e6526d09a7a97b4e7e9 Mon Sep 17 00:00:00 2001 From: Carlos Salguero Date: Fri, 14 Oct 2016 15:32:09 -0300 Subject: [PATCH 3/4] Small cosmetic fix to the docs --- CONTRIBUTE.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTE.md b/CONTRIBUTE.md index b42fac14..5ec13dd0 100644 --- a/CONTRIBUTE.md +++ b/CONTRIBUTE.md @@ -1,7 +1,7 @@ #Contributing guide ##How Can I Contribute? ##Reporting Bugs -Before creating bug reports, please check this list as you might find out that you don't need to create one. When you are creating a bug report, please include as many details as possible. You can use this template to structure the information. +Before creating bug reports, please check this list as you might find out that you don't need to create one. When you create a bug report, please include as many details as possible. You can use this template to structure the information. ###Before Submitting A Bug Report - Ensure you have carefully read the documentation. Percona Toolkit is a mature project with many settings that covers a wide range options. @@ -67,7 +67,7 @@ wget https://www.percona.com/downloads/Percona-Server-5.6/Percona-Server-5.6.32- ``` tar xvzf Percona-Server-5.6.32-rel78.1-Linux.x86_64.ssl100.tar.gz --strip 1 -C ${HOME}/mysql/percona-server-6.6.32 ``` -###Set up environment variables: +###Set up environment variables: [:link:](#set-up-environment-variables) We need these environment variables to start the MySQL sandbox and to run the tests. Probably it is a good idea to add them to your `.bashrc` file. ``` export PERL5LIB=${HOME}/perldev/percona-toolkit/lib From 79d5e572f003e0a6fe6a7da54f12eed16c5490d3 Mon Sep 17 00:00:00 2001 From: Carlos Salguero Date: Fri, 14 Oct 2016 15:33:12 -0300 Subject: [PATCH 4/4] Small cosmetic fix to the docs --- CONTRIBUTE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTE.md b/CONTRIBUTE.md index 5ec13dd0..49a135eb 100644 --- a/CONTRIBUTE.md +++ b/CONTRIBUTE.md @@ -67,7 +67,7 @@ wget https://www.percona.com/downloads/Percona-Server-5.6/Percona-Server-5.6.32- ``` tar xvzf Percona-Server-5.6.32-rel78.1-Linux.x86_64.ssl100.tar.gz --strip 1 -C ${HOME}/mysql/percona-server-6.6.32 ``` -###Set up environment variables: [:link:](#set-up-environment-variables) +###Set up environment variables: We need these environment variables to start the MySQL sandbox and to run the tests. Probably it is a good idea to add them to your `.bashrc` file. ``` export PERL5LIB=${HOME}/perldev/percona-toolkit/lib