Skip to content
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

[Spike] Fix CI Failures (dashdb) #76

Closed
b-admike opened this issue Sep 10, 2018 · 9 comments
Closed

[Spike] Fix CI Failures (dashdb) #76

b-admike opened this issue Sep 10, 2018 · 9 comments

Comments

@b-admike
Copy link
Contributor

b-admike commented Sep 10, 2018

Timeboxed to week and a half

Description/Steps to reproduce

Right now, we have test cases (29) failing for CI runs on master. We need to fix them, so that we have master passing and so that new pull requests do not have to ignore / worry about them.

@b-admike b-admike changed the title Fix CI Failures Fix CI Failures (dashdb) Sep 10, 2018
@dhmlau dhmlau added the TOB label Oct 9, 2018
@b-admike b-admike changed the title Fix CI Failures (dashdb) [Spike] Fix CI Failures (dashdb) Oct 16, 2018
@dhmlau dhmlau added 2019Q2 and removed TOB labels Feb 11, 2019
@dhmlau dhmlau added the p1 label Apr 9, 2019
@dhmlau dhmlau added p2 and removed p1 labels May 27, 2019
@agnes512 agnes512 added this to the July 2019 milestone milestone Jun 27, 2019
@emonddr emonddr self-assigned this Jul 9, 2019
@emonddr emonddr mentioned this issue Jul 11, 2019
2 tasks
@emonddr
Copy link
Contributor

emonddr commented Jul 12, 2019

A new dashdb VM was set up.

The only failing test in the Jenkins CI build is:

dashdb imported features ( in loopback-connector-dashdb/test/imported.test.js )
manipulation (in loopback-datasource-juggler/test/manipulation.test.js)
create
should refuse to create object with duplicate id:
Error: Create should have rejected duplicate id.

Here is the actual test case code :

    bdd.itIf(connectorCapabilities.refuseDuplicateInsert !== false, 'should refuse to create ' +
    'object with duplicate id', function(done) {
      // NOTE(bajtos) We cannot reuse Person model here,
      // `settings.forceId` aborts the CREATE request at the validation step.
      const Product = db.define('ProductTest', {name: String}, {forceId: false});
      db.automigrate('ProductTest', function(err) {
        if (err) return done(err);

        Product.create({name: 'a-name'}, function(err, p) {
          if (err) return done(err);
          Product.create({id: p.id, name: 'duplicate'}, function(err, result) {
            if (!err) {
              return done(new Error('Create should have rejected duplicate id.'));
            }
            err.message.should.match(/duplicate/i);
            done();
          });
        });
      });
    });
  });

@emonddr
Copy link
Contributor

emonddr commented Jul 12, 2019

What's confusing is when , on my laptop, I set my environment variables to the same values as the updated variables in Jenkins (including IP to new dashdb VM), I get different failures :


> [email protected] pretest /Users/dremond/Documents/PRs_LoopBack/connector-dashdb-failures/loopback-connector-dashdb
> node pretest.js

Skipping pre-test ...

> [email protected] test /Users/dremond/Documents/PRs_LoopBack/connector-dashdb-failures/loopback-connector-dashdb
> mocha --timeout 20000 --require test/init.js



  testConnection
    ✓ should pass with valid settings (799ms)
    ✓ should pass when valid DSN overrides empty settings (714ms)
    ✓ should pass when valid DSN overrides invalid settings (703ms)

  parameterized SQL
    ✓ does not return result with SQL injection (228ms)

  query test
    ✓ find all data (218ms)
    regexp operator
      using no flags
        ✓ as regex string (222ms)
        ✓ as regex literal (214ms)
        ✓ as regex object (216ms)
      using flags
        ✓ as regex string (223ms)
        ✓ as regex literal (218ms)
        ✓ as regex object (214ms)
    like operator
      ✓ find using like operator (250ms)
    nlike operator
      ✓ find using nlike operator (220ms)

  transactions
    commit and rollback
      commit
        ✓ should not see the uncommitted insert (737ms)
        ✓ should see the uncommitted insert from the same transaction (109ms)
        ✓ should commit a transaction (110ms)
        ✓ should see the committed insert (215ms)
      rollback
        ✓ should not see the uncommitted insert (217ms)
        ✓ should see the uncommitted insert from the same transaction (111ms)
        ✓ should rollback a transaction (114ms)
        ✓ should not see the rolledback insert (213ms)

  discoverModels
    Discover database schemas
      ✓ should return an array of db schemas (731ms)
    Discover models including views
      ✓ should return an array of tables and views (720ms)
    Discover current user's tables
      ✓ should return an array of tables for the current user (217ms)
    Discover models excluding views
      1) should return an array of only tables

  Discover models including other users
    ✓ should return an array of all tables and views (230ms)

  Discover model properties
    Discover a named model
      2) should return an array of columns for PRODUCT

  Discover model primary keys
    ✓ should return an array of primary keys for PRODUCT (523ms)
    ✓ should return an array of primary keys for STRONGLOOP.PRODUCT (897ms)

  Discover model foreign keys
    ✓ should return an array of foreign keys for INVENTORY (214ms)
    ✓ should return an array of foreign keys for STRONGLOOP.INVENTORY (210ms)

  Discover LDL schema from a table
    ✓ should return an LDL schema for INVENTORY (740ms)
    3) should return an LDL schema for INVENTORY

  30 passing (40s)
  3 failing

  1) discoverModels
       Discover models excluding views
         should return an array of only tables:
     Uncaught AssertionError: expected Array [] to have property length of 3 (got 0)
      at Assertion.fail (node_modules/should/cjs/should.js:275:17)
      at Assertion.value (node_modules/should/cjs/should.js:356:19)
      at /Users/dremond/Documents/PRs_LoopBack/connector-dashdb-failures/loopback-connector-dashdb/test/discovery.test.js:99:30
      at /Users/dremond/Documents/PRs_LoopBack/connector-dashdb-failures/loopback-connector-dashdb/node_modules/loopback-connector/lib/sql.js:1841:7
      at /Users/dremond/Documents/PRs_LoopBack/connector-dashdb-failures/loopback-connector-dashdb/node_modules/async/dist/async.js:3888:9
      at /Users/dremond/Documents/PRs_LoopBack/connector-dashdb-failures/loopback-connector-dashdb/node_modules/async/dist/async.js:473:16
      at iteratorCallback (node_modules/async/dist/async.js:1064:13)
      at /Users/dremond/Documents/PRs_LoopBack/connector-dashdb-failures/loopback-connector-dashdb/node_modules/async/dist/async.js:969:16
      at /Users/dremond/Documents/PRs_LoopBack/connector-dashdb-failures/loopback-connector-dashdb/node_modules/async/dist/async.js:3885:13
      at /Users/dremond/Documents/PRs_LoopBack/connector-dashdb-failures/loopback-connector-dashdb/node_modules/loopback-datasource-juggler/lib/observer.js:250:22
      at doNotify (node_modules/loopback-datasource-juggler/lib/observer.js:155:49)
      at DASHDB.ObserverMixin._notifyBaseObservers (node_modules/loopback-datasource-juggler/lib/observer.js:178:5)
      at DASHDB.ObserverMixin.notifyObserversOf (node_modules/loopback-datasource-juggler/lib/observer.js:153:8)
      at cbForWork (node_modules/loopback-datasource-juggler/lib/observer.js:240:14)
      at /Users/dremond/Documents/PRs_LoopBack/connector-dashdb-failures/loopback-connector-dashdb/node_modules/loopback-connector/lib/sql.js:648:9
      at /Users/dremond/Documents/PRs_LoopBack/connector-dashdb-failures/loopback-connector-dashdb/node_modules/loopback-ibmdb/lib/ibmdb.js:281:11
      at Database.db.close (node_modules/ibm_db/lib/odbc.js:1745:13)
      at /Users/dremond/Documents/PRs_LoopBack/connector-dashdb-failures/loopback-connector-dashdb/node_modules/loopback-ibmdb/lib/ibmdb.js:280:14
      at /Users/dremond/Documents/PRs_LoopBack/connector-dashdb-failures/loopback-connector-dashdb/node_modules/loopback-ibmdb/lib/ibmdb.js:268:20
      at /Users/dremond/Documents/PRs_LoopBack/connector-dashdb-failures/loopback-connector-dashdb/node_modules/ibm_db/lib/odbc.js:565:76

  2) Discover model properties
       Discover a named model
         should return an array of columns for PRODUCT:
     Error: Timeout of 20000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/Users/dremond/Documents/PRs_LoopBack/connector-dashdb-failures/loopback-connector-dashdb/test/discovery.test.js)
  

  3) Discover LDL schema from a table
       should return an LDL schema for INVENTORY:
     Uncaught TypeError: Cannot read property 'name' of undefined
      at /Users/dremond/Documents/PRs_LoopBack/connector-dashdb-failures/loopback-connector-dashdb/test/discovery.test.js:259:25
      at /Users/dremond/Documents/PRs_LoopBack/connector-dashdb-failures/loopback-connector-dashdb/node_modules/loopback-datasource-juggler/lib/datasource.js:1492:13
      at /Users/dremond/Documents/PRs_LoopBack/connector-dashdb-failures/loopback-connector-dashdb/node_modules/loopback-datasource-juggler/lib/datasource.js:1573:7
      at /Users/dremond/Documents/PRs_LoopBack/connector-dashdb-failures/loopback-connector-dashdb/node_modules/async/dist/async.js:3888:9
      at /Users/dremond/Documents/PRs_LoopBack/connector-dashdb-failures/loopback-connector-dashdb/node_modules/async/dist/async.js:473:16
      at iteratorCallback (node_modules/async/dist/async.js:1064:13)
      at /Users/dremond/Documents/PRs_LoopBack/connector-dashdb-failures/loopback-connector-dashdb/node_modules/async/dist/async.js:969:16
      at /Users/dremond/Documents/PRs_LoopBack/connector-dashdb-failures/loopback-connector-dashdb/node_modules/async/dist/async.js:3885:13
      at /Users/dremond/Documents/PRs_LoopBack/connector-dashdb-failures/loopback-connector-dashdb/node_modules/loopback-datasource-juggler/lib/observer.js:250:22
      at doNotify (node_modules/loopback-datasource-juggler/lib/observer.js:155:49)
      at DASHDB.ObserverMixin._notifyBaseObservers (node_modules/loopback-datasource-juggler/lib/observer.js:178:5)
      at DASHDB.ObserverMixin.notifyObserversOf (node_modules/loopback-datasource-juggler/lib/observer.js:153:8)
      at cbForWork (node_modules/loopback-datasource-juggler/lib/observer.js:240:14)
      at /Users/dremond/Documents/PRs_LoopBack/connector-dashdb-failures/loopback-connector-dashdb/node_modules/loopback-connector/lib/sql.js:648:9
      at /Users/dremond/Documents/PRs_LoopBack/connector-dashdb-failures/loopback-connector-dashdb/node_modules/loopback-ibmdb/lib/ibmdb.js:281:11
      at Database.db.close (node_modules/ibm_db/lib/odbc.js:1745:13)
      at /Users/dremond/Documents/PRs_LoopBack/connector-dashdb-failures/loopback-connector-dashdb/node_modules/loopback-ibmdb/lib/ibmdb.js:280:14
      at /Users/dremond/Documents/PRs_LoopBack/connector-dashdb-failures/loopback-connector-dashdb/node_modules/loopback-ibmdb/lib/ibmdb.js:268:20
      at /Users/dremond/Documents/PRs_LoopBack/connector-dashdb-failures/loopback-connector-dashdb/node_modules/ibm_db/lib/odbc.js:565:76




  Discover and build models
    4) should discover and build models

  dashdb imported features
    datatypes
      ✓ should resolve top-level "type" property correctly
      ✓ should resolve "type" sub-property correctly
      ✓ should resolve array prop with connector specific metadata
      ✓ should coerce array of dates from string (235ms)
      ✓ should coerce array of numbers from string (228ms)
      ✓ should return 400 when property of type array is set to string value
      ✓ should return 400 when property of type array is set to object value
      ✓ should keep types when get read data from db (682ms)
      ✓ should respect data types when updating attributes (1151ms)
      ✓ should not coerce nested objects into ModelConstructor types
      ✓ rejects array value converted to NaN for a required property
      ✓ handles null data (827ms)
      model option persistUndefinedAsNull
        ✓ should set missing optional properties to null (460ms)
        ✓ should convert property value undefined to null (441ms)
        ✓ should convert undefined to null in the setter
        ✓ should use null in unsetAttribute()
        ✓ should convert undefined to null on save (790ms)
        ✓ should convert undefined to null in toObject()
    basic-querying
      ping
        ✓ should be able to test connections (214ms)
      findById
        ✓ should query by id: not found (215ms)
        ✓ should query by id: found (492ms)
      findByIds
        ✓ should query by ids (222ms)
        ✓ should query by ids and condition (224ms)
        ✓ should query by ids to check null property (226ms)
      find
        ✓ should query collection (345ms)
        ✓ should query limited collection (306ms)
        ✓ should query collection with skip & limit (303ms)
        ✓ should query collection with offset & limit (288ms)
        ✓ should query filtered collection (894ms)
        ✓ should query collection sorted by numeric field (310ms)
        ✓ should query collection desc sorted by numeric field (317ms)
        ✓ should query collection sorted by string field (294ms)
        ✓ should query collection desc sorted by string field (323ms)
        ✓ should query sorted desc by order integer field even though there is an async model loaded hook (355ms)
        ✓ should support "and" operator that is satisfied (284ms)
        ✓ should support "and" operator that is not satisfied (222ms)
        ✓ should support "or" that is satisfied (280ms)
        ✓ should support "or" operator that is not satisfied (297ms)
        ✓ should support where date "neq" null (324ms)
        ✓ should support where date is null (274ms)
        ✓ should support date "gte" that is satisfied (263ms)
        ✓ should support date "gt" that is not satisfied (245ms)
        ✓ should support date "gt" that is satisfied (304ms)
        ✓ should support date "lt" that is satisfied (288ms)
        ✓ should support number "gte" that is satisfied (380ms)
        ✓ should support number "gt" that is not satisfied (222ms)
        ✓ should support number "gt" that is satisfied (257ms)
        ✓ should support number "lt" that is satisfied (299ms)
        ✓ should support number "gt" that is satisfied by null value (220ms)
        ✓ should support number "lt" that is not satisfied by null value (212ms)
        ✓ should support string "gte" that is satisfied by null value (216ms)
        ✓ should support string "gte" that is satisfied (324ms)
        ✓ should support string "gt" that is not satisfied (294ms)
        ✓ should support string "gt" that is satisfied (320ms)
        ✓ should support string "lt" that is satisfied (265ms)
        ✓ should support boolean "gte" that is satisfied (301ms)
        ✓ should support boolean "gt" that is not satisfied (221ms)
        ✓ should support boolean "gt" that is satisfied (305ms)
        ✓ should support boolean "lt" that is satisfied (304ms)
        - [UNSUPPORTED] - supports non-empty inq
        - [UNSUPPORTED] - supports empty inq
        ✓ should only include fields as specified (1093ms)
        ✓ should ignore non existing properties when excluding (312ms)
        ✓ applies default values by default (2396ms)
        ✓ preserves empty values from the database when "applyDefaultsOnReads" is false (1456ms)
        [UNSUPPORTED] - ilike
          - should support "like" that is satisfied
          - should support "like" that is not satisfied
          - should support "ilike" that is satisfied
          - should support "ilike" that is not satisfied
        [UNSUPPORTED] - nilike
          - should support "nlike" that is satisfied
          - should support "nilike" that is satisfied
        geo queries
          near filter
            ✓ supports a basic "near" query (335ms)
            ✓ supports "near" inside a coumpound query with "and" (373ms)
            ✓ supports "near" inside a complex coumpound query with multiple "and" (463ms)
            ✓ supports multiple "near" queries with "or" (308ms)
            ✓ supports multiple "near" queries with "or" inside a coumpound query with "and" (316ms)
        [UNSUPPORTED] - query with nested property
          - should support nested property in query
          - should support nested property with regex over arrays in query
          - should support nested property with gt in query
          - [UNSUPPORTED] - should support nested property for order in query
          - should support multi-level nested array property in query
          - should fail when querying with an invalid value for a type
      count
        ✓ should query total count (229ms)
        ✓ should query filtered count (217ms)
      findOne
        ✓ should find first record (default sort by id) (458ms)
        - [UNSUPPORTED] - should find first record
        - [UNSUPPORTED] - should find last record
        - [UNSUPPORTED] - should find last record in filtered set
        ✓ should work even when find by id (436ms)
      exists
        ✓ should check whether record exist (440ms)
        ✓ should check whether record not exist (434ms)
      updateAll
        ✓ coerces primitive datatypes on update (668ms)
        ✓ coerces primitive array datatypes on update (672ms)
    regexp operator
      ✓ should return an error for invalid data types
    queries
      that do not require an id
        - should work for create
        - should work for updateOrCreate/upsert
        - should work for findOrCreate
        - should work for exists
        - should work for find
        - should work for findOne
        - should work for deleteAll/destroyAll/remove
        - should work for update/updateAll
        - should work for count
      that require an id
        - should return an error for findById
        - should return an error for findByIds
        - should return an error for deleteById/destroyById/removeById
        - should return an error for instance.save
        - should return an error for instance.delete
        - should return an error for instance.updateAttribute
        - should return an error for instance.updateAttributes
    manipulation
      create
        ✓ should create instance (440ms)
        ✓ should create instance (promise variant) (440ms)
        ✓ should instantiate an object (223ms)
        ✓ should instantiate an object (promise variant) (220ms)
        ✓ should not return instance of object (531ms)
        ✓ should not allow user-defined value for the id of object - create
        ✓ should not allow user-defined value for the id of object - create (promise variant)
        ✓ should not allow user-defined value for the id of object - save
        ✓ should not allow user-defined value for the id of object - save (promise variant)
        ✓ should work when called without callback (242ms)
        ✓ should create instance with blank data (432ms)
        ✓ should create instance with blank data (promise variant) (442ms)
        ✓ should work when called with no data and callback (249ms)
        ✓ should create batch of objects (1208ms)
        ✓ should create batch of objects (promise variant) (766ms)
        ✓ should create batch of objects with beforeCreate (326ms)
        ✓ should preserve properties with "undefined" value (446ms)
        5) should refuse to create object with duplicate id
        forceId
          ✓ it defaults to forceId:true for generated id property
      save
        ✓ should save new object (219ms)
        ✓ should save new object (promise variant) (226ms)
        ✓ should save existing object (777ms)
        ✓ should save existing object (promise variant) (1109ms)
        ✓ should save invalid object (skipping validation) (577ms)
        ✓ should save invalid object (skipping validation - promise variant) (547ms)
        ✓ should save throw error on validation (217ms)
        ✓ should preserve properties with dynamic setters (779ms)
      updateAttributes
        ✓ should have updated password hashed with updateAttribute (665ms)
        ✓ should reject created StubUser with empty password
        ✓ should reject updated empty password with updateAttribute (233ms)
        ✓ should update one attribute (530ms)
        ✓ should update one attribute (promise variant) (439ms)
        ✓ should ignore undefined values on updateAttributes (442ms)
        ✓ should discard undefined values before strict validation (657ms)
        ✓ should allow unknown attributes when strict: false (434ms)
        ✓ should remove unknown attributes when strict: filter (457ms)
        ✓ should return error on unknown attributes when strict: true (451ms)
        ✓ should fallback to strict:true when using strict: throw (452ms)
        ✓ should fallback to strict:true when using strict:validate (436ms)
        ✓ should allow same id value on updateAttributes (434ms)
        ✓ should allow same stringified id value on updateAttributes (431ms)
        ✓ should fail if an id value is to be changed on updateAttributes
        ✓ has an alias "patchAttributes"
        ✓ should allow model instance on updateAttributes (443ms)
        ✓ should allow model instance on updateAttributes (promise variant) (450ms)
        ✓ should raises on connector error
      updateOrCreate
        ✓ has an alias "patchOrCreate"
        ✓ creates a model when one does not exist (437ms)
        ✓ updates a model if it exists (761ms)
        ✓ should reject updated empty password with updateOrCreate (433ms)
        ✓ throws error for queries with array input
        ✓ should preserve properties with dynamic setters on create (445ms)
        ✓ should preserve properties with dynamic setters on update (905ms)
        ✓ should preserve properties with "undefined" value (573ms)
        ✓ updates specific instances when PK is not an auto-generated id (1247ms)
        ✓ should allow save() of the created instance (682ms)
      updateOrCreate when forceId is true
        ✓ fails when id does not exist in db & validate is true (225ms)
        ✓ fails when id does not exist in db & validate is false (220ms)
        ✓ fails when id does not exist in db & validate is false when using updateAttributes (239ms)
        ✓ works on create if the request does not include an id (227ms)
        ✓ works on update if the request includes an existing id in db (848ms)
      replaceOrCreate
        ✓ works without options on create (promise variant) (561ms)
        ✓ works with options on create (promise variant) (646ms)
        ✓ works without options on update (promise variant) (900ms)
        ✓ works with options on update (promise variant) (1205ms)
        ✓ works without options on update (callback variant) (864ms)
        ✓ works with options on update (callback variant) (865ms)
        ✓ works without options on create (callback variant) (642ms)
        ✓ works with options on create (callback variant) (646ms)
      replaceOrCreate when forceId is true
        ✓ fails when id does not exist in db (228ms)
        ✓ works on create if the request does not include an id (226ms)
        ✓ works on update if the request includes an existing id in db (667ms)
      replaceAttributes
        ✓ should have updated password hashed with replaceAttributes (874ms)
        ✓ should reject updated empty password with replaceAttributes (215ms)
        ✓ should ignore PK if it is set for `instance`in `before save` operation hook (890ms)
        ✓ should set cannotOverwritePKInBeforeSaveHook flag, if `instance` in`before save` operation hook is set, so we report a warning just once (652ms)
        ✓ should ignore PK if it is set for `data`in `loaded` operation hook (1219ms)
        ✓ should set cannotOverwritePKInLoadedHook flag, if `instance` in`before save` operation hook is set, so we report a warning just once (973ms)
        ✓ works without options(promise variant) (1185ms)
        ✓ works with options(promise variant) (907ms)
        ✓ should fail when changing id (217ms)
        ✓ works without options(callback variant) (654ms)
        ✓ works with options(callback variant) (650ms)
      replaceById
        ✓ fails when id does not exist in db using replaceById (224ms)
      findOrCreate
        ✓ should create a record with if new (450ms)
        ✓ should find a record if exists (246ms)
        ✓ should create a record with if new (promise variant) (436ms)
        ✓ should find a record if exists (promise variant) (220ms)
        ✓ applies default values on returned data (1463ms)
        ✓ preserves empty values from the database when "applyDefaultsOnReads" is false (1461ms)
      destroy
        ✓ should destroy record (1277ms)
        ✓ should destroy record (promise variant) (675ms)
        ✓ should destroy all records (655ms)
        ✓ should destroy all records (promise variant) (1194ms)
        - should destroy filtered set of records
      deleteAll/destroyAll
        ✓ should be defined as function
        ✓ should only delete instances that satisfy the where condition (670ms)
        ✓ should report zero deleted instances when no matches are found (434ms)
        ✓ should delete all instances when the where condition is not provided (444ms)
      [UNSUPPORTED] - deleteAll/destroyAll case 2
        - should be defined as function
        - should only delete instances that satisfy the where condition
        - should report zero deleted instances when no matches are found
        - should delete all instances when the where condition is not provided
      deleteById
        ✓ should allow deleteById(id) - success (448ms)
        ✓ should allow deleteById(id) - fail (212ms)
        ✓ should allow deleteById(id) - fail with error (216ms)
      prototype.delete
        ✓ should allow delete(id) - success (450ms)
        ✓ should allow delete(id) - fail (716ms)
        ✓ should allow delete(id) - fail with error (653ms)
      initialize
        ✓ should initialize object properly
        Date $now function (type: Date)
          ✓ should report current date as default value for date property
        Date $now function (type: String)
          ✓ should report '$now' as default value for string property
        now defaultFn
          ✓ should generate current time when "defaultFn" is "now" (229ms)
        guid defaultFn
          ✓ should generate a new id when "defaultFn" is "guid" (225ms)
        uuid defaultFn
          ✓ should generate a new id when "defaultfn" is "uuid" (224ms)
        uuidv4 defaultFn
          ✓ should generate a new id when "defaultfn" is "uuidv4" (493ms)
        shortid defaultFn
          ✓ should generate a new id when "defaultFn" is "shortid" (229ms)
      property value coercion
        ✓ should coerce boolean types properly
        ✓ should coerce date types properly
      update/updateAll
        ✓ should be defined as a function
        ✓ should not update instances that do not satisfy the where condition (450ms)
        ✓ should only update instances that satisfy the where condition (431ms)
        ✓ should reject updated empty password with updateAll (234ms)
        ✓ should update all instances when the where condition is not provided (652ms)
        ✓ should ignore where conditions with undefined values (440ms)
        ✓ should not coerce invalid values provided in where conditions
      upsertWithWhere
        ✓ has an alias "patchOrCreateWithWhere"
        ✓ should preserve properties with dynamic setters on create (667ms)
        ✓ should preserve properties with dynamic setters on update (970ms)
        ✓ should preserve properties with "undefined" value (678ms)
        ✓ should allow save() of the created instance (775ms)
        ✓ works without options on create (promise variant) (654ms)
        ✓ works with options on create (promise variant) (650ms)
        ✓ works without options on update (promise variant) (874ms)
        ✓ works with options on update (promise variant) (879ms)
        ✓ fails the upsertWithWhere operation when data object is empty
        ✓ creates a new record when no matching instance is found (662ms)
        ✓ fails the upsertWithWhere operation when multiple instances are retrieved based on the filter criteria (934ms)
        ✓ updates the record when one matching instance is found based on the filter criteria (904ms)
    hooks
      initialize
        ✓ should be triggered on new
        ✓ should be triggered on create (228ms)
      create
        ✓ should be triggered on create (226ms)
        ✓ should not be triggered on new
        ✓ should be triggered on new+save (222ms)
        ✓ afterCreate should not be triggered on failed create
        ✓ afterCreate should not be triggered on failed beforeCreate
      save
        ✓ should be triggered on create (216ms)
        ✓ should be triggered on new+save (214ms)
        ✓ should be triggered on updateAttributes (569ms)
        ✓ should be triggered on save (552ms)
        ✓ should save full object (216ms)
        ✓ should save actual modifications to database (656ms)
        ✓ should save actual modifications on updateAttributes (928ms)
        ✓ beforeSave should be able to skip next (221ms)
      update
        ✓ should not be triggered on create
        ✓ should not be triggered on new+save
        ✓ should be triggered on updateAttributes (1084ms)
        ✓ should be triggered on save (558ms)
        ✓ should update limited set of fields (214ms)
        ✓ should not trigger after-hook on failed save (218ms)
      destroy
        ✓ should be triggered on destroy (459ms)
        ✓ should not trigger after-hook on failed destroy (221ms)
      lifecycle
        ✓ should describe create sequence (235ms)
        ✓ should describe new+save sequence (216ms)
        ✓ should describe updateAttributes sequence (225ms)
        ✓ should describe isValid sequence
        ✓ should describe destroy sequence (217ms)
    relations
      hasMany
        ✓ can be declared in different ways (484ms)
        ✓ can be declared in short form (803ms)
        with scope
          ✓ should build record on scope (451ms)
          ✓ should create record on scope (441ms)
          ✓ should not update FK (665ms)
          ✓ should create record on scope with promises (442ms)
          ✓ should create a batch of records on scope (653ms)
          ✓ should create a batch of records on scope with promises (669ms)
          ✓ should fetch all scoped instances (871ms)
          ✓ should fetch all scoped instances with promises (971ms)
          ✓ should fetch all scoped instances with find() with callback and condition (1605ms)
          ✓ should fetch all scoped instances with find() with callback and no condition (1105ms)
          ✓ should find scoped record (1117ms)
          ✓ should find scoped record with promises (1093ms)
          ✓ should count scoped records - all and filtered (1665ms)
          ✓ should count scoped records - all and filtered with promises (1350ms)
          ✓ should set targetClass on scope property
          ✓ should update scoped record (1102ms)
          ✓ should update scoped record with promises (1091ms)
          ✓ should destroy scoped record (1087ms)
          ✓ should destroy scoped record with promises (1092ms)
          ✓ should check existence of a scoped record (1154ms)
          ✓ should check existence of a scoped record with promises (1103ms)
          ✓ should check ignore related data on creation - array (216ms)
          ✓ should check ignore related data on creation with promises - array (229ms)
          ✓ should check ignore related data on creation - object (230ms)
          ✓ should check ignore related data on creation with promises - object (218ms)
      hasMany through
        ✓ should build record on scope (458ms)
        ✓ should create record on scope (1124ms)
        ✓ should create record on scope with promises (1178ms)
        ✓ should create multiple records on scope (1411ms)
        ✓ should create multiple records on scope with promises (1437ms)
        ✓ should fetch all scoped instances (2261ms)
        ✓ should fetch all scoped instances with promises (2202ms)
        ✓ should find scoped record (2673ms)
        ✓ should find scoped record with promises (2706ms)
        ✓ should allow to use include syntax on related data (2593ms)
        ✓ should allow to use include syntax on related data with promises (2395ms)
        ✓ should set targetClass on scope property
        ✓ should update scoped record (2000ms)
        ✓ should update scoped record with promises (2066ms)
        ✓ should destroy scoped record (1780ms)
        ✓ should destroy scoped record with promises (1799ms)
        ✓ should check existence of a scoped record (2412ms)
        ✓ should check existence of a scoped record with promises (2430ms)
        ✓ should allow to add connection with instance (905ms)
        ✓ should allow to add connection with instance with promises (932ms)
        ✓ should allow to add connection with through data (879ms)
        ✓ should allow to add connection with through data with promises (890ms)
        ✓ should allow to remove connection with instance (1372ms)
        ✓ should allow to remove connection with instance with promises (1321ms)
        fetch scoped instances with paging filters
          with filter skip
            ✓ skips the first patient (664ms)
          with filter order
            ✓ orders the result by patient name (652ms)
          with filter limit
            ✓ limits to 1 result (674ms)
          with filter fields
            ✓ includes field 'name' but not 'age' (669ms)
          with filter include
            ✓ returns physicians included in patient (1105ms)
          with filter where
            ✓ returns patient where id equal to samplePatientId (735ms)
            ✓ returns patient where name equal to samplePatient name (664ms)
            ✓ returns patients where id in an array (1400ms)
            ✓ returns empty result when patientId does not belongs to physician (657ms)
          findById with filter include
            ✓ returns patient where id equal to 'samplePatientId'with included physicians (868ms)
          findById with filter fields
            ✓ returns patient where id equal to 'samplePatientId'with field 'name' but not 'age' (437ms)
          findById with include filter that contains string fields
            ✓ should accept string and convert it to array (660ms)
        find over related model with options
          ✓ should find be filtered from option (2851ms)
      hasMany through - collect
        with default options
          ✓ can determine the collect by modelTo's name as default
        when custom reverse belongsTo names for both sides
          ✓ can determine the collect via keyThrough
          ✓ can determine the collect via modelTo name
          ✓ can determine the collect via modelTo name (with jams)
        when custom reverse belongsTo name for one side only
          ✓ can determine the collect via model name
          ✓ can determine the collect via keyThrough
      hasMany through - customized relation name and foreign key
        ✓ should use real target class
      hasMany through bi-directional relations on the same model
        ✓ should set foreignKeys of through model correctly in first relation (454ms)
        ✓ should set foreignKeys of through model correctly in second relation (217ms)
      hasMany through - between same models
        ✓ should set the keyThrough and the foreignKey (452ms)
        ✓ can determine the collect via keyThrough for each side
      hasMany with properties
        ✓ should create record on scope (468ms)
        ✓ should create record on scope with promises (433ms)
      hasMany with scope and properties
        ✓ can be declared with properties (459ms)
        ✓ should create record on scope (682ms)
        ✓ should create record on scope with promises (689ms)
        ✓ should find records on scope (436ms)
        ✓ should find records on scope with promises (428ms)
        ✓ should find record on scope - filtered (450ms)
        ✓ should find record on scope with promises - filtered (427ms)
        ✓ should create record on scope - properties (464ms)
        ✓ should find records on scope (438ms)
        ✓ should find record on scope - scoped (438ms)
        ✓ should find record on scope - scoped (428ms)
        ✓ should find count of records on scope - scoped (460ms)
        ✓ should delete records on scope - scoped (603ms)
        ✓ should find record on scope - verify (488ms)
      relations validation
        ✓ rejects belongsTo relation if `model` is not provided
        ✓ rejects polymorphic belongsTo relation if `model` is provided
        ✓ rejects polymorphic non belongsTo relation if `model` is not provided
        ✓ rejects polymorphic relation if `foreignKey` is provided but discriminator is missing
        ✓ rejects polymorphic relation if `discriminator` is provided but foreignKey is missing
        ✓ rejects polymorphic relation if `polymorphic.as` is provided along with custom foreignKey/discriminator
        ✓ rejects polymorphic relation if `polymorphic.selector` is provided along with custom foreignKey/discriminator
        ✓ warns on use of deprecated `polymorphic.as` keyword in polymorphic relation
      polymorphic hasOne
        ✓ can be declared using default polymorphic selector (587ms)
        ✓ should create polymorphic relation - Article (857ms)
        ✓ should create polymorphic relation with promises - article (655ms)
        ✓ should create polymorphic relation - reader (665ms)
        ✓ should find polymorphic relation - article (436ms)
        ✓ should find polymorphic relation - employee (448ms)
        ✓ should include polymorphic relation - article (470ms)
        ✓ should find polymorphic relation with promises - employee (428ms)
        ✓ should find inverse polymorphic relation - article (438ms)
        ✓ should include inverse polymorphic relation - article (450ms)
        ✓ should find inverse polymorphic relation - employee (435ms)
      polymorphic hasOne with non standard ids
        ✓ can be declared using custom foreignKey/discriminator (423ms)
        ✓ should create polymorphic relation - article (668ms)
        ✓ should create polymorphic relation with promises - article (660ms)
        ✓ should create polymorphic relation - employee (660ms)
        ✓ should find polymorphic relation - article (443ms)
        ✓ should find polymorphic relation - employee (455ms)
        ✓ should find inverse polymorphic relation - article (450ms)
        ✓ should find inverse polymorphic relation - employee (446ms)
        ✓ should include polymorphic relation - employee (440ms)
        ✓ should include inverse polymorphic relation - employee (438ms)
      polymorphic hasMany
        ✓ can be declared with model JSON definition when related model is already attached
        ✓ can be declared with model JSON definition when related model is not yet attached
        ✓ can be declared using default polymorphic selector (401ms)
        ✓ should create polymorphic relation - article (451ms)
        ✓ should create polymorphic relation - employee (456ms)
        ✓ should find polymorphic items - article (442ms)
        ✓ should find polymorphic items - employee (440ms)
        ✓ should find the inverse of polymorphic relation - article (440ms)
        ✓ should find the inverse of polymorphic relation - employee (442ms)
        ✓ should include the inverse of polymorphic relation (557ms)
        - [UNSUPPORTED] - should include the inverse of polymorphic relation w/o adhocSort
        ✓ should assign a polymorphic relation (445ms)
        ✓ should find polymorphic items - article (446ms)
        ✓ should find the inverse of polymorphic relation - article (439ms)
        ✓ should include the inverse of polymorphic relation - article (448ms)
        ✓ can be declared using custom foreignKey/discriminator (639ms)
      polymorphic hasAndBelongsToMany through
        ✓ can be declared using default polymorphic selector (455ms)
        ✓ can determine the collect via modelTo name
        ✓ should create polymorphic relation - article (1637ms)
        ✓ should create polymorphic relation - employee (882ms)
        ✓ should create polymorphic through model (434ms)
        ✓ should get polymorphic relation through model - article (675ms)
        ✓ should get polymorphic relation through model - employee (647ms)
        ✓ should include polymorphic items (658ms)
        ✓ should add to a polymorphic relation - article (915ms)
        ✓ should create polymorphic through model (222ms)
        ✓ should add to a polymorphic relation - article (668ms)
        ✓ should add to a polymorphic relation - article (659ms)
        ✓ should get the inverse polymorphic relation - article (656ms)
        ✓ should get the inverse polymorphic relation - reader (658ms)
        ✓ should find polymorphic items - article (704ms)
        ✓ should check if polymorphic relation exists - article (445ms)
        ✓ should remove from a polymorphic relation - article (435ms)
        ✓ should find polymorphic items - article (644ms)
        ✓ should check if polymorphic relation exists - article (439ms)
        ✓ should create polymorphic item through relation scope (873ms)
        ✓ should create polymorphic through model - new article (218ms)
        ✓ should find polymorphic items - new article (647ms)
        ✓ should use author_pictures as modelThrough
        ✓ can be declared using custom foreignKey/discriminator (455ms)
      belongsTo
        ✓ can be declared in different ways
        ✓ should setup a custom method on accessor
        ✓ should have setup a custom method on accessor
        ✓ can be used to query data (1176ms)
        ✓ can be used to query data with get() with callback (644ms)
        ✓ can be used to query data with promises (689ms)
        ✓ could accept objects when creating on scope (444ms)
        ✓ should update related item on scope (689ms)
        ✓ should not update related item FK on scope (471ms)
        ✓ should get related item on scope (871ms)
        ✓ should destroy related item on scope (1044ms)
        ✓ should get related item on scope - verify (227ms)
        ✓ should not have deleted related item (225ms)
        ✓ should allow to create belongsTo model in beforeCreate hook (468ms)
        ✓ should allow to create belongsTo model in beforeCreate hook with promises (490ms)
      belongsTo with scope
        ✓ can be declared with scope and properties (373ms)
        ✓ should create record on scope (472ms)
        ✓ should find record on scope (451ms)
        ✓ should create record on scope with promises (781ms)
        ✓ should find record on scope with promises (503ms)
      belongsTo with embed
        - can be declared with embed and properties
        - should create record with embedded data
        - should find record with embedded data
        - should find record with embedded data with promises
      hasOne
        ✓ can be declared using hasOne method
        ✓ should setup a custom method on accessor
        ✓ should have setup a custom method on accessor
        ✓ can be used to query data (1104ms)
        ✓ can be used to query data with get() with callback (1250ms)
        ✓ can be used to query data with promises (1263ms)
        ✓ should set targetClass on scope property
        ✓ should update the related item on scope (657ms)
        ✓ should not update the related item FK on scope (445ms)
        ✓ should update the related item on scope with promises (670ms)
        ✓ should error trying to change the foreign key in the update (644ms)
        ✓ should update the related item on scope with same foreign key (878ms)
        ✓ should get the related item on scope (432ms)
        ✓ should get the related item on scope with promises (432ms)
        ✓ should destroy the related item on scope (655ms)
        ✓ should destroy the related item on scope with promises (866ms)
        ✓ should get the related item on scope - verify (3134ms)
        ✓ should get the related item on scope with promises - verify (438ms)
        ✓ should have deleted related item (216ms)
      hasOne with scope
        ✓ can be used to query data (1052ms)
        ✓ should include record that matches scope (447ms)
        ✓ should not find record that does not match scope (652ms)
        ✓ should not include record that does not match scope (674ms)
        ✓ can be used to query data with promises (1896ms)
        ✓ should find record that match scope with promises (992ms)
      hasOne with non standard id
        ✓ can be declared with non standard foreignKey
        ✓ can be used to query data (1237ms)
        ✓ should destroy the related item on scope (668ms)
        ✓ should get the related item on scope - verify (465ms)
        ✓ should have deleted related item (216ms)
      hasOne with primaryKey different from model PK
        ✓ relation can be declared with primaryKey
        ✓ can be used to query data (1069ms)
        ✓ should destroy the related item on scope (687ms)
        ✓ should get the related item on scope - verify (450ms)
      hasMany with primaryKey different from model PK
        ✓ relation can be declared with primaryKey
        ✓ can be used to query employees for boss (943ms)
        ✓ can be used to query employees for boss2 (1077ms)
      belongsTo with primaryKey different from model PK
        ✓ relation can be declared with primaryKey
        ✓ can be used to query data (1057ms)
      hasAndBelongsToMany
        ✓ can be declared (635ms)
        ✓ should allow to create instances on scope (1125ms)
        ✓ should allow to fetch scoped instances (653ms)
        ✓ should destroy all related instances (2358ms)
        ✓ should allow to add connection with instance (882ms)
        ✓ should allow to remove connection with instance (1330ms)
        ✓ should allow to create instances on scope with promises (1725ms)
        ✓ should allow to fetch scoped instances with promises (677ms)
        ✓ should allow to add connection with instance with promises (915ms)
        ✓ should allow to remove connection with instance with promises (875ms)
        ✓ should set targetClass on scope property
        ✓ should apply inclusion fields to the target model (1543ms)
        ✓ should apply inclusion where to the target model (2198ms)
      embedsOne
        ✓ can be declared using embedsOne method (327ms)
        ✓ should have setup a property and accessor
        ✓ respects property options on the embedded property
        ✓ should setup a custom method on accessor
        ✓ should have setup a custom method on accessor
        ✓ should behave properly without default or being set (226ms)
        ✓ should return an instance with default values
        ✓ should embed a model instance
        ✓ should not embed an invalid model type
        ✓ should create an embedded item on scope (443ms)
        ✓ should get an embedded item on scope (220ms)
        ✓ should validate an embedded item on scope - on creation
        ✓ should validate an embedded item on scope - on update (216ms)
        ✓ should update an embedded item on scope (546ms)
        ✓ should get an embedded item on scope - verify (217ms)
        ✓ should destroy an embedded item on scope (545ms)
        ✓ should get an embedded item on scope - verify (218ms)
        ✓ should save an unsaved model (237ms)
        ✓ should create an embedded item on scope with promises (473ms)
        ✓ should get an embedded item on scope with promises (214ms)
        ✓ should validate an embedded item on scope with promises - on creation
        ✓ should validate an embedded item on scope with promises - on update (215ms)
        ✓ should update an embedded item on scope with promises (547ms)
        ✓ should get an embedded item on scope with promises - verify (218ms)
        ✓ should destroy an embedded item on scope with promises (600ms)
        ✓ should get an embedded item on scope with promises - verify (228ms)
        ✓ should also save changes when directly saving the embedded model (871ms)
        ✓ should delete the embedded document and also update parent (777ms)
      embedsOne - persisted model
        ✓ can be declared using embedsOne method
        ✓ should create an item - to offset id
        ✓ should create an embedded item on scope
        ✓ should create an embedded item on scope with promises
      embedsOne - generated id
        ✓ can be declared using embedsOne method
        ✓ should create an embedded item on scope
      embedsMany
        ✓ can be declared
        ✓ should have setup embedded accessor/scope
        ✓ should create embedded items on scope
        ✓ respects property options on the embedded property
        ✓ should create embedded items on scope
        ✓ should return embedded items from scope
        ✓ should filter embedded items on scope
        ✓ should validate embedded items
        ✓ should find embedded items by id
        ✓ should check if item exists
        ✓ should update embedded items by id
        ✓ should validate the update of embedded items
        ✓ should find embedded items by id - verify
        ✓ should have accessors: at, get, set
        ✓ should remove embedded items by id
        ✓ should have removed embedded items - verify
        ✓ should pass options when removed by id
        ✓ should pass options when removed by where
        ✓ should create embedded items on scope
        ✓ should remove embedded items - filtered
        ✓ should remove all embedded items
        ✓ should have removed all embedded items - verify
        ✓ should save an unsaved model
      embedsMany - omit default value for embedded item
        ✓ can be declared
        ✓ should not set default value for embedded item
        ✓ should create embedded items on scope
        ✓ should build embedded items
        ✓ should not create embedded from attributes - relation name
      embedsMany - numeric ids + forceId
        ✓ can be declared
        ✓ should create embedded items on scope
      embedsMany - explicit ids
        ✓ can be declared
        ✓ should create embedded items on scope
        ✓ should find embedded items by id
        ✓ should check for duplicate ids
        ✓ should update embedded items by id
        ✓ should remove embedded items by id
        ✓ should have embedded items - verify
        ✓ should validate all embedded items
        ✓ should build embedded items
        ✓ should have embedded items - verify
        ✓ should have accessors: at, get, set
        ✓ should create embedded from attributes - property name
        ✓ should not create embedded from attributes - relation name
        ✓ should create embedded items with auto-generated id
      embedsMany - persisted model
        ✓ can be declared
        ✓ should create individual items (0)
        ✓ should create individual items (1)
        ✓ should create individual items (2)
        ✓ should create individual items (3)
        ✓ should add embedded items on scope
        ✓ should create embedded items on scope
        ✓ should have embedded items on scope
        ✓ should validate embedded items on scope - id
        ✓ should validate embedded items on scope - street
      embedsMany - relations, scope and properties
        ✓ can be declared
        ✓ should setup related items
        ✓ should associate items on scope
        ✓ should include related items on scope
        ✓ should remove embedded items by id
        ✓ should find items on scope
        ✓ should add related items to scope
        ✓ should find items on scope
        ✓ should remove embedded items by reference id
        ✓ should have removed embedded items by reference id
        ✓ should create items on scope
        ✓ should find items on scope
        ✓ should update items on scope - and save parent
        ✓ should find items on scope - verify update
        ✓ should remove items from scope - and save parent
        ✓ should find items on scope - verify destroy
      embedsMany - polymorphic relations
        ✓ can be declared
        ✓ should setup related items
        ✓ should create items on scope
        ✓ should include related items on scope
        - [UNSUPPORTED] - should include nested related items on scope
      referencesMany
        ✓ can be declared
        ✓ should setup test records
        ✓ should create record on scope
        ✓ should not allow duplicate record on scope
        ✓ should find items on scope
        ✓ should find items on scope - findById
        ✓ should check if a record exists on scope
        ✓ should update a record on scope
        ✓ should get a record by index - at
        ✓ should add a record to scope - object
        ✓ should add a record to scope - object
        ✓ should find items on scope - findById
        ✓ should find items on scope - filter
        ✓ should remove items from scope
        ✓ should find items on scope - verify
        ✓ should find items on scope and ordered them by name DESC
        ✓ should allow custom scope methods - reverse
        - [UNSUPPORTED] - should allow custom scope methods - reverse
        - [UNSUPPORTED] - should include related items from scope
        ✓ should destroy items from scope - destroyById
        ✓ should find items on scope - verify
        ✓ should setup test records with promises
        ✓ should create record on scope with promises
        ✓ should not allow duplicate record on scope with promises
        ✓ should find items on scope with promises
        - [UNSUPPORTED] - should find items on scope with promises
        ✓ should find items on scope with promises - findById
        ✓ should check if a record exists on scope with promises
        ✓ should update a record on scope with promises
        ✓ should get a record by index with promises - at
        ✓ should add a record to scope with promises - object
        ✓ should add a record to scope with promises - object
        ✓ should find items on scope with promises - findById
        ✓ should find items on scope with promises - filter
        ✓ should remove items from scope with promises
        ✓ should find items on scope with promises - verify
        ✓ should find items on scope and ordered them by name DESC
        ✓ should allow custom scope methods with promises - reverse
        - [UNSUPPORTED] - should include related items from scope with promises
        ✓ should destroy items from scope with promises - destroyById
        ✓ should find items on scope with promises - verify
      custom relation/scope methods
        ✓ can be declared
        ✓ should setup test records
        ✓ should allow custom scope methods - summarize
        ✓ should allow custom scope methods with promises - summarize
      relation names
        ✓ throws error when a relation name is `trigger`
    include
      ✓ should fetch belongsTo relation (451ms)
      ✓ does not return included item if FK is excluded (233ms)
      ✓ should fetch hasMany relation (444ms)
      ✓ should report errors if the PK is excluded (225ms)
      ✓ should not have changed the __strict flag of the model (433ms)
      ✓ should not save in db included models, in query returned models (769ms)
      ✓ should fetch Passport - Owner - Posts (673ms)
      ✓ should fetch Passport - Owner - empty Posts (688ms)
      ✓ should fetch Passport - Owner - Posts - alternate syntax (650ms)
      ✓ should fetch Passports - User - Posts - User (864ms)
      ✓ should fetch Passports with include scope on Posts (879ms)
      ✓ should support limit (976ms)
      ✓ should support limit - no sort (1010ms)
      ✓ should fetch Users with include scope on Posts - belongsTo (450ms)
      - [UNSUPPORTED] - should fetch Users with include scope on Posts - belongsTo - no sort
      ✓ should fetch Users with include scope on Posts - hasMany (448ms)
      ✓ should fetch User - Posts AND Passports (546ms)
      ✓ should fetch User - Posts AND Passports in relation syntax (573ms)
      ✓ should not fetch User - AccessTokens (217ms)
      ✓ should support hasAndBelongsToMany (2201ms)
      ✓ should fetch User - Profile (HasOne) (446ms)
      ✓ should not throw on fetch User if include is boolean equals true (226ms)
      ✓ should not throw on fetch User if include is number (224ms)
      ✓ should not throw on fetch User if include is symbol (215ms)
      ✓ should not throw on fetch User if include is function (214ms)
      ✓ should support include scope on hasAndBelongsToMany (656ms)
      ✓ should save related items separately (1197ms)
      ✓ should support disableInclude for hasAndBelongsToMany (1580ms)
      inq limit
        ✓ should support include by pagination (1076ms)
      findWithForeignKeysByPage
        filter
          ✓ works when using a `where` with a foreign key (441ms)
          ✓ works when using a `where` with `and` (452ms)
          ✓ works when using `where` with `limit` (505ms)
          ✓ works when using `where` with `skip` (432ms)
          ✓ works when using `where` with `offset` (425ms)
          ✓ works when using `where` without `limit`, `skip` or `offset` (445ms)
        pagination
          ✓ works with the default page size (0) and `inqlimit` is exceeded (971ms)
          ✓ works when page size is set to 0 (464ms)
        relations
          ✓ works when hasOne is called (442ms)
          ✓ does not return included item if hasOne is missing the id property (215ms)
          ✓ works when hasMany is called (430ms)
          ✓ works when hasManyThrough is called (3017ms)
          ✓ works when belongsTo is called (439ms)
      [UNSUPPORTED] - findWithForeignKeysByPage
        filter
          - works when using a `where` with a foreign key
          - works when using a `where` with `and`
          - works when using `where` with `limit`
          - works when using `where` with `skip`
          - works when using `where` with `offset`
          - works when using `where` without `limit`, `skip` or `offset`
        pagination
          - works with the default page size (0) and `inqlimit` is exceeded
          - works when page size is set to 0
        relations
          - works when hasOne is called
          - works when hasMany is called
          - works when hasManyThrough is called
          - works when belongsTo is called
      performance
        ✓ including belongsTo should make only 2 db calls (450ms)
        ✓ including hasManyThrough should make only 3 db calls (3126ms)
        ✓ including hasMany should make only 3 db calls (559ms)
        ✓ should not make n+1 db calls in relation syntax (551ms)
    Model instance with included relation .toJSON()
      ✓ should recursively serialize objects


Do I need to update the version of loopback-datasource-juggler or something?

@emonddr
Copy link
Contributor

emonddr commented Jul 12, 2019

I set CI=true and then re-ran (thanks for the tip @b-admike )

Only 2 errors now:


> [email protected] pretest /Users/dremond/Documents/PRs_LoopBack/connector-dashdb-failures/loopback-connector-dashdb
> node pretest.js

> Seeding the database ...
> Cleaning up existing schemas ...
> Created schema: db2inst10
> Done seeding the database.

> [email protected] test /Users/dremond/Documents/PRs_LoopBack/connector-dashdb-failures/loopback-connector-dashdb
> mocha --timeout 20000 --require test/init.js



  testConnection
    ✓ should pass with valid settings (787ms)
    ✓ should pass when valid DSN overrides empty settings (715ms)
    ✓ should pass when valid DSN overrides invalid settings (701ms)

  parameterized SQL
    ✓ does not return result with SQL injection (235ms)

  query test
    ✓ find all data (224ms)
    regexp operator
      using no flags
        ✓ as regex string (229ms)
        ✓ as regex literal (218ms)
        ✓ as regex object (218ms)
      using flags
        ✓ as regex string (226ms)
        ✓ as regex literal (223ms)
        ✓ as regex object (229ms)
    like operator
      ✓ find using like operator (221ms)
    nlike operator
      ✓ find using nlike operator (222ms)

  transactions
    commit and rollback
      commit
        ✓ should not see the uncommitted insert (729ms)
        ✓ should see the uncommitted insert from the same transaction (111ms)
        ✓ should commit a transaction (113ms)
        ✓ should see the committed insert (228ms)
      rollback
        ✓ should not see the uncommitted insert (218ms)
        ✓ should see the uncommitted insert from the same transaction (120ms)
        ✓ should rollback a transaction (110ms)
        ✓ should not see the rolledback insert (266ms)

  discoverModels
    Discover database schemas
      ✓ should return an array of db schemas (745ms)
    Discover models including views
      ✓ should return an array of tables and views (761ms)
    Discover current user's tables
      ✓ should return an array of tables for the current user (224ms)
    Discover models excluding views
      ✓ should return an array of only tables (1278ms)

  Discover models including other users
    ✓ should return an array of all tables and views (235ms)

  Discover model properties
    Discover a named model
      ✓ should return an array of columns for PRODUCT (241ms)

  Discover model primary keys
    ✓ should return an array of primary keys for PRODUCT (232ms)
    ✓ should return an array of primary keys for STRONGLOOP.PRODUCT (226ms)

  Discover model foreign keys
    ✓ should return an array of foreign keys for INVENTORY (217ms)
    ✓ should return an array of foreign keys for STRONGLOOP.INVENTORY (220ms)

  Discover LDL schema from a table
    ✓ should return an LDL schema for INVENTORY (330ms)

  Discover and build models
    1) should discover and build models

  dashdb imported features
    datatypes
      ✓ should resolve top-level "type" property correctly
      ✓ should resolve "type" sub-property correctly
      ✓ should resolve array prop with connector specific metadata
      ✓ should coerce array of dates from string (414ms)
      ✓ should coerce array of numbers from string (233ms)
      ✓ should return 400 when property of type array is set to string value
      ✓ should return 400 when property of type array is set to object value
      ✓ should keep types when get read data from db (701ms)
      ✓ should respect data types when updating attributes (1126ms)
      ✓ should not coerce nested objects into ModelConstructor types
      ✓ rejects array value converted to NaN for a required property
      ✓ handles null data (793ms)
      model option persistUndefinedAsNull
        ✓ should set missing optional properties to null (454ms)
        ✓ should convert property value undefined to null (447ms)
        ✓ should convert undefined to null in the setter
        ✓ should use null in unsetAttribute()
        ✓ should convert undefined to null on save (786ms)
        ✓ should convert undefined to null in toObject()
    basic-querying
      ping
        ✓ should be able to test connections (225ms)
      findById
        ✓ should query by id: not found (222ms)
        ✓ should query by id: found (450ms)
      findByIds
        ✓ should query by ids (237ms)
        ✓ should query by ids and condition (263ms)
        ✓ should query by ids to check null property (228ms)
      find
        ✓ should query collection (315ms)
        ✓ should query limited collection (325ms)
        ✓ should query collection with skip & limit (310ms)
        ✓ should query collection with offset & limit (248ms)
        ✓ should query filtered collection (293ms)
        ✓ should query collection sorted by numeric field (321ms)
        ✓ should query collection desc sorted by numeric field (436ms)
        ✓ should query collection sorted by string field (336ms)
        ✓ should query collection desc sorted by string field (340ms)
        ✓ should query sorted desc by order integer field even though there is an async model loaded hook (317ms)
        ✓ should support "and" operator that is satisfied (300ms)
        ✓ should support "and" operator that is not satisfied (222ms)
        ✓ should support "or" that is satisfied (265ms)
        ✓ should support "or" operator that is not satisfied (224ms)
        ✓ should support where date "neq" null (265ms)
        ✓ should support where date is null (292ms)
        ✓ should support date "gte" that is satisfied (231ms)
        ✓ should support date "gt" that is not satisfied (222ms)
        ✓ should support date "gt" that is satisfied (274ms)
        ✓ should support date "lt" that is satisfied (317ms)
        ✓ should support number "gte" that is satisfied (341ms)
        ✓ should support number "gt" that is not satisfied (219ms)
        ✓ should support number "gt" that is satisfied (263ms)
        ✓ should support number "lt" that is satisfied (290ms)
        ✓ should support number "gt" that is satisfied by null value (217ms)
        ✓ should support number "lt" that is not satisfied by null value (220ms)
        ✓ should support string "gte" that is satisfied by null value (234ms)
        ✓ should support string "gte" that is satisfied (278ms)
        ✓ should support string "gt" that is not satisfied (226ms)
        ✓ should support string "gt" that is satisfied (282ms)
        ✓ should support string "lt" that is satisfied (317ms)
        ✓ should support boolean "gte" that is satisfied (285ms)
        ✓ should support boolean "gt" that is not satisfied (225ms)
        ✓ should support boolean "gt" that is satisfied (315ms)
        ✓ should support boolean "lt" that is satisfied (292ms)
        - [UNSUPPORTED] - supports non-empty inq
        - [UNSUPPORTED] - supports empty inq
        ✓ should only include fields as specified (1651ms)
        ✓ should ignore non existing properties when excluding (319ms)
        ✓ applies default values by default (1992ms)
        ✓ preserves empty values from the database when "applyDefaultsOnReads" is false (1499ms)
        [UNSUPPORTED] - ilike
          - should support "like" that is satisfied
          - should support "like" that is not satisfied
          - should support "ilike" that is satisfied
          - should support "ilike" that is not satisfied
        [UNSUPPORTED] - nilike
          - should support "nlike" that is satisfied
          - should support "nilike" that is satisfied
        geo queries
          near filter
            ✓ supports a basic "near" query (331ms)
            ✓ supports "near" inside a coumpound query with "and" (314ms)
            ✓ supports "near" inside a complex coumpound query with multiple "and" (402ms)
            ✓ supports multiple "near" queries with "or" (285ms)
            ✓ supports multiple "near" queries with "or" inside a coumpound query with "and" (315ms)
        [UNSUPPORTED] - query with nested property
          - should support nested property in query
          - should support nested property with regex over arrays in query
          - should support nested property with gt in query
          - [UNSUPPORTED] - should support nested property for order in query
          - should support multi-level nested array property in query
          - should fail when querying with an invalid value for a type
      count
        ✓ should query total count (222ms)
        ✓ should query filtered count (230ms)
      findOne
        ✓ should find first record (default sort by id) (450ms)
        - [UNSUPPORTED] - should find first record
        - [UNSUPPORTED] - should find last record
        - [UNSUPPORTED] - should find last record in filtered set
        ✓ should work even when find by id (471ms)
      exists
        ✓ should check whether record exist (462ms)
        ✓ should check whether record not exist (438ms)
      updateAll
        ✓ coerces primitive datatypes on update (703ms)
        ✓ coerces primitive array datatypes on update (691ms)
    regexp operator
      ✓ should return an error for invalid data types
    queries
      that do not require an id
        - should work for create
        - should work for updateOrCreate/upsert
        - should work for findOrCreate
        - should work for exists
        - should work for find
        - should work for findOne
        - should work for deleteAll/destroyAll/remove
        - should work for update/updateAll
        - should work for count
      that require an id
        - should return an error for findById
        - should return an error for findByIds
        - should return an error for deleteById/destroyById/removeById
        - should return an error for instance.save
        - should return an error for instance.delete
        - should return an error for instance.updateAttribute
        - should return an error for instance.updateAttributes
    manipulation
      create
        ✓ should create instance (467ms)
        ✓ should create instance (promise variant) (452ms)
        ✓ should instantiate an object (226ms)
        ✓ should instantiate an object (promise variant) (224ms)
        ✓ should not return instance of object (231ms)
        ✓ should not allow user-defined value for the id of object - create
        ✓ should not allow user-defined value for the id of object - create (promise variant)
        ✓ should not allow user-defined value for the id of object - save
        ✓ should not allow user-defined value for the id of object - save (promise variant)
        ✓ should work when called without callback (252ms)
        ✓ should create instance with blank data (455ms)
        ✓ should create instance with blank data (promise variant) (446ms)
        ✓ should work when called with no data and callback (253ms)
        ✓ should create batch of objects (1218ms)
        ✓ should create batch of objects (promise variant) (805ms)
        ✓ should create batch of objects with beforeCreate (376ms)
        ✓ should preserve properties with "undefined" value (457ms)
        2) should refuse to create object with duplicate id
        forceId
          ✓ it defaults to forceId:true for generated id property
      save
        ✓ should save new object (227ms)
        ✓ should save new object (promise variant) (220ms)
        ✓ should save existing object (819ms)
        ✓ should save existing object (promise variant) (800ms)
        ✓ should save invalid object (skipping validation) (556ms)
        ✓ should save invalid object (skipping validation - promise variant) (569ms)
        ✓ should save throw error on validation (224ms)
        ✓ should preserve properties with dynamic setters (788ms)
      updateAttributes
        ✓ should have updated password hashed with updateAttribute (700ms)
        ✓ should reject created StubUser with empty password
        ✓ should reject updated empty password with updateAttribute (227ms)
        ✓ should update one attribute (496ms)
        ✓ should update one attribute (promise variant) (464ms)
        ✓ should ignore undefined values on updateAttributes (545ms)
        ✓ should discard undefined values before strict validation (797ms)
        ✓ should allow unknown attributes when strict: false (482ms)
        ✓ should remove unknown attributes when strict: filter (463ms)
        ✓ should return error on unknown attributes when strict: true (503ms)
        ✓ should fallback to strict:true when using strict: throw (441ms)
        ✓ should fallback to strict:true when using strict:validate (447ms)
        ✓ should allow same id value on updateAttributes (461ms)
        ✓ should allow same stringified id value on updateAttributes (477ms)
        ✓ should fail if an id value is to be changed on updateAttributes
        ✓ has an alias "patchAttributes"
        ✓ should allow model instance on updateAttributes (485ms)
        ✓ should allow model instance on updateAttributes (promise variant) (451ms)
        ✓ should raises on connector error
      updateOrCreate
        ✓ has an alias "patchOrCreate"
        ✓ creates a model when one does not exist (458ms)
        ✓ updates a model if it exists (686ms)
        ✓ should reject updated empty password with updateOrCreate (444ms)
        ✓ throws error for queries with array input
        ✓ should preserve properties with dynamic setters on create (448ms)
        ✓ should preserve properties with dynamic setters on update (904ms)
        ✓ should preserve properties with "undefined" value (586ms)
        ✓ updates specific instances when PK is not an auto-generated id (956ms)
        ✓ should allow save() of the created instance (727ms)
      updateOrCreate when forceId is true
        ✓ fails when id does not exist in db & validate is true (241ms)
        ✓ fails when id does not exist in db & validate is false (259ms)
        ✓ fails when id does not exist in db & validate is false when using updateAttributes (248ms)
        ✓ works on create if the request does not include an id (274ms)
        ✓ works on update if the request includes an existing id in db (702ms)
      replaceOrCreate
        ✓ works without options on create (promise variant) (593ms)
        ✓ works with options on create (promise variant) (683ms)
        ✓ works without options on update (promise variant) (919ms)
        ✓ works with options on update (promise variant) (875ms)
        ✓ works without options on update (callback variant) (900ms)
        ✓ works with options on update (callback variant) (899ms)
        ✓ works without options on create (callback variant) (740ms)
        ✓ works with options on create (callback variant) (653ms)
      replaceOrCreate when forceId is true
        ✓ fails when id does not exist in db (228ms)
        ✓ works on create if the request does not include an id (225ms)
        ✓ works on update if the request includes an existing id in db (678ms)
      replaceAttributes
        ✓ should have updated password hashed with replaceAttributes (886ms)
        ✓ should reject updated empty password with replaceAttributes (268ms)
        ✓ should ignore PK if it is set for `instance`in `before save` operation hook (915ms)
        ✓ should set cannotOverwritePKInBeforeSaveHook flag, if `instance` in`before save` operation hook is set, so we report a warning just once (787ms)
        ✓ should ignore PK if it is set for `data`in `loaded` operation hook (905ms)
        ✓ should set cannotOverwritePKInLoadedHook flag, if `instance` in`before save` operation hook is set, so we report a warning just once (655ms)
        ✓ works without options(promise variant) (886ms)
        ✓ works with options(promise variant) (921ms)
        ✓ should fail when changing id (221ms)
        ✓ works without options(callback variant) (672ms)
        ✓ works with options(callback variant) (665ms)
      replaceById
        ✓ fails when id does not exist in db using replaceById (225ms)
      findOrCreate
        ✓ should create a record with if new (449ms)
        ✓ should find a record if exists (227ms)
        ✓ should create a record with if new (promise variant) (459ms)
        ✓ should find a record if exists (promise variant) (223ms)
        ✓ applies default values on returned data (1612ms)
        ✓ preserves empty values from the database when "applyDefaultsOnReads" is false (1490ms)
      destroy
        ✓ should destroy record (672ms)
        ✓ should destroy record (promise variant) (660ms)
        ✓ should destroy all records (669ms)
        ✓ should destroy all records (promise variant) (893ms)
        - should destroy filtered set of records
      deleteAll/destroyAll
        ✓ should be defined as function
        ✓ should only delete instances that satisfy the where condition (685ms)
        ✓ should report zero deleted instances when no matches are found (451ms)
        ✓ should delete all instances when the where condition is not provided (450ms)
      [UNSUPPORTED] - deleteAll/destroyAll case 2
        - should be defined as function
        - should only delete instances that satisfy the where condition
        - should report zero deleted instances when no matches are found
        - should delete all instances when the where condition is not provided
      deleteById
        ✓ should allow deleteById(id) - success (457ms)
        ✓ should allow deleteById(id) - fail (218ms)
        ✓ should allow deleteById(id) - fail with error (218ms)
      prototype.delete
        ✓ should allow delete(id) - success (489ms)
        ✓ should allow delete(id) - fail (707ms)
        ✓ should allow delete(id) - fail with error (656ms)
      initialize
        ✓ should initialize object properly
        Date $now function (type: Date)
          ✓ should report current date as default value for date property
        Date $now function (type: String)
          ✓ should report '$now' as default value for string property
        now defaultFn
          ✓ should generate current time when "defaultFn" is "now" (242ms)
        guid defaultFn
          ✓ should generate a new id when "defaultFn" is "guid" (249ms)
        uuid defaultFn
          ✓ should generate a new id when "defaultfn" is "uuid" (281ms)
        uuidv4 defaultFn
          ✓ should generate a new id when "defaultfn" is "uuidv4" (242ms)
        shortid defaultFn
          ✓ should generate a new id when "defaultFn" is "shortid" (236ms)
      property value coercion
        ✓ should coerce boolean types properly
        ✓ should coerce date types properly
      update/updateAll
        ✓ should be defined as a function
        ✓ should not update instances that do not satisfy the where condition (441ms)
        ✓ should only update instances that satisfy the where condition (453ms)
        ✓ should reject updated empty password with updateAll (330ms)
        ✓ should update all instances when the where condition is not provided (663ms)
        ✓ should ignore where conditions with undefined values (451ms)
        ✓ should not coerce invalid values provided in where conditions
      upsertWithWhere
        ✓ has an alias "patchOrCreateWithWhere"
        ✓ should preserve properties with dynamic setters on create (673ms)
        ✓ should preserve properties with dynamic setters on update (939ms)
        ✓ should preserve properties with "undefined" value (714ms)
        ✓ should allow save() of the created instance (778ms)
        ✓ works without options on create (promise variant) (666ms)
        ✓ works with options on create (promise variant) (694ms)
        ✓ works without options on update (promise variant) (929ms)
        ✓ works with options on update (promise variant) (911ms)
        ✓ fails the upsertWithWhere operation when data object is empty
        ✓ creates a new record when no matching instance is found (676ms)
        ✓ fails the upsertWithWhere operation when multiple instances are retrieved based on the filter criteria (944ms)
        ✓ updates the record when one matching instance is found based on the filter criteria (989ms)
    hooks
      initialize
        ✓ should be triggered on new
        ✓ should be triggered on create (231ms)
      create
        ✓ should be triggered on create (227ms)
        ✓ should not be triggered on new
        ✓ should be triggered on new+save (219ms)
        ✓ afterCreate should not be triggered on failed create
        ✓ afterCreate should not be triggered on failed beforeCreate
      save
        ✓ should be triggered on create (220ms)
        ✓ should be triggered on new+save (238ms)
        ✓ should be triggered on updateAttributes (459ms)
        ✓ should be triggered on save (562ms)
        ✓ should save full object (220ms)
        ✓ should save actual modifications to database (680ms)
        ✓ should save actual modifications on updateAttributes (932ms)
        ✓ beforeSave should be able to skip next (233ms)
      update
        ✓ should not be triggered on create
        ✓ should not be triggered on new+save
        ✓ should be triggered on updateAttributes (1234ms)
        ✓ should be triggered on save (553ms)
        ✓ should update limited set of fields (220ms)
        ✓ should not trigger after-hook on failed save (218ms)
      destroy
        ✓ should be triggered on destroy (470ms)
        ✓ should not trigger after-hook on failed destroy (226ms)
      lifecycle
        ✓ should describe create sequence (224ms)
        ✓ should describe new+save sequence (226ms)
        ✓ should describe updateAttributes sequence (226ms)
        ✓ should describe isValid sequence
        ✓ should describe destroy sequence (234ms)
    relations
      hasMany
        ✓ can be declared in different ways (464ms)
        ✓ can be declared in short form (838ms)
        with scope
          ✓ should build record on scope (455ms)
          ✓ should create record on scope (439ms)
          ✓ should not update FK (792ms)
          ✓ should create record on scope with promises (444ms)
          ✓ should create a batch of records on scope (656ms)
          ✓ should create a batch of records on scope with promises (654ms)
          ✓ should fetch all scoped instances (918ms)
          ✓ should fetch all scoped instances with promises (899ms)
          ✓ should fetch all scoped instances with find() with callback and condition (1130ms)
          ✓ should fetch all scoped instances with find() with callback and no condition (1119ms)
          ✓ should find scoped record (1122ms)
          ✓ should find scoped record with promises (1207ms)
          ✓ should count scoped records - all and filtered (1322ms)
          ✓ should count scoped records - all and filtered with promises (1310ms)
          ✓ should set targetClass on scope property
          ✓ should update scoped record (1097ms)
          ✓ should update scoped record with promises (1095ms)
          ✓ should destroy scoped record (1133ms)
          ✓ should destroy scoped record with promises (1113ms)
          ✓ should check existence of a scoped record (1180ms)
          ✓ should check existence of a scoped record with promises (1112ms)
          ✓ should check ignore related data on creation - array (225ms)
          ✓ should check ignore related data on creation with promises - array (223ms)
          ✓ should check ignore related data on creation - object (221ms)
          ✓ should check ignore related data on creation with promises - object (225ms)
      hasMany through
        ✓ should build record on scope (448ms)
        ✓ should create record on scope (1132ms)
        ✓ should create record on scope with promises (1100ms)
        ✓ should create multiple records on scope (1464ms)
        ✓ should create multiple records on scope with promises (1437ms)
        ✓ should fetch all scoped instances (2216ms)
        ✓ should fetch all scoped instances with promises (2255ms)
        ✓ should find scoped record (2670ms)
        ✓ should find scoped record with promises (2663ms)
        ✓ should allow to use include syntax on related data (2476ms)
        ✓ should allow to use include syntax on related data with promises (2229ms)
        ✓ should set targetClass on scope property
        ✓ should update scoped record (2048ms)
        ✓ should update scoped record with promises (2079ms)
        ✓ should destroy scoped record (1811ms)
        ✓ should destroy scoped record with promises (1806ms)
        ✓ should check existence of a scoped record (2522ms)
        ✓ should check existence of a scoped record with promises (2462ms)
        ✓ should allow to add connection with instance (887ms)
        ✓ should allow to add connection with instance with promises (889ms)
        ✓ should allow to add connection with through data (899ms)
        ✓ should allow to add connection with through data with promises (921ms)
        ✓ should allow to remove connection with instance (1346ms)
        ✓ should allow to remove connection with instance with promises (1331ms)
        fetch scoped instances with paging filters
          with filter skip
            ✓ skips the first patient (665ms)
          with filter order
            ✓ orders the result by patient name (700ms)
          with filter limit
            ✓ limits to 1 result (684ms)
          with filter fields
            ✓ includes field 'name' but not 'age' (658ms)
          with filter include
            ✓ returns physicians included in patient (1150ms)
          with filter where
            ✓ returns patient where id equal to samplePatientId (667ms)
            ✓ returns patient where name equal to samplePatient name (667ms)
            ✓ returns patients where id in an array (1335ms)
            ✓ returns empty result when patientId does not belongs to physician (672ms)
          findById with filter include
            ✓ returns patient where id equal to 'samplePatientId'with included physicians (885ms)
          findById with filter fields
            ✓ returns patient where id equal to 'samplePatientId'with field 'name' but not 'age' (456ms)
          findById with include filter that contains string fields
            ✓ should accept string and convert it to array (673ms)
        find over related model with options
          ✓ should find be filtered from option (3014ms)
      hasMany through - collect
        with default options
          ✓ can determine the collect by modelTo's name as default
        when custom reverse belongsTo names for both sides
          ✓ can determine the collect via keyThrough
          ✓ can determine the collect via modelTo name
          ✓ can determine the collect via modelTo name (with jams)
        when custom reverse belongsTo name for one side only
          ✓ can determine the collect via model name
          ✓ can determine the collect via keyThrough
      hasMany through - customized relation name and foreign key
        ✓ should use real target class
      hasMany through bi-directional relations on the same model
        ✓ should set foreignKeys of through model correctly in first relation (452ms)
        ✓ should set foreignKeys of through model correctly in second relation (225ms)
      hasMany through - between same models
        ✓ should set the keyThrough and the foreignKey (464ms)
        ✓ can determine the collect via keyThrough for each side
      hasMany with properties
        ✓ should create record on scope (465ms)
        ✓ should create record on scope with promises (471ms)
      hasMany with scope and properties
        ✓ can be declared with properties (336ms)
        ✓ should create record on scope (687ms)
        ✓ should create record on scope with promises (673ms)
        ✓ should find records on scope (442ms)
        ✓ should find records on scope with promises (437ms)
        ✓ should find record on scope - filtered (445ms)
        ✓ should find record on scope with promises - filtered (471ms)
        ✓ should create record on scope - properties (441ms)
        ✓ should find records on scope (436ms)
        ✓ should find record on scope - scoped (439ms)
        ✓ should find record on scope - scoped (455ms)
        ✓ should find count of records on scope - scoped (439ms)
        ✓ should delete records on scope - scoped (470ms)
        ✓ should find record on scope - verify (444ms)
      relations validation
        ✓ rejects belongsTo relation if `model` is not provided
        ✓ rejects polymorphic belongsTo relation if `model` is provided
        ✓ rejects polymorphic non belongsTo relation if `model` is not provided
        ✓ rejects polymorphic relation if `foreignKey` is provided but discriminator is missing
        ✓ rejects polymorphic relation if `discriminator` is provided but foreignKey is missing
        ✓ rejects polymorphic relation if `polymorphic.as` is provided along with custom foreignKey/discriminator
        ✓ rejects polymorphic relation if `polymorphic.selector` is provided along with custom foreignKey/discriminator
        ✓ warns on use of deprecated `polymorphic.as` keyword in polymorphic relation
      polymorphic hasOne
        ✓ can be declared using default polymorphic selector (413ms)
        ✓ should create polymorphic relation - Article (684ms)
        ✓ should create polymorphic relation with promises - article (654ms)
        ✓ should create polymorphic relation - reader (669ms)
        ✓ should find polymorphic relation - article (439ms)
        ✓ should find polymorphic relation - employee (471ms)
        ✓ should include polymorphic relation - article (447ms)
        ✓ should find polymorphic relation with promises - employee (436ms)
        ✓ should find inverse polymorphic relation - article (442ms)
        ✓ should include inverse polymorphic relation - article (438ms)
        ✓ should find inverse polymorphic relation - employee (441ms)
      polymorphic hasOne with non standard ids
        ✓ can be declared using custom foreignKey/discriminator (618ms)
        ✓ should create polymorphic relation - article (1012ms)
        ✓ should create polymorphic relation with promises - article (675ms)
        ✓ should create polymorphic relation - employee (664ms)
        ✓ should find polymorphic relation - article (449ms)
        ✓ should find polymorphic relation - employee (444ms)
        ✓ should find inverse polymorphic relation - article (448ms)
        ✓ should find inverse polymorphic relation - employee (457ms)
        ✓ should include polymorphic relation - employee (449ms)
        ✓ should include inverse polymorphic relation - employee (455ms)
      polymorphic hasMany
        ✓ can be declared with model JSON definition when related model is already attached
        ✓ can be declared with model JSON definition when related model is not yet attached
        ✓ can be declared using default polymorphic selector (424ms)
        ✓ should create polymorphic relation - article (451ms)
        ✓ should create polymorphic relation - employee (455ms)
        ✓ should find polymorphic items - article (445ms)
        ✓ should find polymorphic items - employee (444ms)
        ✓ should find the inverse of polymorphic relation - article (443ms)
        ✓ should find the inverse of polymorphic relation - employee (440ms)
        ✓ should include the inverse of polymorphic relation (560ms)
        - [UNSUPPORTED] - should include the inverse of polymorphic relation w/o adhocSort
        ✓ should assign a polymorphic relation (441ms)
        ✓ should find polymorphic items - article (463ms)
        ✓ should find the inverse of polymorphic relation - article (436ms)
        ✓ should include the inverse of polymorphic relation - article (437ms)
        ✓ can be declared using custom foreignKey/discriminator (463ms)
      polymorphic hasAndBelongsToMany through
        ✓ can be declared using default polymorphic selector (455ms)
        ✓ can determine the collect via modelTo name
        ✓ should create polymorphic relation - article (1571ms)
        ✓ should create polymorphic relation - employee (907ms)
        ✓ should create polymorphic through model (443ms)
        ✓ should get polymorphic relation through model - article (681ms)
        ✓ should get polymorphic relation through model - employee (683ms)
        ✓ should include polymorphic items (657ms)
        ✓ should add to a polymorphic relation - article (909ms)
        ✓ should create polymorphic through model (230ms)
        ✓ should add to a polymorphic relation - article (668ms)
        ✓ should add to a polymorphic relation - article (658ms)
        ✓ should get the inverse polymorphic relation - article (669ms)
        ✓ should get the inverse polymorphic relation - reader (673ms)
        ✓ should find polymorphic items - article (673ms)
        ✓ should check if polymorphic relation exists - article (455ms)
        ✓ should remove from a polymorphic relation - article (442ms)
        ✓ should find polymorphic items - article (667ms)
        ✓ should check if polymorphic relation exists - article (436ms)
        ✓ should create polymorphic item through relation scope (903ms)
        ✓ should create polymorphic through model - new article (217ms)
        ✓ should find polymorphic items - new article (650ms)
        ✓ should use author_pictures as modelThrough
        ✓ can be declared using custom foreignKey/discriminator (471ms)
      belongsTo
        ✓ can be declared in different ways
        ✓ should setup a custom method on accessor
        ✓ should have setup a custom method on accessor
        ✓ can be used to query data (1101ms)
        ✓ can be used to query data with get() with callback (654ms)
        ✓ can be used to query data with promises (685ms)
        ✓ could accept objects when creating on scope (461ms)
        ✓ should update related item on scope (662ms)
        ✓ should not update related item FK on scope (439ms)
        ✓ should get related item on scope (439ms)
        ✓ should destroy related item on scope (799ms)
        ✓ should get related item on scope - verify (218ms)
        ✓ should not have deleted related item (216ms)
        ✓ should allow to create belongsTo model in beforeCreate hook (451ms)
        ✓ should allow to create belongsTo model in beforeCreate hook with promises (440ms)
      belongsTo with scope
        ✓ can be declared with scope and properties (338ms)
        ✓ should create record on scope (467ms)
        ✓ should find record on scope (447ms)
        ✓ should create record on scope with promises (459ms)
        ✓ should find record on scope with promises (459ms)
      belongsTo with embed
        - can be declared with embed and properties
        - should create record with embedded data
        - should find record with embedded data
        - should find record with embedded data with promises
      hasOne
        ✓ can be declared using hasOne method
        ✓ should setup a custom method on accessor
        ✓ should have setup a custom method on accessor
        ✓ can be used to query data (1279ms)
        ✓ can be used to query data with get() with callback (1383ms)
        ✓ can be used to query data with promises (1413ms)
        ✓ should set targetClass on scope property
        ✓ should update the related item on scope (857ms)
        ✓ should not update the related item FK on scope (538ms)
        ✓ should update the related item on scope with promises (656ms)
        ✓ should error trying to change the foreign key in the update (681ms)
        ✓ should update the related item on scope with same foreign key (876ms)
        ✓ should get the related item on scope (460ms)
        ✓ should get the related item on scope with promises (439ms)
        ✓ should destroy the related item on scope (716ms)
        ✓ should destroy the related item on scope with promises (899ms)
        ✓ should get the related item on scope - verify (454ms)
        ✓ should get the related item on scope with promises - verify (444ms)
        ✓ should have deleted related item (216ms)
      hasOne with scope
        ✓ can be used to query data (1350ms)
        ✓ should include record that matches scope (463ms)
        ✓ should not find record that does not match scope (733ms)
        ✓ should not include record that does not match scope (699ms)
        ✓ can be used to query data with promises (1354ms)
        ✓ should find record that match scope with promises (685ms)
      hasOne with non standard id
        ✓ can be declared with non standard foreignKey
        ✓ can be used to query data (1312ms)
        ✓ should destroy the related item on scope (675ms)
        ✓ should get the related item on scope - verify (483ms)
        ✓ should have deleted related item (227ms)
      hasOne with primaryKey different from model PK
        ✓ relation can be declared with primaryKey
        ✓ can be used to query data (998ms)
        ✓ should destroy the related item on scope (662ms)
        ✓ should get the related item on scope - verify (3380ms)
      hasMany with primaryKey different from model PK
        ✓ relation can be declared with primaryKey
        ✓ can be used to query employees for boss (1192ms)
        ✓ can be used to query employees for boss2 (1225ms)
      belongsTo with primaryKey different from model PK
        ✓ relation can be declared with primaryKey
        ✓ can be used to query data (1532ms)
      hasAndBelongsToMany
        ✓ can be declared (381ms)
        ✓ should allow to create instances on scope (1624ms)
        ✓ should allow to fetch scoped instances (783ms)
        ✓ should destroy all related instances (1363ms)
        ✓ should allow to add connection with instance (929ms)
        ✓ should allow to remove connection with instance (1349ms)
        ✓ should allow to create instances on scope with promises (1741ms)
        ✓ should allow to fetch scoped instances with promises (704ms)
        ✓ should allow to add connection with instance with promises (987ms)
        ✓ should allow to remove connection with instance with promises (907ms)
        ✓ should set targetClass on scope property
        ✓ should apply inclusion fields to the target model (1599ms)
        ✓ should apply inclusion where to the target model (2228ms)
      embedsOne
        ✓ can be declared using embedsOne method (329ms)
        ✓ should have setup a property and accessor
        ✓ respects property options on the embedded property
        ✓ should setup a custom method on accessor
        ✓ should have setup a custom method on accessor
        ✓ should behave properly without default or being set (230ms)
        ✓ should return an instance with default values
        ✓ should embed a model instance
        ✓ should not embed an invalid model type
        ✓ should create an embedded item on scope (457ms)
        ✓ should get an embedded item on scope (222ms)
        ✓ should validate an embedded item on scope - on creation
        ✓ should validate an embedded item on scope - on update (217ms)
        ✓ should update an embedded item on scope (566ms)
        ✓ should get an embedded item on scope - verify (300ms)
        ✓ should destroy an embedded item on scope (561ms)
        ✓ should get an embedded item on scope - verify (220ms)
        ✓ should save an unsaved model (232ms)
        ✓ should create an embedded item on scope with promises (458ms)
        ✓ should get an embedded item on scope with promises (219ms)
        ✓ should validate an embedded item on scope with promises - on creation
        ✓ should validate an embedded item on scope with promises - on update (541ms)
        ✓ should update an embedded item on scope with promises (553ms)
        ✓ should get an embedded item on scope with promises - verify (226ms)
        ✓ should destroy an embedded item on scope with promises (584ms)
        ✓ should get an embedded item on scope with promises - verify (224ms)
        ✓ should also save changes when directly saving the embedded model (909ms)
        ✓ should delete the embedded document and also update parent (788ms)
      embedsOne - persisted model
        ✓ can be declared using embedsOne method
        ✓ should create an item - to offset id
        ✓ should create an embedded item on scope
        ✓ should create an embedded item on scope with promises
      embedsOne - generated id
        ✓ can be declared using embedsOne method
        ✓ should create an embedded item on scope
      embedsMany
        ✓ can be declared
        ✓ should have setup embedded accessor/scope
        ✓ should create embedded items on scope
        ✓ respects property options on the embedded property
        ✓ should create embedded items on scope
        ✓ should return embedded items from scope
        ✓ should filter embedded items on scope
        ✓ should validate embedded items
        ✓ should find embedded items by id
        ✓ should check if item exists
        ✓ should update embedded items by id
        ✓ should validate the update of embedded items
        ✓ should find embedded items by id - verify
        ✓ should have accessors: at, get, set
        ✓ should remove embedded items by id
        ✓ should have removed embedded items - verify
        ✓ should pass options when removed by id
        ✓ should pass options when removed by where
        ✓ should create embedded items on scope
        ✓ should remove embedded items - filtered
        ✓ should remove all embedded items
        ✓ should have removed all embedded items - verify
        ✓ should save an unsaved model
      embedsMany - omit default value for embedded item
        ✓ can be declared
        ✓ should not set default value for embedded item
        ✓ should create embedded items on scope
        ✓ should build embedded items
        ✓ should not create embedded from attributes - relation name
      embedsMany - numeric ids + forceId
        ✓ can be declared
        ✓ should create embedded items on scope
      embedsMany - explicit ids
        ✓ can be declared
        ✓ should create embedded items on scope
        ✓ should find embedded items by id
        ✓ should check for duplicate ids
        ✓ should update embedded items by id
        ✓ should remove embedded items by id
        ✓ should have embedded items - verify
        ✓ should validate all embedded items
        ✓ should build embedded items
        ✓ should have embedded items - verify
        ✓ should have accessors: at, get, set
        ✓ should create embedded from attributes - property name
        ✓ should not create embedded from attributes - relation name
        ✓ should create embedded items with auto-generated id
      embedsMany - persisted model
        ✓ can be declared
        ✓ should create individual items (0)
        ✓ should create individual items (1)
        ✓ should create individual items (2)
        ✓ should create individual items (3)
        ✓ should add embedded items on scope
        ✓ should create embedded items on scope
        ✓ should have embedded items on scope
        ✓ should validate embedded items on scope - id
        ✓ should validate embedded items on scope - street
      embedsMany - relations, scope and properties
        ✓ can be declared
        ✓ should setup related items
        ✓ should associate items on scope
        ✓ should include related items on scope
        ✓ should remove embedded items by id
        ✓ should find items on scope
        ✓ should add related items to scope
        ✓ should find items on scope
        ✓ should remove embedded items by reference id
        ✓ should have removed embedded items by reference id
        ✓ should create items on scope
        ✓ should find items on scope
        ✓ should update items on scope - and save parent
        ✓ should find items on scope - verify update
        ✓ should remove items from scope - and save parent
        ✓ should find items on scope - verify destroy
      embedsMany - polymorphic relations
        ✓ can be declared
        ✓ should setup related items
        ✓ should create items on scope
        ✓ should include related items on scope
        - [UNSUPPORTED] - should include nested related items on scope
      referencesMany
        ✓ can be declared
        ✓ should setup test records
        ✓ should create record on scope
        ✓ should not allow duplicate record on scope
        ✓ should find items on scope
        ✓ should find items on scope - findById
        ✓ should check if a record exists on scope
        ✓ should update a record on scope
        ✓ should get a record by index - at
        ✓ should add a record to scope - object
        ✓ should add a record to scope - object
        ✓ should find items on scope - findById
        ✓ should find items on scope - filter
        ✓ should remove items from scope
        ✓ should find items on scope - verify
        ✓ should find items on scope and ordered them by name DESC
        ✓ should allow custom scope methods - reverse
        - [UNSUPPORTED] - should allow custom scope methods - reverse
        - [UNSUPPORTED] - should include related items from scope
        ✓ should destroy items from scope - destroyById
        ✓ should find items on scope - verify
        ✓ should setup test records with promises
        ✓ should create record on scope with promises
        ✓ should not allow duplicate record on scope with promises
        ✓ should find items on scope with promises
        - [UNSUPPORTED] - should find items on scope with promises
        ✓ should find items on scope with promises - findById
        ✓ should check if a record exists on scope with promises
        ✓ should update a record on scope with promises
        ✓ should get a record by index with promises - at
        ✓ should add a record to scope with promises - object
        ✓ should add a record to scope with promises - object
        ✓ should find items on scope with promises - findById
        ✓ should find items on scope with promises - filter
        ✓ should remove items from scope with promises
        ✓ should find items on scope with promises - verify
        ✓ should find items on scope and ordered them by name DESC
        ✓ should allow custom scope methods with promises - reverse
        - [UNSUPPORTED] - should include related items from scope with promises
        ✓ should destroy items from scope with promises - destroyById
        ✓ should find items on scope with promises - verify
      custom relation/scope methods
        ✓ can be declared
        ✓ should setup test records
        ✓ should allow custom scope methods - summarize
        ✓ should allow custom scope methods with promises - summarize
      relation names
        ✓ throws error when a relation name is `trigger`
    include
      ✓ should fetch belongsTo relation (442ms)
      ✓ does not return included item if FK is excluded (238ms)
      ✓ should fetch hasMany relation (444ms)
      ✓ should report errors if the PK is excluded (223ms)
      ✓ should not have changed the __strict flag of the model (438ms)
      ✓ should not save in db included models, in query returned models (784ms)
      ✓ should fetch Passport - Owner - Posts (664ms)
      ✓ should fetch Passport - Owner - empty Posts (671ms)
      ✓ should fetch Passport - Owner - Posts - alternate syntax (662ms)
      ✓ should fetch Passports - User - Posts - User (878ms)
      ✓ should fetch Passports with include scope on Posts (923ms)
      ✓ should support limit (999ms)
      ✓ should support limit - no sort (1001ms)
      ✓ should fetch Users with include scope on Posts - belongsTo (503ms)
      - [UNSUPPORTED] - should fetch Users with include scope on Posts - belongsTo - no sort
      ✓ should fetch Users with include scope on Posts - hasMany (449ms)
      ✓ should fetch User - Posts AND Passports (542ms)
      ✓ should fetch User - Posts AND Passports in relation syntax (557ms)
      ✓ should not fetch User - AccessTokens (226ms)
      ✓ should support hasAndBelongsToMany (2232ms)
      ✓ should fetch User - Profile (HasOne) (478ms)
      ✓ should not throw on fetch User if include is boolean equals true (220ms)
      ✓ should not throw on fetch User if include is number (221ms)
      ✓ should not throw on fetch User if include is symbol (224ms)
      ✓ should not throw on fetch User if include is function (221ms)
      ✓ should support include scope on hasAndBelongsToMany (652ms)
      ✓ should save related items separately (1222ms)
      ✓ should support disableInclude for hasAndBelongsToMany (1696ms)
      inq limit
        ✓ should support include by pagination (1165ms)
      findWithForeignKeysByPage
        filter
          ✓ works when using a `where` with a foreign key (441ms)
          ✓ works when using a `where` with `and` (447ms)
          ✓ works when using `where` with `limit` (446ms)
          ✓ works when using `where` with `skip` (442ms)
          ✓ works when using `where` with `offset` (434ms)
          ✓ works when using `where` without `limit`, `skip` or `offset` (433ms)
        pagination
          ✓ works with the default page size (0) and `inqlimit` is exceeded (651ms)
          ✓ works when page size is set to 0 (446ms)
        relations
          ✓ works when hasOne is called (435ms)
          ✓ does not return included item if hasOne is missing the id property (236ms)
          ✓ works when hasMany is called (435ms)
          ✓ works when hasManyThrough is called (3412ms)
          ✓ works when belongsTo is called (745ms)
      [UNSUPPORTED] - findWithForeignKeysByPage
        filter
          - works when using a `where` with a foreign key
          - works when using a `where` with `and`
          - works when using `where` with `limit`
          - works when using `where` with `skip`
          - works when using `where` with `offset`
          - works when using `where` without `limit`, `skip` or `offset`
        pagination
          - works with the default page size (0) and `inqlimit` is exceeded
          - works when page size is set to 0
        relations
          - works when hasOne is called
          - works when hasMany is called
          - works when hasManyThrough is called
          - works when belongsTo is called
      performance
        ✓ including belongsTo should make only 2 db calls (438ms)
        ✓ including hasManyThrough should make only 3 db calls (2798ms)
        ✓ including hasMany should make only 3 db calls (543ms)
        ✓ should not make n+1 db calls in relation syntax (544ms)
    Model instance with included relation .toJSON()
      ✓ should recursively serialize objects


  697 passing (7m)
  61 pending
  2 failing

  1) Discover and build models
       should discover and build models:

      Uncaught AssertionError [ERR_ASSERTION]: error should not be reported
      + expected - actual

      -false
      +true
      
      at /Users/dremond/Documents/PRs_LoopBack/connector-dashdb-failures/loopback-connector-dashdb/test/discovery.test.js:319:13
      at /Users/dremond/Documents/PRs_LoopBack/connector-dashdb-failures/loopback-connector-dashdb/node_modules/loopback-datasource-juggler/lib/dao.js:1783:62
      at allCb (node_modules/loopback-datasource-juggler/lib/dao.js:1722:7)
      at /Users/dremond/Documents/PRs_LoopBack/connector-dashdb-failures/loopback-connector-dashdb/node_modules/loopback-connector/lib/sql.js:1447:14
      at cbForWork (node_modules/loopback-datasource-juggler/lib/observer.js:234:34)
      at /Users/dremond/Documents/PRs_LoopBack/connector-dashdb-failures/loopback-connector-dashdb/node_modules/loopback-connector/lib/sql.js:648:9
      at /Users/dremond/Documents/PRs_LoopBack/connector-dashdb-failures/loopback-connector-dashdb/node_modules/loopback-ibmdb/lib/ibmdb.js:281:11
      at Database.db.close (node_modules/ibm_db/lib/odbc.js:1745:13)
      at /Users/dremond/Documents/PRs_LoopBack/connector-dashdb-failures/loopback-connector-dashdb/node_modules/loopback-ibmdb/lib/ibmdb.js:280:14
      at /Users/dremond/Documents/PRs_LoopBack/connector-dashdb-failures/loopback-connector-dashdb/node_modules/loopback-ibmdb/lib/ibmdb.js:268:20
      at cbQuery (node_modules/ibm_db/lib/odbc.js:482:20)

  2) dashdb imported features
       manipulation
         create
           should refuse to create object with duplicate id:
     Error: Create should have rejected duplicate id.
      at /Users/dremond/Documents/PRs_LoopBack/connector-dashdb-failures/loopback-connector-dashdb/node_modules/loopback-datasource-juggler/test/manipulation.test.js:370:27
      at /Users/dremond/Documents/PRs_LoopBack/connector-dashdb-failures/loopback-connector-dashdb/node_modules/loopback-datasource-juggler/lib/dao.js:424:21
      at doNotify (node_modules/loopback-datasource-juggler/lib/observer.js:155:49)
      at doNotify (node_modules/loopback-datasource-juggler/lib/observer.js:155:49)
      at Function.ObserverMixin._notifyBaseObservers (node_modules/loopback-datasource-juggler/lib/observer.js:178:5)
      at Function.ObserverMixin.notifyObserversOf (node_modules/loopback-datasource-juggler/lib/observer.js:153:8)
      at Function.ObserverMixin._notifyBaseObservers (node_modules/loopback-datasource-juggler/lib/observer.js:176:15)
      at Function.ObserverMixin.notifyObserversOf (node_modules/loopback-datasource-juggler/lib/observer.js:153:8)
      at ProductTest.<anonymous> (node_modules/loopback-datasource-juggler/lib/dao.js:423:25)
      at ProductTest.next (node_modules/loopback-datasource-juggler/lib/hooks.js:93:12)
      at ProductTest.<anonymous> (node_modules/loopback-datasource-juggler/lib/dao.js:411:26)
      at ProductTest.next (node_modules/loopback-datasource-juggler/lib/hooks.js:93:12)
      at /Users/dremond/Documents/PRs_LoopBack/connector-dashdb-failures/loopback-connector-dashdb/node_modules/loopback-datasource-juggler/lib/dao.js:410:22
      at doNotify (node_modules/loopback-datasource-juggler/lib/observer.js:155:49)
      at doNotify (node_modules/loopback-datasource-juggler/lib/observer.js:155:49)
      at Function.ObserverMixin._notifyBaseObservers (node_modules/loopback-datasource-juggler/lib/observer.js:178:5)
      at Function.ObserverMixin.notifyObserversOf (node_modules/loopback-datasource-juggler/lib/observer.js:153:8)
      at Function.ObserverMixin._notifyBaseObservers (node_modules/loopback-datasource-juggler/lib/observer.js:176:15)
      at Function.ObserverMixin.notifyObserversOf (node_modules/loopback-datasource-juggler/lib/observer.js:153:8)
      at createCallback (node_modules/loopback-datasource-juggler/lib/dao.js:400:17)
      at /Users/dremond/Documents/PRs_LoopBack/connector-dashdb-failures/loopback-connector-dashdb/lib/dashdb.js:60:7
      at /Users/dremond/Documents/PRs_LoopBack/connector-dashdb-failures/loopback-connector-dashdb/node_modules/loopback-datasource-juggler/lib/observer.js:250:22
      at doNotify (node_modules/loopback-datasource-juggler/lib/observer.js:155:49)
      at DASHDB.ObserverMixin._notifyBaseObservers (node_modules/loopback-datasource-juggler/lib/observer.js:178:5)
      at DASHDB.ObserverMixin.notifyObserversOf (node_modules/loopback-datasource-juggler/lib/observer.js:153:8)
      at cbForWork (node_modules/loopback-datasource-juggler/lib/observer.js:240:14)
      at /Users/dremond/Documents/PRs_LoopBack/connector-dashdb-failures/loopback-connector-dashdb/node_modules/loopback-connector/lib/sql.js:648:9
      at /Users/dremond/Documents/PRs_LoopBack/connector-dashdb-failures/loopback-connector-dashdb/node_modules/loopback-ibmdb/lib/ibmdb.js:281:11
      at Database.db.close (node_modules/ibm_db/lib/odbc.js:1745:13)
      at /Users/dremond/Documents/PRs_LoopBack/connector-dashdb-failures/loopback-connector-dashdb/node_modules/loopback-ibmdb/lib/ibmdb.js:280:14
      at /Users/dremond/Documents/PRs_LoopBack/connector-dashdb-failures/loopback-connector-dashdb/node_modules/loopback-ibmdb/lib/ibmdb.js:268:20
      at /Users/dremond/Documents/PRs_LoopBack/connector-dashdb-failures/loopback-connector-dashdb/node_modules/ibm_db/lib/odbc.js:565:76

@emonddr
Copy link
Contributor

emonddr commented Jul 15, 2019

Tried interacting directly with db2 warehouse database using the db2 interactive shell.

If I define a table where ID column is primary key

CREATE TABLE DOMSCHEMA1.NAMES (ID        SMALLINT NOT NULL, NAME     VARCHAR(9), CONSTRAINT PKEYID PRIMARY KEY (ID) )

or 

CREATE TABLE DOMSCHEMA1.NAMES (ID        SMALLINT NOT NULL UNIQUE, NAME     VARCHAR(9) )

it is possible to insert rows with same ID value

INSERT INTO DOMSCHEMA1.NAMES (ID, NAME) VALUES (1,'Dominique'); 
INSERT INTO DOMSCHEMA1.NAMES (ID, NAME) VALUES (2,'Sally'); 

with no error.

I tried this with a plain db2 (non-db2-warehouse) database, with same table definitions, and plain db2 doesn't allow duplicate ID values (which is good).

For db2 warehouse it seems that in March 2018 there was some kind of change with regards to the enforcement of primary key constraints.

http://www-01.ibm.com/support/docview.wss?uid=swg22010509

Starting in March 2018, on newly deployed Db2 Warehouse on Cloud systems, unless you explicitly specify otherwise, the database manager will not enforce unique or referential constraints (primary key, foreign key, etc.). A key advantage of not enforcing constraints is that ingest performance is typically improved. However, if table data violates an unenforced constraint, this can cause unexpected results.

To enforce uniqueness, you must explicitly specify the ENFORCED parameter when you define or alter a constraint. Alternately, if you want constraints to be enforced by default, you can open a support ticket and request a change to your system.

Using a create table definition with the ENFORCED keyword seems to be the only way to
enforce the uniqueness of the ID field.

CREATE TABLE DOMSCHEMA1.NAMES (ID        SMALLINT NOT NULL, NAME     VARCHAR(9), CONSTRAINT PKEYID PRIMARY KEY (ID) ENFORCED )

@emonddr
Copy link
Contributor

emonddr commented Jul 15, 2019

In

/Users/dremond/Documents/PRs_LoopBack/connector-dashdb-failures/loopback-connector-dashdb/test/init.js

connector capabilities for testing are set in :

global.connectorCapabilities = {
ilike: false,
nilike: false,
}

The original failing test

bdd.itIf(connectorCapabilities.refuseDuplicateInsert !== false, 'should refuse to create ' +
    'object with duplicate id', function(done) {

it checks for a connector capability named refuseDuplicateInsert .

I decided to try adding this property into global.connectorCapabilities to see what would happen.

  1. Setting refuseDuplicateInsert:false

global.connectorCapabilities = {
ilike: false,
nilike: false,
refuseDuplicateInsert:false
};

npm run test fails with:

697 passing (6m)
  62 pending
  1 failing


  1) Discover and build models
       should discover and build models:

      Uncaught AssertionError [ERR_ASSERTION]: error should not be reported
      + expected - actual

      -false
      +true
      
      at /Users/dremond/Documents/PRs_LoopBack/connector-dashdb-failures/loopback-connector-dashdb/test/discovery.test.js:319:13
      at /Users/dremond/Documents/PRs_LoopBack/connector-dashdb-failures/loopback-connector-dashdb/node_modules/loopback-datasource-juggler/lib/dao.js:1783:62
      at allCb (node_modules/loopback-datasource-juggler/lib/dao.js:1722:7)

  1. Setting refuseDuplicateInsert:true

global.connectorCapabilities = {
ilike: false,
nilike: false,
refuseDuplicateInsert:true
};

npm run test fails with:

  697 passing (6m)
  61 pending
  2 failing

  1) Discover and build models
       should discover and build models:

      Uncaught AssertionError [ERR_ASSERTION]: error should not be reported
      + expected - actual

      -false
      +true
      
      at /Users/dremond/Documents/PRs_LoopBack/connector-dashdb-failures/loopback-connector-dashdb/test/discovery.test.js:319:13
      at /Users/dremond/Documents/PRs_LoopBack/connector-dashdb-failures/loopback-connector-dashdb/node_modules/loopback-datasource-juggler/lib/dao.js:1783:62
      at allCb (node_modules/loopback-datasource-juggler/lib/dao.js:1722:7)
      at /Users/dremond/Documents/PRs_LoopBack/connector-dashdb-failures/loopback-connector-dashdb/node_modules/loopback-connector/lib/sql.js:1447:14
      at cbForWork (node_modules/loopback-datasource-juggler/lib/observer.js:234:34)
      at /Users/dremond/Documents/PRs_LoopBack/connector-dashdb-failures/loopback-connector-dashdb/node_modules/loopback-connector/lib/sql.js:648:9
      at /Users/dremond/Documents/PRs_LoopBack/connector-dashdb-failures/loopback-connector-dashdb/node_modules/loopback-ibmdb/lib/ibmdb.js:281:11
      at Database.db.close (node_modules/ibm_db/lib/odbc.js:1745:13)
      at /Users/dremond/Documents/PRs_LoopBack/connector-dashdb-failures/loopback-connector-dashdb/node_modules/loopback-ibmdb/lib/ibmdb.js:280:14
      at /Users/dremond/Documents/PRs_LoopBack/connector-dashdb-failures/loopback-connector-dashdb/node_modules/loopback-ibmdb/lib/ibmdb.js:268:20
      at cbQuery (node_modules/ibm_db/lib/odbc.js:482:20)

  2) dashdb imported features
       manipulation
         create
           should refuse to create object with duplicate id:
     Error: Create should have rejected duplicate id.
      at /Users/dremond/Documents/PRs_LoopBack/connector-dashdb-failures/loopback-connector-dashdb/node_modules/loopback-datasource-juggler/test/manipulation.test.js:370:27
      at /Users/dremond/Documents/PRs_LoopBack/connector-dashdb-failures/loopback-connector-dashdb/node_modules/loopback-datasource-juggler/lib/dao.js:424:21
      at doNotify (node_modules/loopback-datasource-juggler/lib/observer.js:155:49)
      at doNotify (node_modules/loo

@emonddr
Copy link
Contributor

emonddr commented Jul 15, 2019

What we need to find out still is if all the tests were working beforehand with an older version of dashdb (db2 warehouse). (The original VM with dashdb no longer boots, so it is not possible to view the old dashdb version).

Currently with the dash db we just installed on a new VM for our Jenkins CI , the test is failing.

@b-admike had a few tips moving forward:

this is where we build the primary key constraints for both dashdb/db2 https://github.com/strongloop/loopback-ibmdb/blob/055def01d116e9fbdb794d8046af66c934550762/lib/ibmdb.js#L826-L842

one way we deal with db version functionality changes https://github.com/strongloop/loopback-connector-mongodb/blob/2ba8cc77089a1573280568c85a75b4723ff4544a/deps/juggler-v3/test.js#L32-L49

this is where flags are defined for juggler common tests https://github.com/strongloop/loopback-connector-dashdb/blob/master/test/init.js#L40-L43

We may need to have loopback-dashdb-connector override

IBMDB.prototype.buildColumnDefinitions = function(model) {
  debug('IBMDB.prototype.buildColumnDefinitions');
  var self = this;
  var sql = [];
  var definition = this.getModelDefinition(model);
  var pks = this.idNames(model).map(function(i) {
    return self.columnEscaped(model, i);
  });
  Object.keys(definition.properties).forEach(function(prop) {
    var colName = self.columnEscaped(model, prop);
    sql.push(colName + ' ' + self.buildColumnDefinition(model, prop));
  });
  if (pks.length > 0) {
    sql.push('PRIMARY KEY(' + pks.join(',') + ')');
  }

  return sql.join(',\n');
};

in

https://github.com/strongloop/loopback-ibmdb/blob/055def01d116e9fbdb794d8046af66c934550762/lib/ibmdb.js

so that it can add the ENFORCE keyword for each primary key.

And we may only need to do this in our test suite for certain versions of dashdb and not others.
The example given is: https://github.com/strongloop/loopback-connector-mongodb/blob/2ba8cc77089a1573280568c85a75b4723ff4544a/deps/juggler-v3/test.js#L32-L49

@bajtos
Copy link
Member

bajtos commented Jul 16, 2019

Thank you @emonddr for capturing the information on GitHub.

Since the scope of this task is to fix the failing CI build, I am proposing to skip the problematic test for now (by setting refuseDuplicateInsert:false) and open a new (spike) issue to investigate the problem of primary key enforcement.

I think we should spend the remaining time on investigating the second failing test, should discover and build models.

@emonddr
Copy link
Contributor

emonddr commented Jul 16, 2019

I found someone to speak to on the DB2 Warehouse team.
She confirmed the behaviour change in DB2 warehouse.

She gave me some commands to view or set a specific setting related the issue we ran into.

To show the current value of DDL_CONSTRAINT_DEF:

db2 get db cfg for BLUDB | grep DDL_CONSTRAINT_DE 
 Enforce Constraint                  (DDL_CONSTRAINT_DEF) = NO

To set the value to YES:

db2 connect to BLUDB 
db2 update db cfg for BLUDB using DDL_CONSTRAINT_DEF YES immediate
db2 terminate

I was able to confirm the setting was indeed turned on:

db2 get db cfg for BLUDB | grep DDL_CONSTRAINT_DEF
 Enforce Constraint                  (DDL_CONSTRAINT_DEF) = YES

@emonddr
Copy link
Contributor

emonddr commented Jul 17, 2019

Latest run of CI job for Node.js 10 shows zero errors:

+ npm test
09:26:54 
09:26:54 > [email protected] pretest /home/jenkins/workspace/nb/loopback-connector-dashdb~master/37975cf6
09:26:54 > node pretest.js
09:26:54 
09:26:54 > Seeding the database ...
09:26:55 > Cleaning up existing schemas ...
09:27:08 > Created schema: SCHEMA5_DASHDB_LINUX_10
09:27:09 > Done seeding the database.
09:27:14 
09:27:14 > [email protected] test /home/jenkins/workspace/nb/loopback-connector-dashdb~master/37975cf6
09:27:14 > mocha --timeout 20000 --require test/init.js
09:27:14 
09:27:15 
09:27:15 
09:27:15   testConnection
09:27:16     ✓ should pass with valid settings (598ms)
09:27:16     ✓ should pass when valid DSN overrides empty settings (517ms)
09:27:17     ✓ should pass when valid DSN overrides invalid settings (519ms)
09:27:17 
09:27:17   parameterized SQL
09:27:18     ✓ does not return result with SQL injection (165ms)
09:27:18 
09:27:18   query test
09:27:20     ✓ find all data (167ms)
09:27:20     regexp operator
09:27:21       using no flags
09:27:21         ✓ as regex string (167ms)
09:27:21         ✓ as regex literal (165ms)
09:27:21         ✓ as regex object (170ms)
09:27:21       using flags
09:27:21         ✓ as regex string (159ms)
09:27:21         ✓ as regex literal (153ms)
09:27:22         ✓ as regex object (151ms)
09:27:22     like operator
09:27:23       ✓ find using like operator (154ms)
09:27:23     nlike operator
09:27:24       ✓ find using nlike operator (161ms)
09:27:24 
09:27:24   transactions
09:27:24     commit and rollback
09:27:25       commit
09:27:26         ✓ should not see the uncommitted insert (776ms)
09:27:26         ✓ should see the uncommitted insert from the same transaction (78ms)
09:27:26         ✓ should commit a transaction (78ms)
09:27:26         ✓ should see the committed insert (157ms)
09:27:26       rollback
09:27:26         ✓ should not see the uncommitted insert (156ms)
09:27:26         ✓ should see the uncommitted insert from the same transaction (78ms)
09:27:26         ✓ should rollback a transaction (77ms)
09:27:26         ✓ should not see the rolledback insert (158ms)
09:27:26 
09:27:26   discoverModels
09:27:26     Discover database schemas
09:27:27       ✓ should return an array of db schemas (545ms)
09:27:27     Discover models including views
09:27:28       ✓ should return an array of tables and views (531ms)
09:27:28     Discover current user's tables
09:27:28       ✓ should return an array of tables for the current user (153ms)
09:27:28     Discover models excluding views
09:27:28       ✓ should return an array of only tables (179ms)
09:27:28 
09:27:28   Discover models including other users
09:27:28     ✓ should return an array of all tables and views (165ms)
09:27:28 
09:27:28   Discover model properties
09:27:28     Discover a named model
09:27:28       ✓ should return an array of columns for PRODUCT (160ms)
09:27:28 
09:27:28   Discover model primary keys
09:27:28     ✓ should return an array of primary keys for PRODUCT (153ms)
09:27:29     ✓ should return an array of primary keys for STRONGLOOP.PRODUCT (157ms)
09:27:29 
09:27:29   Discover model foreign keys
09:27:29     ✓ should return an array of foreign keys for INVENTORY (154ms)
09:27:29     ✓ should return an array of foreign keys for STRONGLOOP.INVENTORY (159ms)
09:27:29 
09:27:29   Discover LDL schema from a table
09:27:29     ✓ should return an LDL schema for INVENTORY (237ms)
09:27:29 
09:27:29   Discover and build models
09:27:30     ✓ should discover and build models (716ms)
09:27:30 
09:27:30   dashdb imported features
09:27:30     datatypes
09:27:31       ✓ should resolve top-level "type" property correctly
09:27:31       ✓ should resolve "type" sub-property correctly
09:27:31       ✓ should resolve array prop with connector specific metadata
09:27:31       ✓ should coerce array of dates from string (167ms)
09:27:31       ✓ should coerce array of numbers from string (167ms)
09:27:31       ✓ should return 400 when property of type array is set to string value
09:27:31       ✓ should return 400 when property of type array is set to object value
09:27:32       ✓ should keep types when get read data from db (484ms)
09:27:33       ✓ should respect data types when updating attributes (802ms)
09:27:33       ✓ should not coerce nested objects into ModelConstructor types
09:27:33       ✓ rejects array value converted to NaN for a required property
09:27:33       ✓ handles null data (672ms)
09:27:33       model option persistUndefinedAsNull
09:27:34         ✓ should set missing optional properties to null (317ms)
09:27:35         ✓ should convert property value undefined to null (511ms)
09:27:35         ✓ should convert undefined to null in the setter
09:27:35         ✓ should use null in unsetAttribute()
09:27:35         ✓ should convert undefined to null on save (550ms)
09:27:35         ✓ should convert undefined to null in toObject()
09:27:35     basic-querying
09:27:36       ping
09:27:36         ✓ should be able to test connections (150ms)
09:27:36       findById
09:27:36         ✓ should query by id: not found (153ms)
09:27:37         ✓ should query by id: found (321ms)
09:27:37       findByIds
09:27:38         ✓ should query by ids (160ms)
09:27:38         ✓ should query by ids and condition (170ms)
09:27:38         ✓ should query by ids to check null property (181ms)
09:27:38       find
09:27:39         ✓ should query collection (228ms)
09:27:39         ✓ should query limited collection (239ms)
09:27:40         ✓ should query collection with skip & limit (231ms)
09:27:40         ✓ should query collection with offset & limit (264ms)
09:27:40         ✓ should query filtered collection (210ms)
09:27:40         ✓ should query collection sorted by numeric field (226ms)
09:27:41         ✓ should query collection desc sorted by numeric field (238ms)
09:27:41         ✓ should query collection sorted by string field (221ms)
09:27:41         ✓ should query collection desc sorted by string field (241ms)
09:27:41         ✓ should query sorted desc by order integer field even though there is an async model loaded hook (273ms)
09:27:42         ✓ should support "and" operator that is satisfied (193ms)
09:27:42         ✓ should support "and" operator that is not satisfied (156ms)
09:27:42         ✓ should support "or" that is satisfied (231ms)
09:27:42         ✓ should support "or" operator that is not satisfied (156ms)
09:27:42         ✓ should support where date "neq" null (236ms)
09:27:43         ✓ should support where date is null (244ms)
09:27:43         ✓ should support date "gte" that is satisfied (229ms)
09:27:43         ✓ should support date "gt" that is not satisfied (160ms)
09:27:43         ✓ should support date "gt" that is satisfied (172ms)
09:27:43         ✓ should support date "lt" that is satisfied (211ms)
09:27:44         ✓ should support number "gte" that is satisfied (220ms)
09:27:44         ✓ should support number "gt" that is not satisfied (160ms)
09:27:44         ✓ should support number "gt" that is satisfied (238ms)
09:27:44         ✓ should support number "lt" that is satisfied (199ms)
09:27:44         ✓ should support number "gt" that is satisfied by null value (153ms)
09:27:44         ✓ should support number "lt" that is not satisfied by null value (156ms)
09:27:45         ✓ should support string "gte" that is satisfied by null value (151ms)
09:27:45         ✓ should support string "gte" that is satisfied (249ms)
09:27:45         ✓ should support string "gt" that is not satisfied (157ms)
09:27:45         ✓ should support string "gt" that is satisfied (244ms)
09:27:46         ✓ should support string "lt" that is satisfied (226ms)
09:27:46         ✓ should support boolean "gte" that is satisfied (221ms)
09:27:46         ✓ should support boolean "gt" that is not satisfied (161ms)
09:27:46         ✓ should support boolean "gt" that is satisfied (239ms)
09:27:46         ✓ should support boolean "lt" that is satisfied (264ms)
09:27:46         - [UNSUPPORTED] - supports non-empty inq
09:27:46         - [UNSUPPORTED] - supports empty inq
09:27:47         ✓ should only include fields as specified (1070ms)
09:27:48         ✓ should ignore non existing properties when excluding (273ms)
09:27:49         ✓ applies default values by default (1654ms)
09:27:51         ✓ preserves empty values from the database when "applyDefaultsOnReads" is false (1364ms)
09:27:51         [UNSUPPORTED] - ilike
09:27:51           - should support "like" that is satisfied
09:27:51           - should support "like" that is not satisfied
09:27:51           - should support "ilike" that is satisfied
09:27:51           - should support "ilike" that is not satisfied
09:27:51         [UNSUPPORTED] - nilike
09:27:51           - should support "nlike" that is satisfied
09:27:51           - should support "nilike" that is satisfied
09:27:51         geo queries
09:27:51           near filter
09:27:51             ✓ supports a basic "near" query (262ms)
09:27:51             ✓ supports "near" inside a coumpound query with "and" (259ms)
09:27:52             ✓ supports "near" inside a complex coumpound query with multiple "and" (238ms)
09:27:52             ✓ supports multiple "near" queries with "or" (201ms)
09:27:52             ✓ supports multiple "near" queries with "or" inside a coumpound query with "and" (248ms)
09:27:52         [UNSUPPORTED] - query with nested property
09:27:52           - should support nested property in query
09:27:52           - should support nested property with regex over arrays in query
09:27:52           - should support nested property with gt in query
09:27:52           - [UNSUPPORTED] - should support nested property for order in query
09:27:52           - should support multi-level nested array property in query
09:27:52           - should fail when querying with an invalid value for a type
09:27:52       count
09:27:53         ✓ should query total count (163ms)
09:27:53         ✓ should query filtered count (150ms)
09:27:53       findOne
09:27:54         ✓ should find first record (default sort by id) (315ms)
09:27:54         - [UNSUPPORTED] - should find first record
09:27:54         - [UNSUPPORTED] - should find last record
09:27:54         - [UNSUPPORTED] - should find last record in filtered set
09:27:54         ✓ should work even when find by id (316ms)
09:27:54       exists
09:27:55         ✓ should check whether record exist (311ms)
09:27:56         ✓ should check whether record not exist (312ms)
09:27:56       updateAll
09:27:57         ✓ coerces primitive datatypes on update (482ms)
09:27:57         ✓ coerces primitive array datatypes on update (476ms)
09:27:57     regexp operator
09:27:58       ✓ should return an error for invalid data types
09:27:58     queries
09:27:58       that do not require an id
09:27:58         - should work for create
09:27:58         - should work for updateOrCreate/upsert
09:27:58         - should work for findOrCreate
09:27:58         - should work for exists
09:27:58         - should work for find
09:27:58         - should work for findOne
09:27:58         - should work for deleteAll/destroyAll/remove
09:27:58         - should work for update/updateAll
09:27:58         - should work for count
09:27:58       that require an id
09:27:58         - should return an error for findById
09:27:58         - should return an error for findByIds
09:27:58         - should return an error for deleteById/destroyById/removeById
09:27:58         - should return an error for instance.save
09:27:58         - should return an error for instance.delete
09:27:58         - should return an error for instance.updateAttribute
09:27:58         - should return an error for instance.updateAttributes
09:27:58     manipulation
09:27:59       create
09:28:00         ✓ should create instance (324ms)
09:28:00         ✓ should create instance (promise variant) (316ms)
09:28:00         ✓ should instantiate an object (157ms)
09:28:01         ✓ should instantiate an object (promise variant) (323ms)
09:28:01         ✓ should not return instance of object (162ms)
09:28:01         ✓ should not allow user-defined value for the id of object - create
09:28:01         ✓ should not allow user-defined value for the id of object - create (promise variant)
09:28:01         ✓ should not allow user-defined value for the id of object - save
09:28:01         ✓ should not allow user-defined value for the id of object - save (promise variant)
09:28:01 Wed, 17 Jul 2019 13:28:01 GMT loopback-datasource-juggler deprecated Model hook "Person.afterCreate" is deprecated, use Operation hooks instead. http://docs.strongloop.com/display/LB/Operation+hooks at node_modules/loopback-datasource-juggler/lib/dao.js:376:9
09:28:01         ✓ should work when called without callback (169ms)
09:28:01         ✓ should create instance with blank data (311ms)
09:28:02         ✓ should create instance with blank data (promise variant) (314ms)
09:28:02         ✓ should work when called with no data and callback (190ms)
09:28:03         ✓ should create batch of objects (943ms)
09:28:03         ✓ should create batch of objects (promise variant) (533ms)
09:28:03         ✓ should create batch of objects with beforeCreate (231ms)
09:28:04         ✓ should preserve properties with "undefined" value (302ms)
09:28:05         ✓ should refuse to create object with duplicate id (797ms)
09:28:05         forceId
09:28:05           ✓ it defaults to forceId:true for generated id property
09:28:05       save
09:28:05         ✓ should save new object (157ms)
09:28:05         ✓ should save new object (promise variant) (152ms)
09:28:06         ✓ should save existing object (549ms)
09:28:06         ✓ should save existing object (promise variant) (533ms)
09:28:07         ✓ should save invalid object (skipping validation) (391ms)
09:28:07         ✓ should save invalid object (skipping validation - promise variant) (375ms)
09:28:07         ✓ should save throw error on validation (157ms)
09:28:08         ✓ should preserve properties with dynamic setters (627ms)
09:28:08       updateAttributes
09:28:09         ✓ should have updated password hashed with updateAttribute (471ms)
09:28:09         ✓ should reject created StubUser with empty password
09:28:09         ✓ should reject updated empty password with updateAttribute (163ms)
09:28:09         ✓ should update one attribute (311ms)
09:28:10         ✓ should update one attribute (promise variant) (473ms)
09:28:10         ✓ should ignore undefined values on updateAttributes (313ms)
09:28:10         ✓ should discard undefined values before strict validation (454ms)
09:28:11         ✓ should allow unknown attributes when strict: false (298ms)
09:28:11         ✓ should remove unknown attributes when strict: filter (303ms)
09:28:12         ✓ should return error on unknown attributes when strict: true (1094ms)
09:28:12         ✓ should fallback to strict:true when using strict: throw (301ms)
09:28:13         ✓ should fallback to strict:true when using strict:validate (306ms)
09:28:13         ✓ should allow same id value on updateAttributes (304ms)
09:28:13         ✓ should allow same stringified id value on updateAttributes (299ms)
09:28:13         ✓ should fail if an id value is to be changed on updateAttributes
09:28:13         ✓ has an alias "patchAttributes"
09:28:14         ✓ should allow model instance on updateAttributes (318ms)
09:28:14         ✓ should allow model instance on updateAttributes (promise variant) (312ms)
09:28:14         ✓ should raises on connector error
09:28:14       updateOrCreate
09:28:15         ✓ has an alias "patchOrCreate"
09:28:15         ✓ creates a model when one does not exist (315ms)
09:28:16         ✓ updates a model if it exists (465ms)
09:28:16         ✓ should reject updated empty password with updateOrCreate (306ms)
09:28:16         ✓ throws error for queries with array input
09:28:17         ✓ should preserve properties with dynamic setters on create (308ms)
09:28:18         ✓ should preserve properties with dynamic setters on update (607ms)
09:28:18         ✓ should preserve properties with "undefined" value (394ms)
09:28:19         ✓ updates specific instances when PK is not an auto-generated id (922ms)
09:28:20         ✓ should allow save() of the created instance (459ms)
09:28:20       updateOrCreate when forceId is true
09:28:21         ✓ fails when id does not exist in db & validate is true (159ms)
09:28:21         ✓ fails when id does not exist in db & validate is false (156ms)
09:28:21         ✓ fails when id does not exist in db & validate is false when using updateAttributes (163ms)
09:28:21         ✓ works on create if the request does not include an id (161ms)
09:28:22         ✓ works on update if the request includes an existing id in db (472ms)
09:28:22       replaceOrCreate
09:28:23         ✓ works without options on create (promise variant) (416ms)
09:28:24         ✓ works with options on create (promise variant) (594ms)
09:28:24         ✓ works without options on update (promise variant) (658ms)
09:28:25         ✓ works with options on update (promise variant) (651ms)
09:28:26         ✓ works without options on update (callback variant) (644ms)
09:28:26         ✓ works with options on update (callback variant) (668ms)
09:28:27         ✓ works without options on create (callback variant) (537ms)
09:28:27         ✓ works with options on create (callback variant) (515ms)
09:28:27       replaceOrCreate when forceId is true
09:28:28         ✓ fails when id does not exist in db (162ms)
09:28:28         ✓ works on create if the request does not include an id (165ms)
09:28:29         ✓ works on update if the request includes an existing id in db (479ms)
09:28:29       replaceAttributes
09:28:31         ✓ should have updated password hashed with replaceAttributes (638ms)
09:28:31         ✓ should reject updated empty password with replaceAttributes (152ms)
09:28:32 WARNING: id property cannot be changed from 3 to 99 for model:Post in 'before save' operation hook
09:28:32 WARNING: id property cannot be changed from 3 to 99 for model:Post in 'loaded' operation hook
09:28:32         ✓ should ignore PK if it is set for `instance`in `before save` operation hook (638ms)
09:28:33         ✓ should set cannotOverwritePKInBeforeSaveHook flag, if `instance` in`before save` operation hook is set, so we report a warning just once (501ms)
09:28:34         ✓ should ignore PK if it is set for `data`in `loaded` operation hook (648ms)
09:28:35         ✓ should set cannotOverwritePKInLoadedHook flag, if `instance` in`before save` operation hook is set, so we report a warning just once (494ms)
09:28:36         ✓ works without options(promise variant) (696ms)
09:28:37         ✓ works with options(promise variant) (620ms)
09:28:37         ✓ should fail when changing id (158ms)
09:28:38         ✓ works without options(callback variant) (486ms)
09:28:39         ✓ works with options(callback variant) (473ms)
09:28:39       replaceById
09:28:40         ✓ fails when id does not exist in db using replaceById (164ms)
09:28:40       findOrCreate
09:28:40         ✓ should create a record with if new (317ms)
09:28:40         ✓ should find a record if exists (154ms)
09:28:41         ✓ should create a record with if new (promise variant) (317ms)
09:28:41         ✓ should find a record if exists (promise variant) (152ms)
09:28:43         ✓ applies default values on returned data (1575ms)
09:28:44         ✓ preserves empty values from the database when "applyDefaultsOnReads" is false (1785ms)
09:28:44       destroy
09:28:45         ✓ should destroy record (474ms)
09:28:45         ✓ should destroy record (promise variant) (461ms)
09:28:46         ✓ should destroy all records (465ms)
09:28:46         ✓ should destroy all records (promise variant) (634ms)
09:28:46         - should destroy filtered set of records
09:28:46       deleteAll/destroyAll
09:28:47         ✓ should be defined as function
09:28:48         ✓ should only delete instances that satisfy the where condition (465ms)
09:28:48         ✓ should report zero deleted instances when no matches are found (305ms)
09:28:49         ✓ should delete all instances when the where condition is not provided (309ms)
09:28:49       [UNSUPPORTED] - deleteAll/destroyAll case 2
09:28:49         - should be defined as function
09:28:49         - should only delete instances that satisfy the where condition
09:28:49         - should report zero deleted instances when no matches are found
09:28:49         - should delete all instances when the where condition is not provided
09:28:49       deleteById
09:28:50         ✓ should allow deleteById(id) - success (314ms)
09:28:51         ✓ should allow deleteById(id) - fail (157ms)
09:28:52         ✓ should allow deleteById(id) - fail with error (150ms)
09:28:52       prototype.delete
09:28:53         ✓ should allow delete(id) - success (308ms)
09:28:54         ✓ should allow delete(id) - fail (457ms)
09:28:55         ✓ should allow delete(id) - fail with error (452ms)
09:28:55       initialize
09:28:55         ✓ should initialize object properly
09:28:55         Date $now function (type: Date)
09:28:56           ✓ should report current date as default value for date property
09:28:56         Date $now function (type: String)
09:28:56           ✓ should report '$now' as default value for string property
09:28:56         now defaultFn
09:28:57           ✓ should generate current time when "defaultFn" is "now" (166ms)
09:28:57         guid defaultFn
09:28:57           ✓ should generate a new id when "defaultFn" is "guid" (171ms)
09:28:57         uuid defaultFn
09:28:58           ✓ should generate a new id when "defaultfn" is "uuid" (164ms)
09:28:58         uuidv4 defaultFn
09:28:58           ✓ should generate a new id when "defaultfn" is "uuidv4" (167ms)
09:28:58         shortid defaultFn
09:28:58           ✓ should generate a new id when "defaultFn" is "shortid" (169ms)
09:28:58       property value coercion
09:28:58         ✓ should coerce boolean types properly
09:28:58         ✓ should coerce date types properly
09:28:58       update/updateAll
09:28:59         ✓ should be defined as a function
09:29:00         ✓ should not update instances that do not satisfy the where condition (328ms)
09:29:01         ✓ should only update instances that satisfy the where condition (312ms)
09:29:02         ✓ should reject updated empty password with updateAll (160ms)
09:29:03         ✓ should update all instances when the where condition is not provided (467ms)
09:29:04         ✓ should ignore where conditions with undefined values (318ms)
09:29:05         ✓ should not coerce invalid values provided in where conditions
09:29:05       upsertWithWhere
09:29:06         ✓ has an alias "patchOrCreateWithWhere"
09:29:06         ✓ should preserve properties with dynamic setters on create (482ms)
09:29:07         ✓ should preserve properties with dynamic setters on update (615ms)
09:29:07         ✓ should preserve properties with "undefined" value (478ms)
09:29:08         ✓ should allow save() of the created instance (551ms)
09:29:08         ✓ works without options on create (promise variant) (473ms)
09:29:09         ✓ works with options on create (promise variant) (464ms)
09:29:09         ✓ works without options on update (promise variant) (633ms)
09:29:10         ✓ works with options on update (promise variant) (627ms)
09:29:10         ✓ fails the upsertWithWhere operation when data object is empty
09:29:10         ✓ creates a new record when no matching instance is found (483ms)
09:29:11         ✓ fails the upsertWithWhere operation when multiple instances are retrieved based on the filter criteria (709ms)
09:29:12         ✓ updates the record when one matching instance is found based on the filter criteria (652ms)
09:29:12     hooks
09:29:12       initialize
09:29:12         ✓ should be triggered on new
09:29:13         ✓ should be triggered on create (167ms)
09:29:13       create
09:29:13         ✓ should be triggered on create (166ms)
09:29:13         ✓ should not be triggered on new
09:29:13         ✓ should be triggered on new+save (159ms)
09:29:13         ✓ afterCreate should not be triggered on failed create
09:29:13         ✓ afterCreate should not be triggered on failed beforeCreate
09:29:13       save
09:29:13 Wed, 17 Jul 2019 13:29:13 GMT loopback-datasource-juggler deprecated Model hook "User.beforeSave" is deprecated, use Operation hooks instead. http://docs.strongloop.com/display/LB/Operation+hooks at node_modules/loopback-datasource-juggler/lib/dao.js:377:11
09:29:13         ✓ should be triggered on create (153ms)
09:29:13         ✓ should be triggered on new+save (162ms)
09:29:13 Wed, 17 Jul 2019 13:29:13 GMT loopback-datasource-juggler deprecated Model hook "User.beforeSave" is deprecated, use Operation hooks instead. http://docs.strongloop.com/display/LB/Operation+hooks at node_modules/loopback-datasource-juggler/lib/dao.js:2887:14
09:29:14         ✓ should be triggered on updateAttributes (317ms)
09:29:14 Wed, 17 Jul 2019 13:29:14 GMT loopback-datasource-juggler deprecated Model hook "User.beforeSave" is deprecated, use Operation hooks instead. http://docs.strongloop.com/display/LB/Operation+hooks at node_modules/loopback-datasource-juggler/lib/dao.js:2141:12
09:29:14         ✓ should be triggered on save (396ms)
09:29:14         ✓ should save full object (155ms)
09:29:15         ✓ should save actual modifications to database (698ms)
09:29:15         ✓ should save actual modifications on updateAttributes (618ms)
09:29:16         ✓ beforeSave should be able to skip next (161ms)
09:29:16       update
09:29:16         ✓ should not be triggered on create
09:29:16         ✓ should not be triggered on new+save
09:29:16 Wed, 17 Jul 2019 13:29:16 GMT loopback-datasource-juggler deprecated Model hook "User.beforeUpdate" is deprecated, use Operation hooks instead. http://docs.strongloop.com/display/LB/Operation+hooks at node_modules/loopback-datasource-juggler/lib/dao.js:2888:16
09:29:16         ✓ should be triggered on updateAttributes (748ms)
09:29:17 Wed, 17 Jul 2019 13:29:17 GMT loopback-datasource-juggler deprecated Model hook "User.beforeUpdate" is deprecated, use Operation hooks instead. http://docs.strongloop.com/display/LB/Operation+hooks at node_modules/loopback-datasource-juggler/lib/dao.js:2142:14
09:29:17         ✓ should be triggered on save (407ms)
09:29:17         ✓ should update limited set of fields (157ms)
09:29:17         ✓ should not trigger after-hook on failed save (165ms)
09:29:17       destroy
09:29:17 Wed, 17 Jul 2019 13:29:17 GMT loopback-datasource-juggler deprecated Model hook "User.beforeDestroy" is deprecated, use Operation hooks instead. http://docs.strongloop.com/display/LB/Operation+hooks at node_modules/loopback-datasource-juggler/lib/dao.js:2472:14
09:29:17         ✓ should be triggered on destroy (322ms)
09:29:18         ✓ should not trigger after-hook on failed destroy (160ms)
09:29:18       lifecycle
09:29:18 Wed, 17 Jul 2019 13:29:18 GMT loopback-datasource-juggler deprecated Model hook "User.beforeValidate" is deprecated, use Operation hooks instead. http://docs.strongloop.com/display/LB/Operation+hooks at node_modules/loopback-datasource-juggler/lib/validations.js:542:8
09:29:18         ✓ should describe create sequence (161ms)
09:29:18         ✓ should describe new+save sequence (151ms)
09:29:18         ✓ should describe updateAttributes sequence (171ms)
09:29:18         ✓ should describe isValid sequence
09:29:18         ✓ should describe destroy sequence (155ms)
09:29:18     relations
09:29:18       hasMany
09:29:20         ✓ can be declared in different ways (1126ms)
09:29:21         ✓ can be declared in short form (727ms)
09:29:21         with scope
09:29:21           ✓ should build record on scope (341ms)
09:29:22           ✓ should create record on scope (334ms)
09:29:22           ✓ should not update FK (575ms)
09:29:23           ✓ should create record on scope with promises (321ms)
09:29:23           ✓ should create a batch of records on scope (484ms)
09:29:24           ✓ should create a batch of records on scope with promises (473ms)
09:29:24           ✓ should fetch all scoped instances (643ms)
09:29:25           ✓ should fetch all scoped instances with promises (638ms)
09:29:26           ✓ should fetch all scoped instances with find() with callback and condition (798ms)
09:29:27           ✓ should fetch all scoped instances with find() with callback and no condition (790ms)
09:29:27           ✓ should find scoped record (786ms)
09:29:28           ✓ should find scoped record with promises (792ms)
09:29:29           ✓ should count scoped records - all and filtered (951ms)
09:29:30           ✓ should count scoped records - all and filtered with promises (950ms)
09:29:30           ✓ should set targetClass on scope property
09:29:31           ✓ should update scoped record (797ms)
09:29:32           ✓ should update scoped record with promises (786ms)
09:29:32           ✓ should destroy scoped record (787ms)
09:29:33           ✓ should destroy scoped record with promises (786ms)
09:29:34           ✓ should check existence of a scoped record (790ms)
09:29:35           ✓ should check existence of a scoped record with promises (784ms)
09:29:35           ✓ should check ignore related data on creation - array (158ms)
09:29:35           ✓ should check ignore related data on creation with promises - array (161ms)
09:29:35           ✓ should check ignore related data on creation - object (166ms)
09:29:35           ✓ should check ignore related data on creation with promises - object (163ms)
09:29:35       hasMany through
09:29:37         ✓ should build record on scope (334ms)
09:29:38         ✓ should create record on scope (806ms)
09:29:39         ✓ should create record on scope with promises (800ms)
09:29:41         ✓ should create multiple records on scope (1034ms)
09:29:43         ✓ should create multiple records on scope with promises (1034ms)
09:29:45         ✓ should fetch all scoped instances (1580ms)
09:29:47         ✓ should fetch all scoped instances with promises (1590ms)
09:29:49         ✓ should find scoped record (1908ms)
09:29:51         ✓ should find scoped record with promises (1988ms)
09:29:54         ✓ should allow to use include syntax on related data (1704ms)
09:29:56         ✓ should allow to use include syntax on related data with promises (1837ms)
09:29:57         ✓ should set targetClass on scope property
09:29:59         ✓ should update scoped record (1532ms)
09:30:01         ✓ should update scoped record with promises (1519ms)
09:30:02         ✓ should destroy scoped record (1315ms)
09:30:04         ✓ should destroy scoped record with promises (1395ms)
09:30:07         ✓ should check existence of a scoped record (1840ms)
09:30:09         ✓ should check existence of a scoped record with promises (1934ms)
09:30:10         ✓ should allow to add connection with instance (717ms)
09:30:12         ✓ should allow to add connection with instance with promises (885ms)
09:30:13         ✓ should allow to add connection with through data (797ms)
09:30:14         ✓ should allow to add connection with through data with promises (653ms)
09:30:16         ✓ should allow to remove connection with instance (967ms)
09:30:17         ✓ should allow to remove connection with instance with promises (958ms)
09:30:17         fetch scoped instances with paging filters
09:30:17           with filter skip
09:30:20             ✓ skips the first patient (487ms)
09:30:20           with filter order
09:30:22             ✓ orders the result by patient name (476ms)
09:30:22           with filter limit
09:30:25             ✓ limits to 1 result (494ms)
09:30:25           with filter fields
09:30:28             ✓ includes field 'name' but not 'age' (548ms)
09:30:28           with filter include
09:30:31             ✓ returns physicians included in patient (859ms)
09:30:31           with filter where
09:30:33             ✓ returns patient where id equal to samplePatientId (482ms)
09:30:36             ✓ returns patient where name equal to samplePatient name (493ms)
09:30:39             ✓ returns patients where id in an array (969ms)
09:30:42             ✓ returns empty result when patientId does not belongs to physician (480ms)
09:30:42           findById with filter include
09:30:44             ✓ returns patient where id equal to 'samplePatientId'with included physicians (643ms)
09:30:44           findById with filter fields
09:30:47             ✓ returns patient where id equal to 'samplePatientId'with field 'name' but not 'age' (371ms)
09:30:47           findById with include filter that contains string fields
09:30:50             ✓ should accept string and convert it to array (497ms)
09:30:50         find over related model with options
09:30:52           ✓ should find be filtered from option (2134ms)
09:30:52       hasMany through - collect
09:30:52         with default options
09:30:53           ✓ can determine the collect by modelTo's name as default
09:30:53         when custom reverse belongsTo names for both sides
09:30:54           ✓ can determine the collect via keyThrough
09:30:54           ✓ can determine the collect via modelTo name
09:30:55           ✓ can determine the collect via modelTo name (with jams)
09:30:55         when custom reverse belongsTo name for one side only
09:30:56           ✓ can determine the collect via model name
09:30:56           ✓ can determine the collect via keyThrough
09:30:56       hasMany through - customized relation name and foreign key
09:30:57         ✓ should use real target class
09:30:57       hasMany through bi-directional relations on the same model
09:30:57         ✓ should set foreignKeys of through model correctly in first relation (349ms)
09:30:57         ✓ should set foreignKeys of through model correctly in second relation (164ms)
09:30:57       hasMany through - between same models
09:30:58         ✓ should set the keyThrough and the foreignKey (335ms)
09:30:58         ✓ can determine the collect via keyThrough for each side
09:30:58       hasMany with properties
09:30:59         ✓ should create record on scope (348ms)
09:30:59         ✓ should create record on scope with promises (321ms)
09:30:59       hasMany with scope and properties
09:31:00         ✓ can be declared with properties (609ms)
09:31:00         ✓ should create record on scope (496ms)
09:31:01         ✓ should create record on scope with promises (484ms)
09:31:01         ✓ should find records on scope (317ms)
09:31:02         ✓ should find records on scope with promises (317ms)
09:31:02         ✓ should find record on scope - filtered (308ms)
09:31:02         ✓ should find record on scope with promises - filtered (318ms)
09:31:03         ✓ should create record on scope - properties (314ms)
09:31:03         ✓ should find records on scope (316ms)
09:31:03         ✓ should find record on scope - scoped (308ms)
09:31:03         ✓ should find record on scope - scoped (318ms)
09:31:04         ✓ should find count of records on scope - scoped (307ms)
09:31:04         ✓ should delete records on scope - scoped (331ms)
09:31:04         ✓ should find record on scope - verify (305ms)
09:31:04       relations validation
09:31:04         ✓ rejects belongsTo relation if `model` is not provided
09:31:04         ✓ rejects polymorphic belongsTo relation if `model` is provided
09:31:04         ✓ rejects polymorphic non belongsTo relation if `model` is not provided
09:31:04         ✓ rejects polymorphic relation if `foreignKey` is provided but discriminator is missing
09:31:04         ✓ rejects polymorphic relation if `discriminator` is provided but foreignKey is missing
09:31:04         ✓ rejects polymorphic relation if `polymorphic.as` is provided along with custom foreignKey/discriminator
09:31:04         ✓ rejects polymorphic relation if `polymorphic.selector` is provided along with custom foreignKey/discriminator
09:31:04         ✓ warns on use of deprecated `polymorphic.as` keyword in polymorphic relation
09:31:04       polymorphic hasOne
09:31:06         ✓ can be declared using default polymorphic selector (437ms)
09:31:06         ✓ should create polymorphic relation - Article (497ms)
09:31:07         ✓ should create polymorphic relation with promises - article (617ms)
09:31:07         ✓ should create polymorphic relation - reader (587ms)
09:31:08         ✓ should find polymorphic relation - article (397ms)
09:31:08         ✓ should find polymorphic relation - employee (372ms)
09:31:08         ✓ should include polymorphic relation - article (320ms)
09:31:09         ✓ should find polymorphic relation with promises - employee (373ms)
09:31:09         ✓ should find inverse polymorphic relation - article (394ms)
09:31:10         ✓ should include inverse polymorphic relation - article (336ms)
09:31:10         ✓ should find inverse polymorphic relation - employee (313ms)
09:31:10       polymorphic hasOne with non standard ids
09:31:11         ✓ can be declared using custom foreignKey/discriminator (450ms)
09:31:11         ✓ should create polymorphic relation - article (498ms)
09:31:12         ✓ should create polymorphic relation with promises - article (476ms)
09:31:12         ✓ should create polymorphic relation - employee (481ms)
09:31:13         ✓ should find polymorphic relation - article (364ms)
09:31:13         ✓ should find polymorphic relation - employee (324ms)
09:31:13         ✓ should find inverse polymorphic relation - article (329ms)
09:31:14         ✓ should find inverse polymorphic relation - employee (343ms)
09:31:14         ✓ should include polymorphic relation - employee (367ms)
09:31:15         ✓ should include inverse polymorphic relation - employee (325ms)
09:31:15       polymorphic hasMany
09:31:15         ✓ can be declared with model JSON definition when related model is already attached
09:31:15         ✓ can be declared with model JSON definition when related model is not yet attached
09:31:16         ✓ can be declared using default polymorphic selector (676ms)
09:31:16         ✓ should create polymorphic relation - article (356ms)
09:31:17         ✓ should create polymorphic relation - employee (533ms)
09:31:17         ✓ should find polymorphic items - article (335ms)
09:31:17         ✓ should find polymorphic items - employee (314ms)
09:31:18         ✓ should find the inverse of polymorphic relation - article (329ms)
09:31:18         ✓ should find the inverse of polymorphic relation - employee (313ms)
09:31:18         ✓ should include the inverse of polymorphic relation (428ms)
09:31:18         - [UNSUPPORTED] - should include the inverse of polymorphic relation w/o adhocSort
09:31:19         ✓ should assign a polymorphic relation (384ms)
09:31:19         ✓ should find polymorphic items - article (314ms)
09:31:20         ✓ should find the inverse of polymorphic relation - article (364ms)
09:31:20         ✓ should include the inverse of polymorphic relation - article (308ms)
09:31:20         ✓ can be declared using custom foreignKey/discriminator (415ms)
09:31:20       polymorphic hasAndBelongsToMany through
09:31:22         ✓ can be declared using default polymorphic selector (1108ms)
09:31:22         ✓ can determine the collect via modelTo name
09:31:23         ✓ should create polymorphic relation - article (1161ms)
09:31:24         ✓ should create polymorphic relation - employee (636ms)
09:31:24         ✓ should create polymorphic through model (310ms)
09:31:25         ✓ should get polymorphic relation through model - article (519ms)
09:31:25         ✓ should get polymorphic relation through model - employee (540ms)
09:31:26         ✓ should include polymorphic items (488ms)
09:31:27         ✓ should add to a polymorphic relation - article (738ms)
09:31:27         ✓ should create polymorphic through model (173ms)
09:31:27         ✓ should add to a polymorphic relation - article (475ms)
09:31:28         ✓ should add to a polymorphic relation - article (476ms)
09:31:28         ✓ should get the inverse polymorphic relation - article (490ms)
09:31:29         ✓ should get the inverse polymorphic relation - reader (520ms)
09:31:29         ✓ should find polymorphic items - article (500ms)
09:31:30         ✓ should check if polymorphic relation exists - article (325ms)
09:31:30         ✓ should remove from a polymorphic relation - article (315ms)
09:31:30         ✓ should find polymorphic items - article (465ms)
09:31:31         ✓ should check if polymorphic relation exists - article (314ms)
09:31:31         ✓ should create polymorphic item through relation scope (655ms)
09:31:32         ✓ should create polymorphic through model - new article (174ms)
09:31:32         ✓ should find polymorphic items - new article (478ms)
09:31:32         ✓ should use author_pictures as modelThrough
09:31:33         ✓ can be declared using custom foreignKey/discriminator (861ms)
09:31:33       belongsTo
09:31:33         ✓ can be declared in different ways
09:31:33         ✓ should setup a custom method on accessor
09:31:33         ✓ should have setup a custom method on accessor
09:31:34         ✓ can be used to query data (1099ms)
09:31:34         ✓ can be used to query data with get() with callback (477ms)
09:31:35         ✓ can be used to query data with promises (471ms)
09:31:35         ✓ could accept objects when creating on scope (334ms)
09:31:36         ✓ should update related item on scope (500ms)
09:31:36         ✓ should not update related item FK on scope (342ms)
09:31:36         ✓ should get related item on scope (372ms)
09:31:37         ✓ should destroy related item on scope (563ms)
09:31:37         ✓ should get related item on scope - verify (163ms)
09:31:37         ✓ should not have deleted related item (155ms)
09:31:38         ✓ should allow to create belongsTo model in beforeCreate hook (328ms)
09:31:38         ✓ should allow to create belongsTo model in beforeCreate hook with promises (322ms)
09:31:38       belongsTo with scope
09:31:38         ✓ can be declared with scope and properties (518ms)
09:31:39         ✓ should create record on scope (346ms)
09:31:39         ✓ should find record on scope (328ms)
09:31:39         ✓ should create record on scope with promises (317ms)
09:31:40         ✓ should find record on scope with promises (316ms)
09:31:40       belongsTo with embed
09:31:40         - can be declared with embed and properties
09:31:40         - should create record with embedded data
09:31:40         - should find record with embedded data
09:31:40         - should find record with embedded data with promises
09:31:40       hasOne
09:31:40         ✓ can be declared using hasOne method
09:31:40         ✓ should setup a custom method on accessor
09:31:40         ✓ should have setup a custom method on accessor
09:31:41         ✓ can be used to query data (763ms)
09:31:42         ✓ can be used to query data with get() with callback (1073ms)
09:31:43         ✓ can be used to query data with promises (1206ms)
09:31:43         ✓ should set targetClass on scope property
09:31:43         ✓ should update the related item on scope (481ms)
09:31:44         ✓ should not update the related item FK on scope (317ms)
09:31:44         ✓ should update the related item on scope with promises (524ms)
09:31:45         ✓ should error trying to change the foreign key in the update (499ms)
09:31:45         ✓ should update the related item on scope with same foreign key (633ms)
09:31:46         ✓ should get the related item on scope (316ms)
09:31:46         ✓ should get the related item on scope with promises (326ms)
09:31:46         ✓ should destroy the related item on scope (517ms)
09:31:47         ✓ should destroy the related item on scope with promises (676ms)
09:31:47         ✓ should get the related item on scope - verify (319ms)
09:31:48         ✓ should get the related item on scope with promises - verify (310ms)
09:31:48         ✓ should have deleted related item (282ms)
09:31:48       hasOne with scope
09:31:49         ✓ can be used to query data (1207ms)
09:31:50         ✓ should include record that matches scope (317ms)
09:31:50         ✓ should not find record that does not match scope (488ms)
09:31:51         ✓ should not include record that does not match scope (471ms)
09:31:52         ✓ can be used to query data with promises (1014ms)
09:31:52         ✓ should find record that match scope with promises (517ms)
09:31:52       hasOne with non standard id
09:31:52         ✓ can be declared with non standard foreignKey
09:31:53         ✓ can be used to query data (1072ms)
09:31:54         ✓ should destroy the related item on scope (485ms)
09:31:54         ✓ should get the related item on scope - verify (336ms)
09:31:54         ✓ should have deleted related item (154ms)
09:31:54       hasOne with primaryKey different from model PK
09:31:54         ✓ relation can be declared with primaryKey
09:31:55         ✓ can be used to query data (808ms)
09:31:55         ✓ should destroy the related item on scope (480ms)
09:31:56         ✓ should get the related item on scope - verify (312ms)
09:31:56       hasMany with primaryKey different from model PK
09:31:56         ✓ relation can be declared with primaryKey
09:31:57         ✓ can be used to query employees for boss (885ms)
09:31:58         ✓ can be used to query employees for boss2 (890ms)
09:31:58       belongsTo with primaryKey different from model PK
09:31:58         ✓ relation can be declared with primaryKey
09:31:59         ✓ can be used to query data (1257ms)
09:31:59       hasAndBelongsToMany
09:31:59         ✓ can be declared (535ms)
09:32:00         ✓ should allow to create instances on scope (987ms)
09:32:01         ✓ should allow to fetch scoped instances (477ms)
09:32:02         ✓ should destroy all related instances (957ms)
09:32:02         ✓ should allow to add connection with instance (649ms)
09:32:03         ✓ should allow to remove connection with instance (987ms)
09:32:05         ✓ should allow to create instances on scope with promises (1459ms)
09:32:05         ✓ should allow to fetch scoped instances with promises (477ms)
09:32:06         ✓ should allow to add connection with instance with promises (631ms)
09:32:07         ✓ should allow to remove connection with instance with promises (667ms)
09:32:07         ✓ should set targetClass on scope property
09:32:08         ✓ should apply inclusion fields to the target model (1185ms)
09:32:09         ✓ should apply inclusion where to the target model (1578ms)
09:32:09       embedsOne
09:32:10         ✓ can be declared using embedsOne method (336ms)
09:32:10         ✓ should have setup a property and accessor
09:32:10         ✓ respects property options on the embedded property
09:32:10         ✓ should setup a custom method on accessor
09:32:10         ✓ should have setup a custom method on accessor
09:32:10         ✓ should behave properly without default or being set (160ms)
09:32:10         ✓ should return an instance with default values
09:32:10         ✓ should embed a model instance
09:32:10         ✓ should not embed an invalid model type
09:32:10         ✓ should create an embedded item on scope (338ms)
09:32:10         ✓ should get an embedded item on scope (157ms)
09:32:10         ✓ should validate an embedded item on scope - on creation
09:32:11         ✓ should validate an embedded item on scope - on update (150ms)
09:32:11         ✓ should update an embedded item on scope (406ms)
09:32:11         ✓ should get an embedded item on scope - verify (159ms)
09:32:11         ✓ should destroy an embedded item on scope (389ms)
09:32:12         ✓ should get an embedded item on scope - verify (165ms)
09:32:12         ✓ should save an unsaved model (166ms)
09:32:12         ✓ should create an embedded item on scope with promises (323ms)
09:32:12         ✓ should get an embedded item on scope with promises (163ms)
09:32:12         ✓ should validate an embedded item on scope with promises - on creation
09:32:12         ✓ should validate an embedded item on scope with promises - on update (158ms)
09:32:13         ✓ should update an embedded item on scope with promises (397ms)
09:32:13         ✓ should get an embedded item on scope with promises - verify (159ms)
09:32:13         ✓ should destroy an embedded item on scope with promises (386ms)
09:32:14         ✓ should get an embedded item on scope with promises - verify (156ms)
09:32:14         ✓ should also save changes when directly saving the embedded model (634ms)
09:32:15         ✓ should delete the embedded document and also update parent (550ms)
09:32:15       embedsOne - persisted model
09:32:15         ✓ can be declared using embedsOne method
09:32:15         ✓ should create an item - to offset id
09:32:15         ✓ should create an embedded item on scope
09:32:15         ✓ should create an embedded item on scope with promises
09:32:15       embedsOne - generated id
09:32:15         ✓ can be declared using embedsOne method
09:32:15         ✓ should create an embedded item on scope
09:32:15       embedsMany
09:32:15         ✓ can be declared
09:32:15         ✓ should have setup embedded accessor/scope
09:32:15         ✓ should create embedded items on scope
09:32:15         ✓ respects property options on the embedded property
09:32:15         ✓ should create embedded items on scope
09:32:15         ✓ should return embedded items from scope
09:32:15         ✓ should filter embedded items on scope
09:32:15         ✓ should validate embedded items
09:32:15         ✓ should find embedded items by id
09:32:15         ✓ should check if item exists
09:32:15         ✓ should update embedded items by id
09:32:17         ✓ should validate the update of embedded items
09:32:17         ✓ should find embedded items by id - verify
09:32:17         ✓ should have accessors: at, get, set
09:32:17         ✓ should remove embedded items by id
09:32:17         ✓ should have removed embedded items - verify
09:32:17         ✓ should pass options when removed by id
09:32:17         ✓ should pass options when removed by where
09:32:17         ✓ should create embedded items on scope
09:32:17         ✓ should remove embedded items - filtered
09:32:17         ✓ should remove all embedded items
09:32:17         ✓ should have removed all embedded items - verify
09:32:17         ✓ should save an unsaved model
09:32:17       embedsMany - omit default value for embedded item
09:32:17         ✓ can be declared
09:32:17         ✓ should not set default value for embedded item
09:32:17         ✓ should create embedded items on scope
09:32:17         ✓ should build embedded items
09:32:17         ✓ should not create embedded from attributes - relation name
09:32:17       embedsMany - numeric ids + forceId
09:32:17         ✓ can be declared
09:32:17         ✓ should create embedded items on scope
09:32:17       embedsMany - explicit ids
09:32:17         ✓ can be declared
09:32:17         ✓ should create embedded items on scope
09:32:17         ✓ should find embedded items by id
09:32:17         ✓ should check for duplicate ids
09:32:17         ✓ should update embedded items by id
09:32:17         ✓ should remove embedded items by id
09:32:17         ✓ should have embedded items - verify
09:32:17         ✓ should validate all embedded items
09:32:17         ✓ should build embedded items
09:32:17         ✓ should have embedded items - verify
09:32:17         ✓ should have accessors: at, get, set
09:32:17         ✓ should create embedded from attributes - property name
09:32:17         ✓ should not create embedded from attributes - relation name
09:32:17         ✓ should create embedded items with auto-generated id
09:32:17       embedsMany - persisted model
09:32:17         ✓ can be declared
09:32:17         ✓ should create individual items (0)
09:32:17         ✓ should create individual items (1)
09:32:17         ✓ should create individual items (2)
09:32:17         ✓ should create individual items (3)
09:32:17         ✓ should add embedded items on scope
09:32:17         ✓ should create embedded items on scope
09:32:17         ✓ should have embedded items on scope
09:32:17         ✓ should validate embedded items on scope - id
09:32:17         ✓ should validate embedded items on scope - street
09:32:17       embedsMany - relations, scope and properties
09:32:17         ✓ can be declared
09:32:17         ✓ should setup related items
09:32:17         ✓ should associate items on scope
09:32:17         ✓ should include related items on scope
09:32:17         ✓ should remove embedded items by id
09:32:17         ✓ should find items on scope
09:32:17         ✓ should add related items to scope
09:32:17         ✓ should find items on scope
09:32:17         ✓ should remove embedded items by reference id
09:32:17         ✓ should have removed embedded items by reference id
09:32:17         ✓ should create items on scope
09:32:17         ✓ should find items on scope
09:32:17         ✓ should update items on scope - and save parent
09:32:17         ✓ should find items on scope - verify update
09:32:17         ✓ should remove items from scope - and save parent
09:32:17         ✓ should find items on scope - verify destroy
09:32:17       embedsMany - polymorphic relations
09:32:17         ✓ can be declared
09:32:17         ✓ should setup related items
09:32:17         ✓ should create items on scope
09:32:17         ✓ should include related items on scope
09:32:17         - [UNSUPPORTED] - should include nested related items on scope
09:32:17       referencesMany
09:32:17         ✓ can be declared
09:32:17         ✓ should setup test records
09:32:17         ✓ should create record on scope
09:32:17         ✓ should not allow duplicate record on scope
09:32:17         ✓ should find items on scope
09:32:17         ✓ should find items on scope - findById
09:32:17         ✓ should check if a record exists on scope
09:32:17         ✓ should update a record on scope
09:32:17         ✓ should get a record by index - at
09:32:17         ✓ should add a record to scope - object
09:32:17         ✓ should add a record to scope - object
09:32:17         ✓ should find items on scope - findById
09:32:17         ✓ should find items on scope - filter
09:32:17         ✓ should remove items from scope
09:32:17         ✓ should find items on scope - verify
09:32:17         ✓ should find items on scope and ordered them by name DESC
09:32:17         ✓ should allow custom scope methods - reverse
09:32:17         - [UNSUPPORTED] - should allow custom scope methods - reverse
09:32:17         - [UNSUPPORTED] - should include related items from scope
09:32:17         ✓ should destroy items from scope - destroyById
09:32:17         ✓ should find items on scope - verify
09:32:17         ✓ should setup test records with promises
09:32:17         ✓ should create record on scope with promises
09:32:17         ✓ should not allow duplicate record on scope with promises
09:32:17         ✓ should find items on scope with promises
09:32:17         - [UNSUPPORTED] - should find items on scope with promises
09:32:17         ✓ should find items on scope with promises - findById
09:32:17         ✓ should check if a record exists on scope with promises
09:32:17         ✓ should update a record on scope with promises
09:32:17         ✓ should get a record by index with promises - at
09:32:17         ✓ should add a record to scope with promises - object
09:32:17         ✓ should add a record to scope with promises - object
09:32:17         ✓ should find items on scope with promises - findById
09:32:17         ✓ should find items on scope with promises - filter
09:32:17         ✓ should remove items from scope with promises
09:32:17         ✓ should find items on scope with promises - verify
09:32:17         ✓ should find items on scope and ordered them by name DESC
09:32:17         ✓ should allow custom scope methods with promises - reverse
09:32:17         - [UNSUPPORTED] - should include related items from scope with promises
09:32:17         ✓ should destroy items from scope with promises - destroyById
09:32:17         ✓ should find items on scope with promises - verify
09:32:17       custom relation/scope methods
09:32:17         ✓ can be declared
09:32:17         ✓ should setup test records
09:32:17         ✓ should allow custom scope methods - summarize
09:32:17         ✓ should allow custom scope methods with promises - summarize
09:32:17       relation names
09:32:17         ✓ throws error when a relation name is `trigger`
09:32:17     include
09:32:24       ✓ should fetch belongsTo relation (329ms)
09:32:24       ✓ does not return included item if FK is excluded (159ms)
09:32:25       ✓ should fetch hasMany relation (325ms)
09:32:25       ✓ should report errors if the PK is excluded (162ms)
09:32:25       ✓ should not have changed the __strict flag of the model (308ms)
09:32:26       ✓ should not save in db included models, in query returned models (573ms)
09:32:26       ✓ should fetch Passport - Owner - Posts (477ms)
09:32:27       ✓ should fetch Passport - Owner - empty Posts (479ms)
09:32:27       ✓ should fetch Passport - Owner - Posts - alternate syntax (466ms)
09:32:28       ✓ should fetch Passports - User - Posts - User (620ms)
09:32:28       ✓ should fetch Passports with include scope on Posts (631ms)
09:32:29       ✓ should support limit (694ms)
09:32:30       ✓ should support limit - no sort (708ms)
09:32:30       ✓ should fetch Users with include scope on Posts - belongsTo (316ms)
09:32:30       - [UNSUPPORTED] - should fetch Users with include scope on Posts - belongsTo - no sort
09:32:30       ✓ should fetch Users with include scope on Posts - hasMany (310ms)
09:32:31       ✓ should fetch User - Posts AND Passports (390ms)
09:32:31       ✓ should fetch User - Posts AND Passports in relation syntax (411ms)
09:32:31       ✓ should not fetch User - AccessTokens (158ms)
09:32:33       ✓ should support hasAndBelongsToMany (1726ms)
09:32:33       ✓ should fetch User - Profile (HasOne) (336ms)
09:32:34       ✓ should not throw on fetch User if include is boolean equals true (158ms)
09:32:34       ✓ should not throw on fetch User if include is number (158ms)
09:32:34       ✓ should not throw on fetch User if include is symbol (166ms)
09:32:34       ✓ should not throw on fetch User if include is function (157ms)
09:32:35       ✓ should support include scope on hasAndBelongsToMany (473ms)
09:32:35       ✓ should save related items separately (869ms)
09:32:37       ✓ should support disableInclude for hasAndBelongsToMany (1485ms)
09:32:37       inq limit
09:32:38         ✓ should support include by pagination (858ms)
09:32:38       findWithForeignKeysByPage
09:32:38         filter
09:32:38           ✓ works when using a `where` with a foreign key (326ms)
09:32:38           ✓ works when using a `where` with `and` (328ms)
09:32:39           ✓ works when using `where` with `limit` (311ms)
09:32:39           ✓ works when using `where` with `skip` (312ms)
09:32:39           ✓ works when using `where` with `offset` (307ms)
09:32:40           ✓ works when using `where` without `limit`, `skip` or `offset` (314ms)
09:32:40         pagination
09:32:40           ✓ works with the default page size (0) and `inqlimit` is exceeded (508ms)
09:32:40           ✓ works when page size is set to 0 (325ms)
09:32:40         relations
09:32:41           ✓ works when hasOne is called (313ms)
09:32:41           ✓ does not return included item if hasOne is missing the id property (160ms)
09:32:41           ✓ works when hasMany is called (316ms)
09:32:44           ✓ works when hasManyThrough is called (2265ms)
09:32:44           ✓ works when belongsTo is called (314ms)
09:32:44       [UNSUPPORTED] - findWithForeignKeysByPage
09:32:44         filter
09:32:44           - works when using a `where` with a foreign key
09:32:44           - works when using a `where` with `and`
09:32:44           - works when using `where` with `limit`
09:32:44           - works when using `where` with `skip`
09:32:44           - works when using `where` with `offset`
09:32:44           - works when using `where` without `limit`, `skip` or `offset`
09:32:44         pagination
09:32:44           - works with the default page size (0) and `inqlimit` is exceeded
09:32:44           - works when page size is set to 0
09:32:44         relations
09:32:44           - works when hasOne is called
09:32:44           - works when hasMany is called
09:32:44           - works when hasManyThrough is called
09:32:44           - works when belongsTo is called
09:32:44       performance
09:32:44         ✓ including belongsTo should make only 2 db calls (341ms)
09:32:46         ✓ including hasManyThrough should make only 3 db calls (2032ms)
09:32:47         ✓ including hasMany should make only 3 db calls (438ms)
09:32:47         ✓ should not make n+1 db calls in relation syntax (406ms)
09:32:47     Model instance with included relation .toJSON()
09:32:47       ✓ should recursively serialize objects
09:32:47 
09:32:47 
09:32:47   699 passing (6m)
09:32:47   61 pending
09:32:47 
09:32:49 
09:32:49 > [email protected] posttest /home/jenkins/workspace/nb/loopback-connector-dashdb~master/37975cf6
09:32:49 > npm run lint
09:32:49 
09:32:49 
09:32:49 > [email protected] lint /home/jenkins/workspace/nb/loopback-connector-dashdb~master/37975cf6
09:32:49 > eslint .
09:32:49 
09:32:51 Archiving artifacts
09:32:51 [Cobertura] Publishing Cobertura coverage report...
09:32:51 
09:32:51 [Cobertura] No coverage results were found using the pattern '**/cobertura-coverage.xml' relative to '/home/jenkins/workspace/nb/loopback-connector-dashdb~master/37975cf6'.  Did you enter a pattern relative to the correct directory?  Did you generate the XML report(s) for Cobertura?
09:32:51 
09:32:51 [Cobertura] Skipped cobertura reports.
09:32:51 
09:32:52 Finished: SUCCESS

@emonddr emonddr closed this as completed Jul 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants