Skip to content

Use juggler@3 for running tests #166

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
Sep 15, 2016
Merged

Use juggler@3 for running tests #166

merged 1 commit into from
Sep 15, 2016

Conversation

0candy
Copy link
Contributor

@0candy 0candy commented Sep 7, 2016

@0candy 0candy self-assigned this Sep 7, 2016
@0candy 0candy added the #review label Sep 7, 2016
@0candy
Copy link
Contributor Author

0candy commented Sep 8, 2016

@superkhau / @bajtos PTAL

CI is failing as Postgres is not working on any of the environments. Have pinged @rmg and he's taking a look. It looks like its been broken since a week ago.

@rmg
Copy link
Contributor

rmg commented Sep 8, 2016

I'm pretty sure I've tracked down the problem. I'll be deploying a fix soon (within a few hours, hopefully).

@rmg
Copy link
Contributor

rmg commented Sep 8, 2016

cis-jenkins builds are now working - and failing on node 0.10 due to Promise not being defined.

@superkhau
Copy link
Contributor

cis-jenkins builds are now working - and failing on node 0.10 due to Promise not being defined.

@0candy We can take care of this one, ping me on slack if you run into any issues.

@0candy
Copy link
Contributor Author

0candy commented Sep 9, 2016

@rmg I think postgres is down on the windows machine.

@rmg
Copy link
Contributor

rmg commented Sep 13, 2016

Had to fix a couple issues with the Windows environments. Will hopefully work on the next build.

@slnode test please

@@ -15,6 +15,11 @@ var ParameterizedSQL = SqlConnector.ParameterizedSQL;
var util = require('util');
var debug = require('debug')('loopback:connector:postgresql');

// Add support for node 0.10.x
if (typeof Promise == 'undefined') {
global.Promise = require('promise-polyfill');
Copy link
Member

Choose a reason for hiding this comment

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

We usually use bluebird instead of promise-polyfill. I am proposing to use bluebird here too, for the sake of consistency.

Thoughts?

Copy link
Member

Choose a reason for hiding this comment

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

This is actually weird.

https://github.com/strongloop/loopback-datasource-juggler/blob/master/3.0-RELEASE-NOTES.md#always-use-bluebird-as-promise-library

In version 3.0, we always use bluebird as our promise library instead of global.Promise. We consider Bluebird API a part of LoopBack API from now on, you are welcome to use any Bluebird-specific methods in your applications.

When using juggler@3, it should not be needed to patch global.Promise. Unless there is a rouge test in juggler that uses global.Promise instead of require('bluebird'), in which case we need to make the fix in juggler.

@superkhau @0candy could you PTAL?

Copy link
Contributor Author

@0candy 0candy Sep 14, 2016

Choose a reason for hiding this comment

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

cis-jenkins builds are now working - and failing on node 0.10 due to Promise not being defined.

I was looking into it and pg uses pg-pool which states this:
https://www.npmjs.com/package/pg-pool#bring-your-own-promise

Copy link
Contributor

Choose a reason for hiding this comment

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

We should be using bluebird for v0.10, Promise is not defined because native promises (global.Promise) are not supported in v0.10.

@0candy 0candy force-pushed the update/juggler3 branch 2 times, most recently from 1313d3b to c5bf1fa Compare September 14, 2016 14:55
@superkhau
Copy link
Contributor

test please

@@ -15,6 +15,9 @@ var ParameterizedSQL = SqlConnector.ParameterizedSQL;
var util = require('util');
var debug = require('debug')('loopback:connector:postgresql');

// Add support for node 0.10.x
Copy link
Contributor

Choose a reason for hiding this comment

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

remove

"eslint": "^2.13.1",
"eslint-config-loopback": "^4.0.0",
"loopback-datasource-juggler": "^2.28.0",
"loopback-datasource-juggler": "^3.0.0-alpha.7",
Copy link
Contributor

Choose a reason for hiding this comment

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

alpha.8

Copy link
Contributor

@superkhau superkhau left a comment

Choose a reason for hiding this comment

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

Merge once CI is green! 🚢

Copy link
Contributor

@superkhau superkhau left a comment

Choose a reason for hiding this comment

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

CI is failing due to pg-pool using native promises. We need to inject a config to tell pg (and downstream) pg-pool to use bluebird as our promise lib. See https://github.com/brianc/node-postgres/blob/b1b2801c710d550f2b10910dfd49ad51bbf569fd/lib/pool-factory.js#L12

@superkhau
Copy link
Contributor

I think on https://github.com/strongloop/loopback-connector-postgresql/blob/master/lib/postgresql.js#L77, you can add Promise: require('bluebird') to the clientConfigs for the fix.

@0candy 0candy merged commit e574520 into master Sep 15, 2016
@0candy 0candy deleted the update/juggler3 branch September 15, 2016 01:41
@0candy 0candy removed the #review label Sep 15, 2016
@bajtos
Copy link
Member

bajtos commented Sep 15, 2016

Nice, I like the final version 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants