From 97d805be57a2b5a9ac14d7b267693a996292f576 Mon Sep 17 00:00:00 2001 From: Buck Golemon Date: Fri, 14 Mar 2014 17:10:09 -0700 Subject: [PATCH 1/4] detail how to run tests --- TESTING.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 TESTING.md diff --git a/TESTING.md b/TESTING.md new file mode 100644 index 00000000..352be512 --- /dev/null +++ b/TESTING.md @@ -0,0 +1,30 @@ +First, run a little mysql server in your home directory. + +*NOTE:* The below setup is quite insecure and should be shutdown and deleted when testing is concluded. + + mkdir -p ~/tmp/mysqldb-test-server/ + cd !$ + + mysql_install_db --no-defaults --user=$USER --datadir=$PWD/data --socket=$PWD/mysql.sock --force + /usr/sbin/mysqld --no-defaults --user=$USER --datadir=$PWD/data --socket=$PWD/mysql.sock --port 33060 + + +Now edit tests/default.cnf to add the port and change the user to 'root': + + port = 33060 + user = root + + +Finally, run the tests: + + nosetests + + +When you're done, stop the server: + + cat data/*.pid | xargs kill + + +Remove its data: + + rm -rf data From 7a3f99ca2c22aa7fefd809d49210f50cdb665778 Mon Sep 17 00:00:00 2001 From: Arnaud Brousseau Date: Fri, 14 Mar 2014 18:03:24 -0700 Subject: [PATCH 2/4] Adds missing instructions to TESTING.md. --- TESTING.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/TESTING.md b/TESTING.md index 352be512..a06970c0 100644 --- a/TESTING.md +++ b/TESTING.md @@ -15,14 +15,24 @@ Now edit tests/default.cnf to add the port and change the user to 'root': user = root +Install nose: + + pip install nose + + +Populate your new DB with a test table: + + echo 'create database test;' | mysql --port 33060 -h 0.0.0.0 -u root + + Finally, run the tests: - nosetests + cd PATH/TO/MYSQLDB && nosetests When you're done, stop the server: - cat data/*.pid | xargs kill + cd ~/tmp/mysqldb-test-server && cat data/*.pid | xargs kill Remove its data: From 31af08f9b277ccbdc18c275c18176926ccfb85f3 Mon Sep 17 00:00:00 2001 From: Arnaud Brousseau Date: Fri, 14 Mar 2014 18:04:53 -0700 Subject: [PATCH 3/4] Adds default MySQL port to test config. --- tests/default.cnf | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/default.cnf b/tests/default.cnf index 2aeda7cf..d912b13d 100644 --- a/tests/default.cnf +++ b/tests/default.cnf @@ -4,6 +4,7 @@ [MySQLdb-tests] host = 127.0.0.1 +port = 3306 user = test database = test #password = From f4c4c8d76ed9a2befaf97227ce2076cde1a4c324 Mon Sep 17 00:00:00 2001 From: Arnaud Brousseau Date: Fri, 14 Mar 2014 18:05:57 -0700 Subject: [PATCH 4/4] Ignores sw[a-z] files. --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 968f0e66..ee5eac08 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ *.so *.pyd *.gz +.*.sw[a-z] *.zip *.egg *.egg-info/