Skip to content

Commit a0d2c41

Browse files
committed
Pick up server config from .ini file in tests
1 parent 7b7473a commit a0d2c41

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

REQUIRE

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ julia 0.4
22
DataFrames
33
Compat 0.7.20
44
Dates
5+
ConfParser

test/runtests.jl

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
using MySQL
22
using Base.Test
3+
using ConfParser
34

4-
# Change the below values to whatever it is on your test setup.
5-
const HOST = "127.0.0.1"
6-
const ROOTPASS = "" # In Travis CI the root password is an empty string.
5+
conf = ConfParse("server.ini")
6+
parse_conf!(conf)
7+
8+
const HOST = retrieve(conf, "default", "host") |> parse
9+
const USER = retrieve(conf, "default", "user") |> parse
10+
const PASS = retrieve(conf, "default", "pass") |> parse
711

812
for file in ["test_basic.jl", "test_prep.jl", "test_multiquery.jl"]
913
include(file)

test/test_common.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function run_query_helper(command, msg)
1212
end
1313

1414
function connect_as_root()
15-
global hndl = mysql_connect(HOST, "root", ROOTPASS, "")
15+
global hndl = mysql_connect(HOST, USER, PASS, "")
1616
end
1717

1818
function create_test_database()

0 commit comments

Comments
 (0)