root/test/t/001_db_init.t

Revision 239594a76cc5a52d016357dde39705aee39bd2e4, 0.8 kB (checked in by Theo Schlossnagle <jesus@omniti.com>, 3 years ago)

fix this to run on my Mac again

  • Property mode set to 100644
Line 
1 use Test::More tests => 5;
2 use testconfig;
3
4 use strict;
5
6 SKIP: {
7   skip "no existing test db to cleanup", 1 unless (-d "$NOIT_TEST_DB");
8   `pg_ctl -D $NOIT_TEST_DB -w -m immediate stop`;
9   `rm -rf $NOIT_TEST_DB`;
10   ok(! -d "$NOIT_TEST_DB", 'cleaned up running instance');
11 }
12 ok(-r '../../sql/reconnoiter_ddl_dump.sql', 'SQL to load');
13 ok(`initdb -A trust $NOIT_TEST_DB`);
14 open (F, ">>$NOIT_TEST_DB/postgresql.conf");
15 print F "listen_addresses = 'localhost'\n";
16 print F "port = $NOIT_TEST_DB_PORT\n";
17 close(F);
18 `pg_ctl -D $NOIT_TEST_DB -l $NOIT_TEST_DB/serverlog -s -w start`;
19 SKIP: {
20   # This is failing on my Mac which is OBNOXIOUS
21   skip "pg_ctl and \$? issues on darwin", 1 if $^O eq 'darwin';
22   is($?, 0, 'starting postgres');
23 }
24
25 my $conn = pg();
26 BAIL_OUT("cannot continue tests without DB") unless($conn);
27 ok($conn, "connect to database");
28 undef $conn;
29
30 1;
Note: See TracBrowser for help on using the browser.