From a0d2c41e1d32de79a073355004322c8d2a3e2dbf Mon Sep 17 00:00:00 2001 From: nkottary <kottarynishanth54@gmail.com> Date: Wed, 14 Sep 2016 12:35:36 +0530 Subject: [PATCH 1/2] Pick up server config from .ini file in tests --- REQUIRE | 1 + test/runtests.jl | 10 +++++++--- test/test_common.jl | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) 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/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() From 7eade8d1b3b0ec33013098c8daf1b29070e7e979 Mon Sep 17 00:00:00 2001 From: nkottary <kottarynishanth54@gmail.com> Date: Wed, 14 Sep 2016 12:37:11 +0530 Subject: [PATCH 2/2] Add server.ini --- test/server.ini | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 test/server.ini 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.