root/test/t/002_db_load.t

Revision 57156325b280cf0021706459de269ef44b89d8cc, 0.6 kB (checked in by Theo Schlossnagle <jesus@omniti.com>, 4 years ago)

some basic scaffolding for noit tests, refs #230

  • Property mode set to 100644
Line 
1 use Test::More tests => 5;
2 use testconfig;
3
4 use strict;
5
6 my $conn;
7
8 $conn = pg('reconnoiter','reconnoiter');
9 SKIP: {
10   skip 'already created user and db', 1 if($conn);
11   `psql -h localhost -p $NOIT_TEST_DB_PORT postgres -f ../../sql/reconnoiter_ddl_dump.sql`;
12   is($?, 0, 'loaded schema');
13 }
14 $conn = pg('reconnoiter','reconnoiter');
15 ok($conn, 'connected under new user');
16 my $s = $conn->prepare("select count(*) from noit.metric_numeric_rollup_config");
17 ok($s, 'prepared test query');
18 ok($s->execute(), 'executed test query');
19 is($s->fetchrow(), 6, 'rollups exist');
20 undef $conn;
21
22 1;
Note: See TracBrowser for help on using the browser.