Skip to content

Remove unused prefix from test env vars #176

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 7, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions test/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,22 @@ var DataSource = require('loopback-datasource-juggler').DataSource;
var config = require('rc')('loopback', {test: {postgresql: {}}}).test.postgresql;

if (process.env.CI) {
process.env.PGHOST = process.env.TEST_POSTGRESQL_HOST ||
process.env.POSTGRESQL_HOST || process.env.PGHOST || 'localhost';
process.env.PGPORT = process.env.TEST_POSTGRESQL_PORT ||
process.env.POSTGRESQL_PORT || process.env.PGPORT || 5432;
process.env.PGUSER = process.env.TEST_POSTGRESQL_USER ||
process.env.POSTGRESQL_USER || process.env.PGUSER || 'test';
process.env.PGPASSWORD = process.env.TEST_POSTGRESQL_PASSWORD ||
process.env.POSTGRESQL_PASSWORD || process.env.PGPASSWORD || '';
process.env.PGHOST = process.env.POSTGRESQL_HOST ||
process.env.PGHOST ||
'localhost';
process.env.PGPORT = process.env.POSTGRESQL_PORT ||
process.env.PGPORT ||
5432;
process.env.PGUSER = process.env.POSTGRESQL_USER ||
process.env.PGUSER ||
'test';
process.env.PGPASSWORD = process.env.POSTGRESQL_PASSWORD ||
process.env.PGPASSWORD ||
'';
config = {
host: process.env.PGHOST,
port: process.env.PGPORT,
database: process.env.TEST_POSTGRESQL_DATABASE || 'emptytest',
database: process.env.POSTGRESQL_DATABASE || 'emptytest',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we support PGDATABASE too, for consistency with other PG* env vars?

Copy link
Contributor Author

@superkhau superkhau Oct 7, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Outside the scope of this PR, but yes we should add it (I'll send another PR after landing this).

Copy link
Contributor Author

@superkhau superkhau Oct 7, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follow up PR at #178

username: process.env.PGUSER,
password: process.env.PGPASSWORD,
};
Expand Down