diff --git a/REQUIRE b/REQUIRE index 48371d5..2bd8035 100644 --- a/REQUIRE +++ b/REQUIRE @@ -2,3 +2,4 @@ julia 0.4 DataFrames Compat 0.7.20 Dates +ConfParser diff --git a/test/runtests.jl b/test/runtests.jl index d6cfeda..2d03cb1 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,9 +1,13 @@ using MySQL using Base.Test +using ConfParser -# Change the below values to whatever it is on your test setup. -const HOST = "127.0.0.1" -const ROOTPASS = "" # In Travis CI the root password is an empty string. +conf = ConfParse("server.ini") +parse_conf!(conf) + +const HOST = retrieve(conf, "default", "host") |> parse +const USER = retrieve(conf, "default", "user") |> parse +const PASS = retrieve(conf, "default", "pass") |> parse for file in ["test_basic.jl", "test_prep.jl", "test_multiquery.jl"] include(file) diff --git a/test/server.ini b/test/server.ini new file mode 100644 index 0000000..266ac45 --- /dev/null +++ b/test/server.ini @@ -0,0 +1,6 @@ +;; If a non-root user is provided below, then that user should +;; have database creation and user creation privilege. +[default] +host="127.0.0.1" +user="root" +pass="" ; In Travis CI the root password is an empty string. diff --git a/test/test_common.jl b/test/test_common.jl index 68c5a84..e242459 100644 --- a/test/test_common.jl +++ b/test/test_common.jl @@ -12,7 +12,7 @@ function run_query_helper(command, msg) end function connect_as_root() - global hndl = mysql_connect(HOST, "root", ROOTPASS, "") + global hndl = mysql_connect(HOST, USER, PASS, "") end function create_test_database()