Skip to content

Commit

Permalink
Use $TEST_NGINX_POSTGRESQL_PORT instead of hardcoded value.
Browse files Browse the repository at this point in the history
  • Loading branch information
PiotrSikora committed Aug 26, 2010
1 parent 0e4fa7f commit 5995b2c
Show file tree
Hide file tree
Showing 12 changed files with 54 additions and 30 deletions.
6 changes: 4 additions & 2 deletions t/000_init.t
Expand Up @@ -7,10 +7,12 @@ repeat_each(1);

plan tests => repeat_each() * blocks();

$ENV{TEST_NGINX_POSTGRESQL_PORT} ||= 5432;

our $http_config = <<'_EOC_';
upstream database {
postgres_server 127.0.0.1:5432 dbname=ngx_test
user=ngx_test password=ngx_test;
postgres_server 127.0.0.1:$TEST_NGINX_POSTGRESQL_PORT
dbname=ngx_test user=ngx_test password=ngx_test;
}
_EOC_

Expand Down
6 changes: 4 additions & 2 deletions t/auth.t
Expand Up @@ -7,10 +7,12 @@ repeat_each(2);

plan tests => repeat_each() * (blocks() * 3 - 2 * 1);

$ENV{TEST_NGINX_POSTGRESQL_PORT} ||= 5432;

our $http_config = <<'_EOC_';
upstream database {
postgres_server 127.0.0.1:5432 dbname=ngx_test
user=ngx_test password=ngx_test;
postgres_server 127.0.0.1:$TEST_NGINX_POSTGRESQL_PORT
dbname=ngx_test user=ngx_test password=ngx_test;
}
_EOC_

Expand Down
10 changes: 6 additions & 4 deletions t/errors.t
Expand Up @@ -7,10 +7,12 @@ repeat_each(2);

plan tests => repeat_each() * blocks();

$ENV{TEST_NGINX_POSTGRESQL_PORT} ||= 5432;

our $http_config = <<'_EOC_';
upstream database {
postgres_server 127.0.0.1:5432 dbname=ngx_test
user=ngx_test password=ngx_test;
postgres_server 127.0.0.1:$TEST_NGINX_POSTGRESQL_PORT
dbname=ngx_test user=ngx_test password=ngx_test;
}
_EOC_

Expand Down Expand Up @@ -38,8 +40,8 @@ GET /postgres
=== TEST 2: wrong credentials
--- http_config
upstream database {
postgres_server 127.0.0.1:5432 dbname=ngx_test
user=ngx_test password=wrong_pass;
postgres_server 127.0.0.1:$TEST_NGINX_POSTGRESQL_PORT
dbname=ngx_test user=ngx_test password=wrong_pass;
}
--- config
location /postgres {
Expand Down
10 changes: 6 additions & 4 deletions t/eval.t
Expand Up @@ -7,10 +7,12 @@ repeat_each(2);

plan tests => repeat_each() * (blocks() * 3);

$ENV{TEST_NGINX_POSTGRESQL_PORT} ||= 5432;

our $http_config = <<'_EOC_';
upstream database {
postgres_server 127.0.0.1:5432 dbname=ngx_test
user=ngx_test password=ngx_test;
postgres_server 127.0.0.1:$TEST_NGINX_POSTGRESQL_PORT
dbname=ngx_test user=ngx_test password=ngx_test;
}
_EOC_

Expand All @@ -24,8 +26,8 @@ __DATA__
=== TEST 1: sanity
--- http_config
upstream database {
postgres_server 127.0.0.1:5432 dbname=ngx_test
user=ngx_test password=ngx_test;
postgres_server 127.0.0.1:$TEST_NGINX_POSTGRESQL_PORT
dbname=ngx_test user=ngx_test password=ngx_test;
}
server {
Expand Down
6 changes: 4 additions & 2 deletions t/form.disabled
Expand Up @@ -7,10 +7,12 @@ repeat_each(2);

plan tests => repeat_each() * (blocks() * 3);

$ENV{TEST_NGINX_POSTGRESQL_PORT} ||= 5432;

our $http_config = <<'_EOC_';
upstream database {
postgres_server 127.0.0.1:5432 dbname=ngx_test
user=ngx_test password=ngx_test;
postgres_server 127.0.0.1:$TEST_NGINX_POSTGRESQL_PORT
dbname=ngx_test user=ngx_test password=ngx_test;
}
_EOC_

Expand Down
6 changes: 4 additions & 2 deletions t/methods.t
Expand Up @@ -7,10 +7,12 @@ repeat_each(2);

plan tests => repeat_each() * (blocks() * 3 - 2 * 2);

$ENV{TEST_NGINX_POSTGRESQL_PORT} ||= 5432;

our $http_config = <<'_EOC_';
upstream database {
postgres_server 127.0.0.1:5432 dbname=ngx_test
user=ngx_test password=ngx_test;
postgres_server 127.0.0.1:$TEST_NGINX_POSTGRESQL_PORT
dbname=ngx_test user=ngx_test password=ngx_test;
}
_EOC_

Expand Down
6 changes: 4 additions & 2 deletions t/output.t
Expand Up @@ -7,10 +7,12 @@ repeat_each(2);

plan tests => repeat_each() * (blocks() * 3 - 4 * 2);

$ENV{TEST_NGINX_POSTGRESQL_PORT} ||= 5432;

our $http_config = <<'_EOC_';
upstream database {
postgres_server 127.0.0.1:5432 dbname=ngx_test
user=ngx_test password=ngx_test;
postgres_server 127.0.0.1:$TEST_NGINX_POSTGRESQL_PORT
dbname=ngx_test user=ngx_test password=ngx_test;
}
_EOC_

Expand Down
6 changes: 4 additions & 2 deletions t/restful.t
Expand Up @@ -7,10 +7,12 @@ repeat_each(1);

plan tests => repeat_each() * (blocks() * 3);

$ENV{TEST_NGINX_POSTGRESQL_PORT} ||= 5432;

our $http_config = <<'_EOC_';
upstream database {
postgres_server 127.0.0.1:5432 dbname=ngx_test
user=ngx_test password=ngx_test;
postgres_server 127.0.0.1:$TEST_NGINX_POSTGRESQL_PORT
dbname=ngx_test user=ngx_test password=ngx_test;
}
_EOC_

Expand Down
6 changes: 4 additions & 2 deletions t/restful_json.t
Expand Up @@ -7,10 +7,12 @@ repeat_each(1);

plan tests => repeat_each() * (blocks() * 3);

$ENV{TEST_NGINX_POSTGRESQL_PORT} ||= 5432;

our $http_config = <<'_EOC_';
upstream database {
postgres_server 127.0.0.1:5432 dbname=ngx_test
user=ngx_test password=ngx_test;
postgres_server 127.0.0.1:$TEST_NGINX_POSTGRESQL_PORT
dbname=ngx_test user=ngx_test password=ngx_test;
}
_EOC_

Expand Down
6 changes: 4 additions & 2 deletions t/rewrites.t
Expand Up @@ -7,10 +7,12 @@ repeat_each(2);

plan tests => repeat_each() * (blocks() * 2);

$ENV{TEST_NGINX_POSTGRESQL_PORT} ||= 5432;

our $http_config = <<'_EOC_';
upstream database {
postgres_server 127.0.0.1:5432 dbname=ngx_test
user=ngx_test password=ngx_test;
postgres_server 127.0.0.1:$TEST_NGINX_POSTGRESQL_PORT
dbname=ngx_test user=ngx_test password=ngx_test;
}
_EOC_

Expand Down
10 changes: 6 additions & 4 deletions t/sanity.t
Expand Up @@ -7,10 +7,12 @@ repeat_each(2);

plan tests => repeat_each() * (blocks() * 3);

$ENV{TEST_NGINX_POSTGRESQL_PORT} ||= 5432;

our $http_config = <<'_EOC_';
upstream database {
postgres_server 127.0.0.1:5432 dbname=ngx_test
user=ngx_test password=ngx_test;
postgres_server 127.0.0.1:$TEST_NGINX_POSTGRESQL_PORT
dbname=ngx_test user=ngx_test password=ngx_test;
}
_EOC_

Expand All @@ -24,8 +26,8 @@ __DATA__
=== TEST 1: sanity
--- http_config
upstream database {
postgres_server 127.0.0.1:5432 dbname=ngx_test
user=ngx_test password=ngx_test;
postgres_server 127.0.0.1:$TEST_NGINX_POSTGRESQL_PORT
dbname=ngx_test user=ngx_test password=ngx_test;
postgres_keepalive off;
}
--- config
Expand Down
6 changes: 4 additions & 2 deletions t/variables.t
Expand Up @@ -7,10 +7,12 @@ repeat_each(2);

plan tests => repeat_each() * (blocks() * 3 + 1 * 4 + 1 * 1 - 5 * 2);

$ENV{TEST_NGINX_POSTGRESQL_PORT} ||= 5432;

our $http_config = <<'_EOC_';
upstream database {
postgres_server 127.0.0.1:5432 dbname=ngx_test
user=ngx_test password=ngx_test;
postgres_server 127.0.0.1:$TEST_NGINX_POSTGRESQL_PORT
dbname=ngx_test user=ngx_test password=ngx_test;
}
_EOC_

Expand Down

0 comments on commit 5995b2c

Please sign in to comment.