upsertWithWhere feature support in juggler DAO [2.x] - #1052
Conversation
ac5777c to
87dab69
Compare
|
@bajtos @superkhau I just simply cherry-picked @mountain1234585's PR to |
|
@slnode test please |
|
@Amir-61 are those connectors implementing the new method |
|
The CI build failure only confirms my guess. |
|
I think we need to come up with a mechanism allowing connectors to choose which parts of the shared test suite they want to run. I think the easiest solution is to modify juggler to conditionally skip |
|
@slnode test please |
I'm not very clear why the failure is expected. If
This made sense for replaceOrCreate where we need to skip tests for connectors which do not implement Apart from that tests for other methods fail which are definitely irrelevant like |
Ah, of course. In that case I don't know what else may be the cause. Did you try to reproduce this on your local machine? Both MongoDB and MySQL connectors are easy to set up IIRC. |
|
@Amir-61 I tried to set up mongodb connector (v1.15.2) locally, and put my code changes to the datasource-juggler. I noticed,the persistence hooks tests were failing. I also observed, the way the updateOrCreate test cases are written in 2.x ( I did a npm install in mongodb) is slightly different in 3.x. I tried to change my "upsertWithWhere" tests based on the way they are written in 2.x. Also, I am not able to see any console.log statements at the prompt where I am running the tests. Is there a way to view them ? Please find below the results: |
|
@mountain1234585 |
|
@Amir-61 I have not made any commits on 1001 after you landed them on 3.x. I was trying to change the tests on my local setup and run them. |
Oh ok good thanks! |
87dab69 to
0d36eb5
Compare
|
@bajtos @mountain1234585 @raymondfeng So I landed the implementation of I have absolutely no idea why tests on Failure message: The test is not checking if |
|
FYI: I just tested mongodb with the latest commit of juggler on |
I believe the connectors are getting the latest version that matches the specification in their I was actually thinking about this recently, I think we should create a new protected branch in each connector that will track |
So thats definitely the problem! What is the point of running connectors as dependencies while they are not pulling changes from master for |
f49f094 to
d91b356
Compare
|
@slnode test please |
63c1a24 to
248f772
Compare
|
@mountain1234585 Our CI was faulty; although your PR#1001 was breaking dependencies (connectors) with tons of failures, CI was not reporting them on The commit needs to be forward-ported to @bajtos @superkhau Please review. Edit: Please don't get overwhelmed with changes in |
|
|
||
| TestModel.observe('access', function(ctx, next) { | ||
| ctx.query = { where: { id: { neq: existingInstance.id }}}; | ||
| ctx.query = { where: { id: { eq: existingInstance.id }}}; |
There was a problem hiding this comment.
This is changing the intent of the test. Before, the query did not match the existing instance, I presume a new record was created? Now the existing record is updated. Is that ok?
12f85a3 to
6e7bc32
Compare
|
|
||
| TestModel.upsertWithWhere({ id: existingInstance.id }, | ||
| { id: 'ignored', name: 'new name' }, | ||
| { name: 'new name' }, |
There was a problem hiding this comment.
Please note for non-atomic implementation id change in data object does not get ignored; for more info please see: https://github.com/strongloop/loopback-datasource-juggler/blob/72200ce935367cffc7c7df3b6cffc625acb8192a/lib/dao.js#L3020-L3033
|
@slnode test please |
1 similar comment
|
@slnode test please |
|
@bajtos Thanks for the review! I applied your feedback. |
|
@Amir-61 please capture the information from #1052 (comment) in a comment in the test source code. I don't have any more comments. |
faee9d4 to
d7c0d0b
Compare
|
I want to land this PR with the fixes; however, it seems a KV test fails in Also I forward-port the tests fixes to master; please review this PR: #1073 |
@superkhau could you PTAL? you were fixing KV-related CI failures recently. |
d7c0d0b to
12aadd4
Compare
|
Fixed the failures for this PR and landed to both master and |
Backport from #1001