-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Add __type property to GeoPoint fields in PostgresStorageAdapter #3695
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
Conversation
Thanks for the PR! Could you add a test so we make sure we don't add any regression at a later time? |
Codecov Report
@@ Coverage Diff @@
## master #3695 +/- ##
==========================================
+ Coverage 90.37% 90.41% +0.04%
==========================================
Files 114 114
Lines 7405 7405
==========================================
+ Hits 6692 6695 +3
+ Misses 713 710 -3
Continue to review full report at Codecov.
|
No problem, but how should I approach this? i'm finding hard to run on Windows through Cygwin (complains I it can't connect to the mongodb instance) and I can't figure out how to run the test with Postgers. Is there any guide on how to run the tests? I was thinking of adding something of this sort: it('encodes into a JSON with __type field which can be parsed into ParseGeoPoint type', done => {
var point = new Parse.GeoPoint(44.0, -11.0);
var obj = new TestObject();
obj.set('location', point);
obj.set('name', 'Zhoul')
obj.save(null, {
success: () => {
var query = new Parse.Query(TestObject);
query.find({
success: function(results) {
equal(results.length, 1);
var pointAgain = results[0].get('location');
ok(pointAgain);
ok(pointAgain instanceof Parse.GeoPoint);
equal(pointAgain.latitude, 44.0);
equal(pointAgain.longitude, -11.0);
done();
}
});
}
})
}); Do you think this is enough? Could you test this with Postgres and see if it's passing? |
Probably directly against a raw HTTP call, this way we can inspect thé JSON body. What do you think? |
Sounds good! Just need some guidance on how to run tests with postgres instead of mongo. |
Ah right, did you look into the .travis.yaml file at the root of the repo? |
First you'll need postgres 9.5 with postGIS extension installed. Then:
|
Done! |
@zhoul-HS I'll try to release a new version before the end of the week. Just need to make sure all relevant PR's are merged before we release :) |
Thanks! I'll figure out a workaround in the meantime |
Resolves #3694