summaryrefslogtreecommitdiff
blob: 9a2d5e7bb0b69fa374134c719627d32d66264ef0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
From a63725a70ab6d5cbf419d1896007b49609ac5cfa Mon Sep 17 00:00:00 2001
From: Kent Fredric <kentfredric@gmail.com>
Date: Tue, 18 Jul 2017 11:06:05 +1200
Subject: [PATCH] Add env db test controls

---
 Build.PL           | 10 +++++-----
 t/DBTestHarness.pm | 11 ++++++-----
 2 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/Build.PL b/Build.PL
index ecc402e..4d55f3a 100755
--- a/Build.PL
+++ b/Build.PL
@@ -97,11 +97,11 @@ sub biosql_conf {
         or die "Error: could not write to config file '$config_file'\n";
     
     my %config = (driver     => $drivers[0],
-                  host       => '127.0.0.1',
-                  user       => 'root',
-                  port       => 3306,
-                  password   => '',
-                  dbname     => 'bioseqdb',
+                  host       => $ENV{GENTOO_DB_TEST_HOST},
+                  user       => $ENV{GENTOO_DB_TEST_USER},
+                  port       => $ENV{GENTOO_DB_TEST_PORT},
+                  password   => $ENV{GENTOO_DB_TEST_PASSWORD},
+                  dbname     => $ENV{GENTOO_DB_TEST_DB},
                   database   => 'biosql',
                   schema_sql => '../biosql-schema/sql/biosqldb-mysql.sql');
     
diff --git a/t/DBTestHarness.pm b/t/DBTestHarness.pm
index b660429..bd0b3b7 100755
--- a/t/DBTestHarness.pm
+++ b/t/DBTestHarness.pm
@@ -47,12 +47,13 @@ my $counter=0;
 # Default settings as a hash
 my $dflt = {
     'driver'        => 'mysql',
-    'host'          => 'localhost',
-    'user'          => 'root',
-    'port'          => undef,
-    'password'      => '',
+    'host'          => $ENV{GENTOO_DB_HOST},
+    'user'          => $ENV{GENTOO_DB_TEST_USER},
+    'port'          => ( defined $ENV{GENTOO_DB_TEST_PORT} and length $ENV{GENTOO_DB_TEST_PORT} ) ?
+                       $ENV{GENTOO_DB_TEST_PORT} : undef,
+    'password'      => $ENV{GENTOO_DB_TEST_PASSWORD},
     'schema_sql'    => ['../biosql-schema/sql/biosqldb-mysql.sql'],
-    'database'      => 'biosql',
+    'database'      => $ENV{GENTOO_DB_TEST_DB},
     'module'        => 'Bio::DB::BioSQL::DBAdaptor'
     };
 
-- 
2.13.1