escape sqlite query parameters
✔ should transform boolean parameters with value `true` into `1`
✔ should transform boolean parameters with value `false` into `0`
✔ should transform boolean nativeParameters with value `true` into `1`
✔ should transform boolean nativeParameters with value `false` into 0
option nativeBinding for better-sqlite3
✔ should use a the path set in nativeBindings to the node file
driver > convert raw results to entity
✓ supports transactions (199ms)
✔ should return null value in entity property when record column is null
✔ should return true in entity property when record column is true
✓ does not have any labels assigned to it initially
✔ should return false in entity property when record column is false
DriverUtils
parse mongo url
✔ should return a mongo url with a replica set
✔ should return a mongo url without a replica set
postgres specific options
✔ should set application_name
embedded > basic functionality
✔ should insert, load, update and remove entities with embeddeds properly
other issues > entity listeners must work in embeddeds as well
✓ answers true if the label has been assigned
✔ getters and setters should work correctly
embedded > embedded-many-to-many-case1
owner side
✓ answers correctly if the label has been assigned when passing a primary key instead of an object
hasAssociations
✓ supports transactions (190ms)
✔ should insert, load, update and remove entities with embeddeds when embedded entity having ManyToMany relation (61ms)
inverse side
✓ answers false if only some labels have been assigned
✓ answers false if only some labels have been assigned when passing a primary key instead of an object
✔ should insert, load, update and remove entities with embeddeds when embedded entity having ManyToMany relation (58ms)
embedded > embedded-many-to-many-case2
owner side
✓ answers true if all label have been assigned
✔ should insert, load, update and remove entities with embeddeds when embedded entity having ManyToMany relation (66ms)
inverse side
✓ answers true if all label have been assigned when passing a primary key instead of an object
setAssociations
✓ supports transactions (90ms)
✔ should insert, load, update and remove entities with embeddeds when embedded entity having ManyToMany relation (58ms)
embedded > embedded-many-to-many-case3
✓ clears associations when passing null to the set-method (98ms)
PASS src/__tests__/integration/tidb/runtime.test.ts (17.973 s)
Test Suites: 2 passed, 2 total
Tests: 130 passed, 130 total
Snapshots: 130 passed, 130 total
Time: 39.651 s
prisma-4.16.x end
[Pipeline] }
Cache not saved (ws/jenkins-pingcap-tidb-merged_integration_nodejs_test-1168/tidb-test already exists)
[Pipeline] // cache
[Pipeline] }
owner side
[Pipeline] // dir
✓ supports passing the primary key instead of an object (99ms)
addAssociations
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // container
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // node
[Pipeline] }
✓ supports transactions (98ms)
✓ supports passing the primary key instead of an object (93ms)
[Pipeline] // podTemplate
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
addMultipleAssociations
✓ adds associations without removing the current ones (104ms)
✔ should insert, load, update and remove entities with embeddeds when embedded entity having ManyToMany relation with multiple primary keys (one PK in each embed) (58ms)
inverse side
✓ handles decent sized bulk creates (209ms)
createAssociations
✔ should insert, load, update and remove entities with embeddeds when embedded entity having ManyToMany relation with multiple primary keys (one PK in each embed) (62ms)
embedded > embedded-many-to-many-case4
owner side
✓ creates a new associated object (102ms)
✔ should insert, load, update and remove entities with embeddeds when embedded entity having ManyToMany relation with multiple primary keys (multiple keys in related entity) (55ms)
inverse side
✓ creates the object with the association directly (102ms)
✓ supports transactions (102ms)
✔ should insert, load, update and remove entities with embeddeds when embedded entity having ManyToMany relation with multiple primary keys (multiple keys in related entity) (57ms)
embedded > embedded-many-to-many-case5
owner side
✓ supports passing the field option (95ms)
getting assocations with options
✔ should insert, load, update and remove entities with embeddeds when embedded entity having ManyToMany relation with multiple primary keys (multiple keys in both sides) (53ms)
inverse side
✓ should treat the where object of associations as a first class citizen (308ms)
✓ gets all associated objects when no options are passed
✔ should insert, load, update and remove entities with embeddeds when embedded entity having ManyToMany relation with multiple primary keys (multiple keys in both sides) (63ms)
embedded > embedded-many-to-one-case1
owner side
✓ only get objects that fulfill the options
countAssociations
✓ should count all associations
✓ should count filtered associations
✓ should count scoped associations
thisAssociations
✓ should work with alias (49ms)
foreign key constraints
1:m
✓ sets null by default (100ms)
✓ sets to CASCADE if allowNull: false (97ms)
✓ should be possible to remove all constraints (89ms)
✓ can cascade deletes (106ms)
✓ can cascade updates (104ms)
✓ can restrict deletes (92ms)
✔ should insert, load, update and remove entities with embeddeds when embedded entity having ManyToOne relation (40ms)
inverse side
✓ can restrict updates (95ms)
Association options
✓ should setup underscored field with foreign keys when using underscored
✓ should use model name when using camelcase
✓ can specify data type for auto-generated relational keys (109ms)
✓ infers the keyType if none provided (89ms)
✓ should throw an error if foreignKey and as result in a name clash
(node:719) [SEQUELIZE0005] DeprecationWarning: Passing a double nested nested array to `group` is unsupported and will be removed in v6.
(Use `node --trace-deprecation ...` to show where the warning was created)
✓ should ignore group from ancestor on deep separated query (169ms)
allows the user to provide an attribute definition object as foreignKey
✓ works with a column that hasnt been defined before
✓ works when taking a column directly from the object
✓ works when merging with an existing definition
sourceKey
✔ should insert, load, update and remove entities with embeddeds when embedded entity having ManyToOne relation (38ms)
embedded > embedded-many-to-one-case2
owner side
✓ should use sourceKey
✔ should insert, load, update and remove entities with embeddeds when embedded entity having ManyToOne relation (41ms)
inverse side
✓ should count related records
✔ should insert, load, update and remove entities with embeddeds when embedded entity having ManyToOne relation (61ms)
embedded > embedded-many-to-one-case3
owner side
✓ should set right field when add relative
✔ should insert, load, update and remove entities with embeddeds when embedded entity having ManyToOne relation with multiple primary keys (one PK in each embed) (55ms)
inverse side
✓ should create with nested associated models
✔ should insert, load, update and remove entities with embeddeds when embedded entity having ManyToOne relation with multiple primary keys (one PK in each embed) (49ms)
embedded > embedded-many-to-one-case4
owner side
✔ should insert, load, update and remove entities with embeddeds when embedded entity having ManyToOne relation with multiple primary keys (multiple keys in related entity) (63ms)
inverse side
✓ should create nested associations with symmetric getters/setters on FK (1687ms)
sourceKey with where clause in include
✔ should insert, load, update and remove entities with embeddeds when embedded entity having ManyToOne relation with multiple primary keys (multiple keys in related entity) (59ms)
embedded > embedded-many-to-one-case5
owner side
✓ should use the specified sourceKey instead of the primary key
Eager loading
✓ should load with an alias (102ms)
✓ should load all (99ms)
[MYSQL] HasOne
Model.associations
✓ should store all associations when associating to the same table multiple times
get
multiple
✓ should fetch associations for multiple instances (108ms)
getAssociation
✓ supports transactions (111ms)
✓ should be able to handle a where object that's a first class citizen. (122ms)
✓ supports schemas (129ms)
setAssociation
✓ supports transactions (119ms)
✔ should insert, load, update and remove entities with embeddeds when embedded entity having ManyToOne relation with multiple primary keys (multiple keys in both sides) (46ms)
inverse side
✓ can set an association with predefined primary keys (112ms)
✓ clears the association if null is passed (104ms)
✓ should throw a ForeignKeyConstraintError if the associated record does not exist (100ms)
✓ supports passing the primary key instead of an object (104ms)
✓ supports updating with a primary key instead of an object (106ms)
✓ supports setting same association twice (99ms)
createAssociation
✓ creates an associated model instance (108ms)
✔ should insert, load, update and remove entities with embeddeds when embedded entity having ManyToOne relation with multiple primary keys (multiple keys in both sides) (58ms)
embedded > embedded-one-to-one
owner side
✓ supports transactions (112ms)
✔ should insert, load, update and remove entities with embeddeds when embedded entity having OneToOne relation (40ms)
inverse side
- should insert, load, update and remove entities with embeddeds when embedded entity having OneToOne relation
embedded > embedded-with-special-columns
foreign key
✓ should setup underscored field with foreign keys when using underscored
✓ should use model name when using camelcase
✓ should support specifying the field of a foreign key (106ms)
✓ should support custom primary key field name in sub queries (116ms)
foreign key constraints
✓ are enabled by default (114ms)
✓ sets to CASCADE if allowNull: false (104ms)
✔ should insert, load, update and remove entities with embeddeds when embeds contains special columns (e.g. CreateDateColumn, UpdateDateColumn, DeleteDateColumn, VersionColumn (1032ms)
embedded > multiple-primary-column
✔ should insert, load, update and remove entities with embeddeds when primary column defined in main and in embedded entities
embedded > multiple-primary-columns-with-nested-embed
✔ should insert, load, update and remove entities with embeddeds when primary column defined in main and in embedded entities
other issues > entity listeners must work in optional embeddeds as well
✔ getters and setters should work correctly
embedded > outer-primary-column
✓ should be possible to disable them (91ms)
✔ should insert, load, update and remove entities with embeddeds when primary column defined only in embedded entity
embedded > prefix functionality
✓ can cascade deletes (97ms)
✔ should insert, load, update and remove entities with embeddeds properly
entity-listeners
✔ beforeUpdate
entity-metadata > create
without entitySkipConstructor
✔ should call the constructor when creating an object
✔ should set the default property values
✔ should call the constructor when retrieving an object
with entitySkipConstructor
✔ should call the constructor when creating an object
✔ should set the default property values when creating an object
✔ should not call the constructor when retrieving an object
entity-metadata > property-map
✓ works when cascading a delete with hooks but there is no associate (i.e. "has zero") (94ms)
✓ can cascade updates (99ms)
✓ can restrict deletes (101ms)
✔ should create correct property map object
entity-metadata-validator
✔ should throw error if relation count decorator used with ManyToOne or OneToOne relations
entity-metadata-validator > initialized relations
✔ should throw error if relation with initialized array was found on many-to-many relation
✔ should throw error if relation with initialized array was found on one-to-many relation
✔ should not throw error if relation with initialized array was not found
✔ should not throw error if relation with initialized array was found, but persistence for this relation was disabled
entity-model
✓ can restrict updates (108ms)
association column
✓ has correct type for non-id primary keys with non-integer type (95ms)
✔ should save successfully and use static methods successfully
✓ should support a non-primary key as the association column on a target with custom primary key (107ms)
✓ should support a non-primary unique key as the association column (109ms)
✓ should support a non-primary unique key as the association column with a field option (105ms)
Association options
✓ can specify data type for autogenerated relational keys (104ms)
✔ should reload given entity successfully (471ms)
✓ should throw an error if an association clashes with the name of an already define attribute
allows the user to provide an attribute definition object as foreignKey
✓ works with a column that hasnt been defined before
✓ works when taking a column directly from the object
✓ works when merging with an existing definition
Counter part
BelongsTo
✓ should only generate one foreign key
Eager loading
✓ should load with an alias (113ms)
✓ should load all (109ms)
[MYSQL] Multiple Level Filters
✓ can filter through belongsTo (176ms)
✔ should reload exactly the same entity (471ms)
upsert
✓ avoids duplicated tables in query (184ms)
✔ should upsert successfully
entity schemas > basic functionality
✓ can filter through hasMany (201ms)
✔ should perform basic operations with entity using repository
✓ can filter through hasMany connector (175ms)
[MYSQL] associations
scope
1:1
✔ should perform basic operations with entity using manager
entity-schema > checks
entity-schema > checks > postgres, cockroachdb, oracle, mssql
✔ should create a check constraints
entity-schema > checks > spanner
✔ should create a check constraints
entity-schema > columns > mysql
✓ should create, find and include associations with scope values (173ms)
✔ should create columns with different options
entity schema > custom constraint names > foreign key
✓ should create included association with scope values (133ms)
1:M
✓ should create, find and include associations with scope values (138ms)
✓ should make the same query if called multiple time (#4470) (115ms)
✓ should created included association with scope values (112ms)
✓ should include associations with operator scope values (111ms)
✓ should not mutate scope when running SELECT query (#12868) (106ms)
N:M
on the target
✓ [Flaky] should create, find and include associations with scope values (106ms)
on the through model
✓ should create, find and include associations with scope values (239ms)
[MYSQL] Self
✓ supports freezeTableName
✔ should set custom constraint names
✓ can handle 1:m associations (43ms)
✓ can handle n:m associations (77ms)
✓ can handle n:m associations with pre-defined through table (76ms)
[MYSQL] CLS (Async hooks)
✓ CLS namespace is stored in Sequelize._cls
✓ promises returned by sequelize.query are correctly patched
✓ custom logging with benchmarking has correct CLS context (507ms)
context
✓ does not use continuation storage on manually managed transactions
✓ supports several concurrent transactions
✓ supports nested promise chains
✔ should load constraints with custom names
- should not change constraint names when table renamed
- should not change constraint names when column renamed
entity schema > custom constraint names > index
✓ does not leak variables to the outer scope (504ms)
✓ does not leak variables to the following promise chain
✓ does not leak outside findOrCreate
sequelize.query integration
✓ automagically uses the transaction in all calls
✓ automagically uses the transaction in all calls with async/await
Model Hook integration
✓ passes the transaction to hooks {beforeBulkCreate,beforeCreate,afterCreate,afterBulkCreate} when calling Model.bulkCreate
✓ passes the transaction to hooks {beforeFind,beforeFindAfterExpandIncludeAll,beforeFindAfterOptions} when calling Model.findAll
✓ passes the transaction to hooks {afterFind} when calling Model.findAll
✓ passes the transaction to hooks {beforeCount} when calling Model.count
✔ should set custom constraint names
✔ should load constraints with custom names
✓ passes the transaction to hooks {beforeUpsert,afterUpsert} when calling Model.upsert
✓ passes the transaction to hooks {beforeBulkDestroy,afterBulkDestroy} when calling Model.destroy
✓ passes the transaction to hooks {beforeDestroy,beforeDestroy} when calling Model.destroy with individualHooks
✓ passes the transaction to hooks {beforeDestroy,beforeDestroy} when calling Model#destroy
✔ should not change constraint names when table renamed (68ms)
✔ should not change constraint names when column renamed (52ms)
database schema > custom constraint names > primary key
✔ should set custom constraint names
✔ should load constraints with custom names
✔ should not change constraint names when table renamed
✔ should not change constraint names when column renamed
database schema > custom constraint names > unique
✓ passes the transaction to hooks {beforeBulkUpdate,afterBulkUpdate} when calling Model.update
✓ passes the transaction to hooks {beforeUpdate,afterUpdate} when calling Model.update with individualHooks
✓ passes the transaction to hooks {beforeCreate,afterCreate} when calling Model#save (isNewRecord)
✔ should set custom constraint names
✔ should load constraints with custom names
✓ passes the transaction to hooks {beforeUpdate,afterUpdate} when calling Model#save (!isNewRecord)
paranoid restore
✓ passes the transaction to hooks {beforeBulkRestore,afterBulkRestore} when calling Model.restore
✔ should not change constraint names when table renamed (67ms)
✓ passes the transaction to hooks {beforeRestore,afterRestore} when calling Model.restore with individualHooks
✓ passes the transaction to hooks {beforeRestore,afterRestore} when calling Model#restore
✔ should not change constraint names when column renamed (56ms)
entity-schema > embedded - class-instance
✔ should create an table
✔ should not create table with embedded
[MYSQL] Configuration
Connections problems should fail with a nice message
✓ when we don't have the correct server details
✓ when we don't have the correct login information
✓ when we don't have a valid dialect.
[MYSQL] DataTypes
✓ allows me to return values from a custom parse function (41ms)
✓ calls parse and stringify for JSON (41ms)
✔ should create embedded column name with prefix
✔ should create index for embedded
entity-schema > embedded - class-instance
✓ calls parse and stringify for DATE
✓ calls parse and stringify for DATEONLY (38ms)
✓ calls parse and stringify for TIME
✔ should save entity with embedded
✔ should contains instance of target class embedded entity
entity-schema > embedded - plain-object
✓ calls parse and stringify for BLOB
✓ calls parse and stringify for CHAR
✓ calls parse and stringify/bindParam for STRING
✓ calls parse and stringify for TEXT (38ms)
✔ should save entity with embedded
✔ should contains instance of plain object for embedded entity
entity-schema > exclusions
✔ should create an exclusion constraint
entity-schema > indices > basic
✓ calls parse and stringify for BOOLEAN
✓ calls parse and stringify for INTEGER
✓ calls parse and stringify for DECIMAL
✔ should create a non unique index with 2 columns
✓ calls parse and stringify for BIGINT
✓ should handle JS BigInt type (52ms)
✓ should handle TINYINT booleans
✓ calls parse and bindParam for DOUBLE
✓ calls parse and bindParam for FLOAT
✓ calls parse and bindParam for REAL
✓ calls parse and stringify for UUID
✓ calls parse and stringify for CIDR
✓ calls parse and stringify for INET
✓ calls parse and stringify for CITEXT
✓ calls parse and stringify for MACADDR
✓ calls parse and stringify for ENUM
✓ should parse DECIMAL as string
✓ should parse BIGINT as string
✓ should allow spaces in ENUM
✓ should return YYYY-MM-DD format string for DATEONLY
✓ should return set DATEONLY field to NULL correctly
✓ should be able to cast buffer as boolean
[MYSQL] Connection Manager
✓ should initialize a single pool without replication
✓ should initialize a multiple pools with replication
✓ should round robin calls to the read pool
✓ should trigger deprecation for non supported engine version
✓ should allow forced reads from the write pool
✓ should clear the pool after draining it
[MYSQL Specific] Associations
many-to-many
where tables have the same prefix
✓ should create a table wp_table1wp_table2s (60ms)
when join table name is specified
✓ should not use only a specified name
HasMany
addDAO / getModel
✓ should correctly add an association to the dao
removeDAO
✓ should correctly remove associated objects
✔ should update the index to be unique (1667ms)
[MYSQL Specific] Connection Manager
✓ -FOUND_ROWS can be suppressed to get back legacy behavior
✓ should acquire a valid connection when keepDefaultTimezone is true
[MYSQL Specific] DAOFactory
constructor
✓ handles extended attributes (unique)
✓ handles extended attributes (default)
✓ handles extended attributes (null)
✓ handles extended attributes (primaryKey)
✓ adds timestamps
✓ adds deletedAt if paranoid
✓ underscores timestamps if underscored
✓ omits text fields with defaultValues
✓ omits blobs fields with defaultValues
primaryKeys
✓ determines the correct primaryKeys
[MYSQL Specific] Errors
ForeignKeyConstraintError
✓ in context of DELETE restriction (120ms)
✓ in context of missing relation (114ms)
[MYSQL] Warning
logging
Executing (default): DROP TABLE IF EXISTS `models`;
Executing (default): SHOW WARNINGS
MySQL Warnings (default): Unknown table 'sequelize_test.models'; Unknown table 'sequelize_test.models'
Executing (default): SELECT CONSTRAINT_NAME as constraint_name,CONSTRAINT_NAME as constraintName,CONSTRAINT_SCHEMA as constraintSchema,CONSTRAINT_SCHEMA as constraintCatalog,TABLE_NAME as tableName,TABLE_SCHEMA as tableSchema,TABLE_SCHEMA as tableCatalog,COLUMN_NAME as columnName,REFERENCED_TABLE_SCHEMA as referencedTableSchema,REFERENCED_TABLE_SCHEMA as referencedTableCatalog,REFERENCED_TABLE_NAME as referencedTableName,REFERENCED_COLUMN_NAME as referencedColumnName FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE where TABLE_NAME = 'models' AND CONSTRAINT_NAME!='PRIMARY' AND CONSTRAINT_SCHEMA='sequelize_test' AND REFERENCED_TABLE_NAME IS NOT NULL;
Executing (default): DROP TABLE IF EXISTS `models`;
Executing (default): SHOW WARNINGS
MySQL Warnings (default): Unknown table 'sequelize_test.models'; Unknown table 'sequelize_test.models'
Executing (default): DROP TABLE IF EXISTS `models`;
Executing (default): SHOW WARNINGS
MySQL Warnings (default): Unknown table 'sequelize_test.models'; Unknown table 'sequelize_test.models'
Executing (default): CREATE TABLE IF NOT EXISTS `models` (`id` INTEGER NOT NULL auto_increment , `name` VARCHAR(1) BINARY, `createdAt` DATETIME NOT NULL, `updatedAt` DATETIME NOT NULL, PRIMARY KEY (`id`)) ENGINE=InnoDB;
Executing (default): SHOW INDEX FROM `models`
Executing (default): SELECT 1+1 AS result
Executing (default): SET SESSION sql_mode='';
Executing (default): INSERT INTO `models` (`id`,`name`,`createdAt`,`updatedAt`) VALUES (DEFAULT,?,?,?);
Executing (default): SHOW WARNINGS
MySQL Warnings (default):
✓ logs warnings when there are warnings (43ms)
[MYSQL] Sequelize Errors
API Surface
✓ Should have the Error constructors exposed
✓ Sequelize Errors instances should be instances of Error
✓ SequelizeValidationError should find errors by path
✓ SequelizeValidationError should override message property when message parameter is specified
✓ SequelizeValidationError should concatenate an error messages from given errors if no explicit message is defined
✓ SequelizeValidationErrorItem does not require instance & validator constructor parameters
✓ SequelizeValidationErrorItem should have instance, key & validator properties when given to constructor
✓ SequelizeValidationErrorItem.getValidatorKey() should return a string
✓ SequelizeValidationErrorItem.getValidatorKey() should throw if namespace separator is invalid (only if NS is used & available)
✓ SequelizeValidationErrorItem should map deprecated "type" values to new "origin" values
✓ SequelizeValidationErrorItemOrigin is valid
✓ SequelizeValidationErrorItem.Origins is valid
✓ SequelizeDatabaseError should keep original message
✓ SequelizeDatabaseError should keep the original sql and the parameters
✓ ConnectionError should keep original message
✓ ConnectionRefusedError should keep original message
✓ AccessDeniedError should keep original message
✓ HostNotFoundError should keep original message
✓ HostNotReachableError should keep original message
✓ InvalidConnectionError should keep original message
✓ ConnectionTimedOutError should keep original message
OptimisticLockError
✓ got correct error type and message (42ms)
ConstraintError
✓ Can be intercepted as UniqueConstraintError using .catch
✓ Can be intercepted as ValidationError using .catch
✓ Supports newlines in keys
✓ Works when unique keys are not defined in sequelize
✓ adds parent and sql properties
[MYSQL] Hooks
associations
1:1
cascade onUpdate
✓ on success
✔ should update the index swaping the 2 columns (1550ms)
entity-schema > indices > mysql
- should correctly create SPATIAL and FULLTEXT indices
entity schemas > target option
✔ should create instance of the target
✔ should find instances of the target
entity-schema > uniques
✔ should create an unique constraint with 2 columns
entity subscriber > query data
✔ passes query data to subscriber
✔ cleans up the data after the save completes
entity subscriber > transaction flow
✓ on error
cascade onDelete
#remove
✔ transactionStart
✔ transactionCommit
✔ transactionRollback
errors > prototype tree
✔ prototype tree makes sense
find options > find operators > ArrayContainedBy
✔ should find entries in regular arrays
✔ should find entries in enum arrays
find options > find operators > ArrayContains
✔ should find entries in regular arrays
✔ should find entries in enum arrays
find options > find operators > ArrayOverlap
✔ should find entries in regular arrays
✔ should find entries in enum arrays
find options > order
✓ with no errors
✓ with errors
no cascade update
✓ on success
✓ on error
no cascade delete
#remove
✓ with no errors
✓ with errors
1:M
cascade
#remove
✓ with no errors
✓ with errors
no cascade
#remove
✓ with no errors
✓ with errors
M:M
cascade
#remove
✓ with no errors
✔ order by id DESC (96ms)
✓ with errors
no cascade
#remove
✓ with no errors
✓ with errors
multiple 1:M
cascade
#remove
✓ with no errors
✓ with errors
multiple 1:M sequential hooks
cascade
#remove
✓ with no errors
✓ with errors
✔ order by title (63ms)
[MYSQL] Hooks
#bulkCreate
on success
✓ should run hooks
on error
✓ should return an error from before
✓ should return an error from after
with the {individualHooks: true} option
✓ should run the afterCreate/beforeCreate functions for each item created successfully
✓ should run the afterCreate/beforeCreate functions for each item created with an error
#bulkUpdate
on success
✓ should run hooks
on error
✓ should return an error from before
✓ should return an error from after
with the {individualHooks: true} option
✓ should run the after/before functions for each item created successfully
✓ should run the after/before functions for each item created successfully changing some data before updating
✓ should run the after/before functions for each item created with an error
#bulkDestroy
on success
✓ should run hooks
on error
✓ should return an error from before
✓ should return an error from after
with the {individualHooks: true} option
✓ should run the after/before functions for each item created successfully
✓ should run the after/before functions for each item created with an error
#bulkRestore
on success
✓ should run hooks
on error
✓ should return an error from before
✓ should return an error from after
with the {individualHooks: true} option
✓ should run the after/before functions for each item restored successfully
✔ where two criteria (56ms)
✓ should run the after/before functions for each item restored with an error
[MYSQL] Hooks
#count
on success
✓ hook runs
✓ beforeCount hook can change options
on error
✓ in beforeCount hook returns error
[MYSQL] Hooks
#create
✓ should not trigger hooks on parent when using N:M association setters (215ms)
on success
✓ should run hooks
on error
✓ should return an error from before
✓ should return an error from after
preserves changes to instance
✓ beforeValidate
✓ afterValidate
✓ beforeCreate
✓ beforeSave
✓ beforeSave with beforeCreate
[MYSQL] Hooks
#destroy
on success
✓ should run hooks
on error
✓ should return an error from before
✓ should return an error from after
with paranoid mode enabled
✓ sets other changed values when soft deleting and a beforeDestroy hooks kicks in
✓ should not throw error when a beforeDestroy hook changes a virtual column
[MYSQL] Hooks
#find
✓ allow changing attributes via beforeFind #5675
on success
✓ all hooks run
✓ beforeFind hook can change options
✓ beforeFindAfterExpandIncludeAll hook can change options
✓ beforeFindAfterOptions hook can change options
✓ afterFind hook can change results
on error
✓ in beforeFind hook returns error
✓ in beforeFindAfterExpandIncludeAll hook returns error
✓ in beforeFindAfterOptions hook returns error
✓ in afterFind hook returns error
[MYSQL] Hooks
#define
✓ beforeDefine hook can change model name
✓ beforeDefine hook can alter options
✓ beforeDefine hook can alter attributes
✔ order by relation (60ms)
✓ afterDefine hook can alter options
#init
✓ beforeInit hook can alter config
✓ beforeInit hook can alter options
✓ afterInit hook can alter options
passing DAO instances
beforeValidate / afterValidate
✓ should pass a DAO instance to the hook (73ms)
beforeCreate / afterCreate
✓ should pass a DAO instance to the hook (82ms)
beforeDestroy / afterDestroy
✓ should pass a DAO instance to the hook (87ms)
beforeUpdate / afterUpdate
✓ should pass a DAO instance to the hook (78ms)
Model#sync
on success
✓ should run hooks
✓ should not run hooks when "hooks = false" option passed
on error
✓ should return an error from before
✓ should return an error from after
sequelize#sync
on success
✓ should run hooks
✓ should not run hooks if "hooks = false" option passed
on error
✓ should return an error from before
✓ should return an error from after
#removal
✓ should be able to remove by name
✓ should be able to remove by reference
✓ should be able to remove proxies
Sequelize hooks
✓ should run before/afterPoolAcquire hooks
[MYSQL] Hooks
#restore
on success
✓ should run hooks
on error
✓ should return an error from before
✓ should return an error from after
[MYSQL] Hooks
#update
on success
✓ should run hooks
on error
✓ should return an error from before
✔ order by relation with where relation applied (53ms)
✓ should return an error from after
preserves changes to instance
✓ beforeValidate
✓ afterValidate
✓ beforeSave
✓ beforeSave with beforeUpdate
[MYSQL] Hooks
#upsert
on success
✓ should run hooks
on error
✓ should return an error from before
✓ should return an error from after
preserves changes to values
✓ beforeUpsert
[MYSQL] Hooks
#validate
#create
✓ should return the user
#3534, hooks modifications
✓ fields modified in hooks are saved
on error
✓ should emit an error from after hook
✓ should call validationFailed hook
✓ should not replace the validation error in validationFailed hook by default
✓ should replace the validation error if validationFailed hook creates a new error
[MYSQL] Include
find
✓ should support an empty belongsTo include (74ms)
✓ should support a belongsTo association reference (79ms)
✓ should support to use associations with Sequelize.col (122ms)
✓ should support a belongsTo association reference with a where (82ms)
✓ should support a empty hasOne include (91ms)
✓ should support a hasOne association reference (80ms)
✓ should support including a belongsTo association rather than a model/as pair (84ms)
✓ should support a hasMany association reference (83ms)
✓ should support a hasMany association reference with a where condition (84ms)
✓ should support a belongsToMany association reference (124ms)
✓ should support a simple nested belongsTo -> belongsTo include (127ms)
✓ should support a simple sibling set of belongsTo include (129ms)
✓ should support a simple nested hasOne -> hasOne include (124ms)
✓ should support a simple nested hasMany -> belongsTo include (129ms)
✓ should support a simple nested belongsTo -> hasMany include (139ms)
✔ order by nested relations (64ms)
✓ should support a simple nested hasMany to hasMany include (178ms)
✓ should support an include with multiple different association types (350ms)
✓ should support specifying attributes (80ms)
✓ should support Sequelize.literal and renaming of attributes in included model attributes (80ms)
✓ should support self associated hasMany (with through) include (84ms)
✓ should support including date fields, with the correct timeszone (112ms)
✓ should support include when retrieving associated objects (124ms)
where
✓ should support Sequelize.and()
✓ should support Sequelize.or()
findAndCountAll
✓ should include associations to findAndCountAll (84ms)
association getter
✓ should support getting an include on a N:M association getter (152ms)
✔ order by complex nested relations (74ms)
right join
✓ should support getting an include with a right join (77ms)
✓ should support getting an include through with a right join (134ms)
nested includes
✓ should not ripple grandchild required to top level find when required of child is set to false
✓ should support eager loading associations using the name of the relation (string)
✓ should not ripple grandchild required to top level find when required of child is not given (implicitly false)
✓ should ripple grandchild required to top level find when required of child is set to true as well
[MYSQL] Include
findAll
✓ should work on a nested set of relations with a where condition in between relations (252ms)
✓ should accept nested `where` and `limit` at the same time (196ms)
✓ should support an include with multiple different association types (491ms)
✔ order by column in embed (85ms)
✓ should support many levels of belongsTo (494ms)
✓ should support many levels of belongsTo (with a lower level having a where) (502ms)
✓ should support ordering with only belongsTo includes (133ms)
✓ should include attributes from through models (140ms)
✓ should support a required belongsTo include (97ms)
✓ should be possible to extend the on clause with a where option on a belongsTo include (98ms)
✓ should be possible to extend the on clause with a where option on a belongsTo include (96ms)
✓ should be possible to define a belongsTo include as required with child hasMany not required (160ms)
✓ should be possible to define a belongsTo include as required with child hasMany with limit (149ms)
✔ order by relation in embed (54ms)
find options > relations
✓ should be possible to define a belongsTo include as required with child hasMany with limit and aliases (154ms)
✓ should be possible to define a belongsTo include as required with child hasMany which is not required with limit (171ms)
✓ should be possible to extend the on clause with a where option on a hasOne include (107ms)
✓ should be possible to extend the on clause with a where option on a hasMany include with a through model (142ms)
✓ should be possible to extend the on clause with a where option on nested includes (582ms)
✓ should be possible to use limit and a where with a belongsTo include (110ms)
✔ basic relation (63ms)
✓ should be possible use limit, attributes and a where on a belongsTo with additional hasMany includes (834ms)
✓ should be possible to have the primary key in attributes (99ms)
✓ should be possible to turn off the attributes for the through table (536ms)
✓ should be possible to select on columns inside a through table (549ms)
✔ complex relation #1 (66ms)
✓ should be possible to select on columns inside a through table and a limit (523ms)
✓ should be possible not to include the main id in the attributes (93ms)
✓ should be possible to use limit and a where on a hasMany with additional includes (512ms)
✓ should be possible to use limit and a where on a hasMany with a through model with additional includes (541ms)
✔ complex relation #2 (61ms)
✓ should support including date fields, with the correct timeszone (127ms)
✓ should still pull the main record(s) when an included model is not required and has where restrictions without matches (122ms)
✓ should work with paranoid, a main record where, an include where, and a limit (101ms)
✓ should work on a nested set of required 1:1 relations (129ms)
✓ should work with an empty include.where (180ms)
✓ should be able to order on the main table and a required belongsTo relation with custom tablenames and limit (102ms)
✓ should ignore include with attributes: [] (used for aggregates) (93ms)
✓ should ignore include with attributes: [] and through: { attributes: [] } (used for aggregates) (199ms)
✓ should not add primary key when including and aggregating with raw: true (103ms)
✓ should return posts with nested include with inner join with a m:n association (233ms)
✓ should be able to generate a correct request with inner and outer join (206ms)
✓ should be able to generate a correct request for entity with 1:n and m:1 associations and limit (555ms)
✔ relation in embed (73ms)
find options > select
✓ should allow through model to be paranoid (131ms)
[MYSQL] Include
findAndCountAll
✓ should be able to include two required models with a limit. Result rows should match limit. (123ms)
✓ should be able to include a required model. Result rows should match count (200ms)
✓ should count on a where and not use an uneeded include (91ms)
✓ should return the correct count and rows when using a required belongsTo and a limit (99ms)
✓ should return the correct count and rows when using a required belongsTo with a where condition and a limit (97ms)
✓ should correctly filter, limit and sort when multiple includes and types of associations are present. (227ms)
✓ should properly work with sequelize.function (95ms)
[MYSQL] Include
findOne
✓ should include a non required model, with conditions and two includes N:M 1:M (209ms)
✓ should work with a 1:M to M:1 relation with a where on the last include (131ms)
✔ select id (54ms)
✓ should include a model with a where condition but no required (93ms)
✓ should include a model with a where clause when the PK field name and attribute name are different (95ms)
✓ should include a model with a through.where and required true clause when the PK field name and attribute name are different (133ms)
✓ should still pull the main record when an included model is not required and has where restrictions without matches (117ms)
✓ should support a nested include (with a where) (128ms)
✓ should support a belongsTo with the targetKey option (103ms)
✓ should support many levels of belongsTo (with a lower level having a where) (399ms)
✓ should work with combinding a where and a scope (75ms)
[MYSQL] Include
LIMIT
✓ supports many-to-many association with where clause (534ms)
✔ select title (56ms)
✓ supports 2 levels of required many-to-many associations (538ms)
✓ supports 2 levels of required many-to-many associations with where clause (551ms)
✓ supports 2 levels of required many-to-many associations with through.where clause (601ms)
✔ select title and text (78ms)
✓ supports 3 levels of required many-to-many associations with where clause (570ms)
✓ supports required many-to-many association (554ms)
✓ supports 2 required many-to-many association (599ms)
✔ select column in embed (69ms)
find options > where
✓ supports required one-to-many association (668ms)
✓ supports required one-to-many association with where clause (570ms)
✔ where id (56ms)
✓ supports required one-to-many association with where clause (findOne) (570ms)
✓ supports 2 levels of required one-to-many associations (569ms)
✓ supports required one-to-many association with nested required many-to-many association (601ms)
✔ where title (56ms)
✓ supports required many-to-many association with nested required one-to-many association (577ms)
✓ supports required many-to-one association with nested many-to-many association with where clause (586ms)
✓ supports required many-to-one association with nested many-to-many association with through.where clause (577ms)
✔ where two criteria (80ms)
✓ supports required many-to-one association with multiple nested associations with where clause (611ms)
✓ supports required many-to-one association with nested one-to-many association with where clause (585ms)
[MYSQL] Paranoid
✓ paranoid with timestamps: false should be ignored / not crash (529ms)
✔ where two criteria without match (80ms)
✓ test if non required is marked as false
✓ test if required is marked as true
✓ should not load paranoid, destroyed instances, with a non-paranoid parent (602ms)
[MYSQL] Includes with schemas
findAll
✓ should support an include with multiple different association types (608ms)
✔ where relation (112ms)
✓ should support many levels of belongsTo (573ms)
✓ should support ordering with only belongsTo includes (150ms)
✓ should include attributes from through models (159ms)
✓ should support a required belongsTo include (106ms)
✓ should be possible to extend the on clause with a where option on a belongsTo include (105ms)
✓ should be possible to extend the on clause with a where option on a belongsTo include (104ms)
✓ should be possible to define a belongsTo include as required with child hasMany with limit (164ms)
✓ should be possible to define a belongsTo include as required with child hasMany with limit and aliases (170ms)
✓ should be possible to define a belongsTo include as required with child hasMany which is not required with limit (164ms)
✓ should be possible to extend the on clause with a where option on a hasOne include (116ms)
✓ should be possible to extend the on clause with a where option on a hasMany include with a through model (161ms)
✔ where column and relation (79ms)
✓ should be possible to extend the on clause with a where option on nested includes (669ms)
✓ should be possible to use limit and a where with a belongsTo include (111ms)
✓ should be possible use limit, attributes and a where on a belongsTo with additional hasMany includes (567ms)
✓ should be possible to use limit and a where on a hasMany with additional includes (574ms)
✔ where nested relations (86ms)
✓ should be possible to use limit and a where on a hasMany with a through model with additional includes (623ms)
✓ should support including date fields, with the correct timezone (144ms)
findOne
✓ should work with schemas (108ms)
[MYSQL] Include
separate
✓ should run a hasMany association in a separate query (127ms)
✓ should work even if the id was not included (102ms)
✓ should work even if include does not specify foreign key attribute with custom sourceKey (106ms)
✓ should not break a nested include with null values (150ms)
✓ should run a hasMany association with limit in a separate query (116ms)
✓ should run a nested (from a non-separate include) hasMany association in a separate query (187ms)
✔ where complex nested relations (64ms)
✓ should work having a separate include between a parent and child include (241ms)
✓ should run two nested hasMany association in a separate queries (171ms)
✓ should work with two schema models in a hasMany association (136ms)
✓ should work with required non-separate parent and required child (176ms)
[MYSQL] Instance
Escaping
✓ is done properly for special characters
isNewRecord
✓ returns true for non-saved objects
✓ returns false for saved objects
✓ returns false for created objects
✓ returns false for upserted objects
✓ returns false for objects found by find method
✓ returns false for objects found by findAll method
default values
uuid
✓ should store a string in uuidv1 and uuidv4
✓ should store a string of length 36 in uuidv1 and uuidv4
✓ should store a valid uuid in uuidv1 and uuidv4 that conforms to the UUID v1 and v4 specifications
✓ should store a valid uuid if the multiple primary key fields used
current date
✓ should store a date in touchedAt
✓ should store the current date in touchedAt
allowNull date
✓ should be just "null" and not Date with Invalid Date
✓ should be the same valid date when saving the date
super user boolean
✓ should default to false
✓ should override default when given truthy boolean
✓ should override default when given truthy boolean-string ("true")
✓ should override default when given truthy boolean-int (1)
✓ should throw error when given value of incorrect type
complete
✓ gets triggered if an error occurs
✓ gets triggered if everything was ok
findAll
✓ sql should have paranoid condition
✓ sequelize.and as where should include paranoid condition
✓ sequelize.or as where should include paranoid condition
✓ escapes a single single quotes properly in where clauses
✔ where or + optional relations (75ms)
✓ escapes two single quotes properly in where clauses
✓ returns the timestamps if no attributes have been specified
✓ does not return the timestamps if the username attribute has been specified
✓ creates the deletedAt property, when defining paranoid as true
✓ destroys a record with a primary key of something other than id (46ms)
✓ sets deletedAt property to a specific date when deleting an instance
✓ keeps the deletedAt-attribute with value null, when running update
✓ keeps the deletedAt-attribute with value null, when updating associations
✓ can reuse query option objects
findOne
✓ can reuse query option objects
✓ returns null for null, undefined, and unset boolean values (45ms)
equals
✓ can compare records with Date field
✓ does not compare the existence of associations (140ms)
values
✓ returns all values (41ms)
isSoftDeleted
✓ should return false when model is just created
✓ returns false if user is not soft deleted
✔ where column in embed (77ms)
✓ returns true if user is soft deleted
✓ works with custom `deletedAt` field name (66ms)
restore
✓ returns an error if the model is not paranoid
✓ restores a previously deleted model (59ms)
✓ supports custom deletedAt field (55ms)
✓ supports custom deletedAt field name (49ms)
✓ supports custom deletedAt field and database column (48ms)
✓ supports custom default value (46ms)
[MYSQL] InstanceValidator
✓ correctly validates using custom validation methods
✓ supports promises with custom validation methods (44ms)
✓ skips other validations if allowNull is true and the value is null
✓ validates a model with custom model-wide validation methods
✓ validates model with a validator whose arg is an Array successfully twice in a row
✓ validates enums
✓ skips validations for the given fields
✓ skips validations for fields with value that is SequelizeMethod
✓ raises an error if saving a different value into an immutable field (46ms)
✓ allows setting an immutable field if the record is unsaved
✓ raises an error for array on a STRING
✓ raises an error for array on a STRING(20)
✓ raises an error for array on a TEXT
✓ raises an error for {} on a STRING
✓ raises an error for {} on a STRING(20)
✓ raises an error for {} on a TEXT
✓ does not raise an error for null on a STRING (where null is allowed)
✓ validates VIRTUAL fields
✓ allows me to add custom validation functions to validator.js
#update
✓ should allow us to update specific columns without tripping the validations (65ms)
✓ should be able to emit an error upon updating when a validation has failed from an instance (45ms)
✓ should be able to emit an error upon updating when a validation has failed from the factory (55ms)
✓ should enforce a unique constraint (50ms)
✓ should allow a custom unique constraint error message (47ms)
✓ should handle multiple unique messages correctly (46ms)
#create
generic
✓ correctly throws an error using create method
✓ correctly validates using create method
explicitly validating primary/auto incremented columns
✓ should emit an error when we try to enter in a string for the id key without validation arguments (40ms)
✓ should emit an error when we try to enter in a string for an auto increment key (not named id) (42ms)
primaryKey with the name as id with arguments for it's validatio
✓ should emit an error when we try to enter in a string for the id key with validation arguments
✓ should emit an error when we try to enter in a string for an auto increment key through .build().validate()
✓ should emit an error when we try to .save()
pass all paths when validating
✓ produce 3 errors
not null schema validation
✓ correctly throws an error using create method
✔ where relation in embed (64ms)
✓ correctly throws an error using create method with default generated messages
[MYSQL] Instance
decrement
✓ supports transactions (112ms)
✓ with array
✓ with single field
✓ with single field and no value
✓ should still work right with other concurrent updates
✓ should still work right with other concurrent increments
✓ with key value pair
✓ with negative value
✓ with timestamps set to true (45ms)
✓ with timestamps set to true and options.silent set to true (45ms)
[MYSQL] Instance
destroy
✓ supports transactions (47ms)
✓ does not set the deletedAt date in subsequent destroys if dao is paranoid (52ms)
✓ does not update deletedAt with custom default in subsequent destroys (47ms)
✓ deletes a record from the database if dao is not paranoid (49ms)
✓ allows updating soft deleted instance (51ms)
✓ supports custom deletedAt field (46ms)
✓ supports custom deletedAt database column (46ms)
✓ supports custom deletedAt field and database column (46ms)
✓ persists other model changes when soft deleting (52ms)
✓ allows sql logging of delete statements (49ms)
✓ allows sql logging of update statements (48ms)
✓ should not call save hooks when soft deleting (48ms)
✓ delete a record of multiple primary keys table (56ms)
[MYSQL] Instance
increment
✓ supports transactions (109ms)
✓ supports where conditions
✓ with array
✓ with single field
✓ with single field and no value
✓ should still work right with other concurrent updates
✓ should still work right with other concurrent increments
✓ with key value pair
✔ where complex with or + and (55ms)
✓ single value should work when field name is different from database column name
✓ array should work when field name is different from database column name
✓ key value should work when field name is different from database column name
✓ with timestamps set to true (49ms)
✓ with timestamps set to true and options.silent set to true (43ms)
[MYSQL] Instance
reload
✓ supports transactions (107ms)
✓ should return a reference to the same DAO instead of creating a new one
✓ should use default internal where
✓ should update the values on all references to the DAO
✓ should support updating a subset of attributes
✓ should update read only attributes as well (updatedAt)
✓ should update the associations as well (115ms)
✓ should update internal options of the instance (114ms)
✓ should return an error when reload fails
✓ should set an association to null after deletion, 1-1 (231ms)
✓ should set an association to empty after all deletion, 1-N (229ms)
✓ should update the associations after one element deleted (220ms)
✓ should inject default scope when reloading (123ms)
[MYSQL] Instance
save
✓ supports transactions (118ms)
✓ only updates fields in passed array
✓ should work on a model with an attribute named length (54ms)
✓ only validates fields in passed array
✓ stores an entry in the database
✔ where relations with operators (73ms)
✓ handles an entry with primaryKey of zero (48ms)
✓ updates the timestamps
✓ does not update timestamps when passing silent=true
✓ does not update timestamps when passing silent=true in a bulk update
✓ updates with function and column value
✓ updates with function that contains escaped dollar symbol
✓ updates with function that contains multiple escaped dollar symbols
✓ should fail a validation upon creating
✓ should fail a validation upon creating with hooks false
✓ should fail a validation upon building
✓ should fail a validation when updating
✓ takes zero into account
✓ saves a record with no primary key (48ms)
hooks
✓ should update attributes added in hooks when default fields are used (53ms)
✓ should update attributes changed in hooks when default fields are used (49ms)
✓ should validate attributes added in hooks when default fields are used (53ms)
✓ should validate attributes changed in hooks when default fields are used (49ms)
when nothing changed
✓ does not update timestamps
✓ should not throw ER_EMPTY_QUERY if changed only virtual fields (43ms)
without timestamps option
✓ doesn't update the updatedAt column (41ms)
with custom timestamp options
✓ updates the createdAt column if updatedAt is disabled (42ms)
✔ should not apply inner join if all conditions return undefined (65ms)
✓ updates the updatedAt column if createdAt is disabled (43ms)
✓ works with `allowNull: false` on createdAt and updatedAt columns (44ms)
eagerly loaded objects
✓ saves one object that has a collection of eagerly loaded objects
✓ saves many objects that each a have collection of eagerly loaded objects
✓ saves many objects that each has one eagerly loaded object (to which they belong)
[MYSQL] Instance
toJSON
✓ doesn't return instance that isn't defined
✓ doesn't return instances that aren't defined
✓ includes the eagerly loaded associations
build
✓ returns an object containing all values
✓ returns a response that can be stringified
✓ returns a response that can be stringified and then parsed
create
✓ returns an object containing all values
✓ returns a response that can be stringified
✓ returns a response that can be stringified and then parsed
find
✓ returns an object containing all values
✓ returns a response that can be stringified
✓ returns a response that can be stringified and then parsed
[MYSQL] Instance
update
✓ supports transactions (112ms)
✓ should update fields that are not specified on create (47ms)
✔ should apply inner join if true is applied (60ms)
find options > where
✔ should skip undefined properties
✔ should skip null properties
find options > opaque-types-over-primitives
✓ should succeed in updating when values are unchanged (without timestamps) (48ms)
✔ should work in select
✓ should update timestamps with milliseconds (51ms)
✔ should work in where
✔ should work in order by
indices > basic unique index test
unique index
✓ should only save passed attributes
✓ should save attributes affected by setters
✔ should work without errors
indices > conditional index
✔ should correctly create conditional indices with WHERE condition
✔ should correctly drop conditional indices and revert drop
indices > embeds index test
embeddeds index
✓ should not set attributes that are not specified by fields (45ms)
✓ updates attributes in the database
✔ should work without errors
indices > fulltext index
- should correctly create fulltext indices
- with default parser
- with ngram parser
jsonb type
✔ should make correct schema with Postgres' jsonb type
✔ should persist jsonb correctly
✔ should persist jsonb string correctly
✔ should persist jsonb array correctly
✔ should create updates when changing object
✔ should not create updates when resorting object
✔ should not create new migrations when everything is equivalent
json > defaults
✔ should insert default values properly
ltree-postgres
✔ should create correct schema with Postgres' ltree type
✔ should persist ltree correctly
✔ should update ltree correctly
✔ should re-save ltree correctly
✔ should persist ltree correctly with trailing '.'
✔ should persist ltree correctly when containing spaces
✔ should be able to query ltree correctly
metadata-builder > ColumnMetadata
✓ ignores unknown attributes
✔ getValue
✓ ignores undefined attributes (112ms)
✓ doesn't update primary keys or timestamps (60ms)
✔ getValueMap
metadata builder > MetadataArgsUtils
✔ getInheritanceTree
✔ filterByTargetClasses
migrations > generate command
✔ can recognize model changes
✓ stores and restores null values (57ms)
✓ should support logging
hooks
✔ does not generate when no model changes (352ms)
migrations > show command
✔ can recognise pending migrations
✔ can recognise no pending migrations
mongodb > array columns
✔ should insert / update array columns correctly
✔ should retrieve arrays from the column metadata
mongodb > embedded columns
✔ should insert / update / remove entity with embedded correctly
✔ should store results in correct camelCase format
✔ should transform results to correct boolean value
✔ should transform entity with nested embedded columns correctly
mongodb > embedded columns listeners
✔ should work listeners in entity embeddeds correctly
✔ should not work listeners in entity embeddeds if property is optional
✔ should work listeners in entity array embeddeds correctly
mongodb > embeddeds indices
✔ should insert entity with embeddeds indices correctly
mongodb > indices
✔ should insert entity with indices correctly
mongodb > MongoRepository
✔ connection should return mongo repository when requested
✔ entity manager should return mongo repository when requested
✔ should be able to use entity cursor which will return instances of entity classes
✔ should be able to use entity cursor which will return instances of entity classes
✔ should be able to use findByIds with both ObjectId and strings
✔ should be able to save and update mongo entities
✔ should ignore non-column properties
with DeletedDataColumn
✔ with $or query
✔ filter delete data
findOne filtered data properly
✔ findOne()
✔ findOneBy()
mongodb > object id columns
✔ should persist ObjectIdColumn property as _id to DB
✔ should map _id to ObjectIdColumn property and remove BD _id property
✔ should save and load properly if objectId property has name _id
✔ should not persist entity ObjectIdColumn property in DB on update by save
mongodb > basic repository actions
✔ create should create instance of same entity
✔ create should be able to fill data from the given object
✔ merge should merge all given partial objects into given source entity
✔ merge should merge all given recursive partial objects into given source entity
✔ target should be valid
✔ should persist entity successfully and after persistence have generated object id
✔ hasId should return true if id really has an id
✔ unsupported methods should throw exception
✔ should return persisted objects using find* methods
✔ should sort entities in a query
✔ clear should remove all persisted entities
✔ remove should remove given entity
✔ clear should remove all persisted entities
✔ preload should pre-load given object
mongodb > timestampable columns
✔ should persist timestampable columns
multi-database > basic-functionality
filepathToName()
✔ produces deterministic, unique, and valid table names for relative paths; leaves absolute paths unchanged (darwin)
✔ produces deterministic, unique, and valid table names for relative paths; leaves absolute paths unchanged (win32)
multiple databases
✔ should correctly attach and create database files
✔ should prefix tableName when custom database used in Entity decorator
✔ should not affect tableName when using default main database
✔ should create foreign keys for relations within the same database
multi-schema-and-database > custom-junction-database
✓ should update attributes added in hooks when default fields are used (50ms)
✓ should update attributes changed in hooks when default fields are used (49ms)
✔ should correctly create tables when custom table schema used
multi-schema-and-database > custom-junction-schema
✔ should correctly create tables when custom table schema used
multi-schema-and-database > basic-functionality
custom-table-schema
✔ should set the table database / schema
✔ should correctly get the table primary keys when custom table schema used
✔ should correctly create tables when custom table schema used
✔ should correctly create tables when custom table schema used in Entity decorator
✔ should correctly work with cross-schema queries
✔ should correctly work with QueryBuilder
custom-table-schema-and-database
✔ should set the table database / schema
✔ should correctly get the table primary keys when custom table schema used
✔ should correctly create tables when custom database and custom schema used in Entity decorator
✔ should correctly work with cross-schema and cross-database queries in QueryBuilder
custom-database
✓ should validate attributes added in hooks when default fields are used (49ms)
✔ should correctly create tables when custom database used in Entity decorator
LegacyOracleNamingStrategy > column shortening
✔ should truncate column names to the limit
✔ should change column names to hashes within the limit
LegacyOracleNamingStrategy > create table using this naming strategy
✔ should create the table
LegacyOracleNamingStrategy > create table using default naming strategy
✔ should not create the table and fail due to ORA-00972
persistence > basic functionality
✓ should validate attributes changed in hooks when default fields are used (47ms)
✔ should save an entity
[MYSQL] DAO
Values
set
✓ doesn't overwrite generated primary keys
✓ doesn't overwrite defined primary keys
✓ doesn't set timestamps
✓ doesn't set underscored timestamps
✓ doesn't set value if not a dynamic setter or a model attribute
✓ allows use of sequelize.fn and sequelize.col in date and bool fields (48ms)
includes
✓ should support basic includes
✓ should support basic includes (with raw: true)
get
✓ should use custom attribute getters in get(key)
✓ should custom virtual getters in get(key)
✓ should use custom getters in toJSON
✓ should work with save (48ms)
✓ can pass parameters to getters
plain
✓ should return plain values when true
clone
✓ should copy the values
changed
✓ should return false if object was built from database (46ms)
✓ should return true if previous value is different
✓ should return false immediately after saving (44ms)
✔ should remove an entity
✓ should be available to a afterUpdate hook (46ms)
previous
✓ should return an object with the previous values
✓ should return the previous value
model
json
✓ should tell me that a column is json
✓ should use a placeholder for json with insert
✓ should insert json using a custom field name (43ms)
✔ should throw an error when not an object is passed to a save method
✔ should throw an error when not an object is passed to a remove method
✔ should throw an exception if object literal is given instead of constructed entity because it cannot determine what to save
✓ should update json using a custom field name (53ms)
✓ should be able retrieve json value as object
✓ should be able to retrieve element of array by index
✔ should be able to save and remove entities of different types
persistence > bulk-insert-remove-optimization
✓ should be able to retrieve root level value of an object by key
✓ should be able to retrieve nested value of an object by path
✔ should group multiple insert and remove queries
persistence > cascades > example 1
✓ should be able to retrieve a row based on the values of the json document
✓ should be able to query using the nested query language
✔ should insert everything by cascades properly
persistence > cascades > example 2
✓ should be able to query using dot notation
✓ should be able to query using dot notation with uppercase name
✓ should be able to query array using property accessor
✓ should be able to store strings
✓ should be able to store values that require JSON escaping
✓ should be able to findOrCreate with values that require JSON escaping
✓ should be able retrieve json value with nested include
[MYSQL] Model
✓ supports multiple async transactions (2029ms)
✓ should be possible to use a key named UUID as foreign key (141ms)
constructor
✓ uses the passed dao name as tablename if freezeTableName
✓ uses the pluralized dao name as tablename unless freezeTableName
✓ uses checks to make sure dao factory is not leaking on multiple define
✓ allows us to predefine the ID column with our own specs
✓ throws an error if 2 autoIncrements are passed
✓ throws an error if a custom model-wide validation is not a function
✓ throws an error if a custom model-wide validation has the same name as a field
✓ should allow me to set a default value for createdAt and updatedAt (56ms)
✓ should allow me to set a function as default value (41ms)
✓ should throw `TypeError` when value for updatedAt, createdAt, or deletedAt is neither string nor boolean
✓ should allow me to use `true` as a value for updatedAt, createdAt, and deletedAt fields (43ms)
✓ should allow me to override updatedAt, createdAt, and deletedAt fields (45ms)
✓ should allow me to disable some of the timestamp fields (46ms)
✓ returns proper defaultValues after save when setter is set (39ms)
✓ should work with both paranoid and underscored being true (38ms)
✓ allows multiple column unique keys to be defined (38ms)
✓ allows unique on column with field aliases
✓ allows us to customize the error message for unique constraint (44ms)
✔ should insert everything by cascades properly
persistence > cascades > remove
- should remove everything by cascades properly
persistence > cascades > remove
- should soft-remove everything by cascades properly
persistence > cascade operations with custom name
cascade update
✓ allows us to map the customized error message with unique constraint name (1421ms)
- should allow the user to specify indexes in options
descending indices (MySQL 8 specific)
✔ should remove relation
persistence > entity updation
✔ should update generated auto-increment id after saving
✓ complains about missing support for descending indexes (1420ms)
✔ should update generated uuid after saving
✔ should update default values after saving
✓ works fine with InnoDB (1425ms)
build
✓ doesn't create database entries
✔ should update special columns after saving
✓ fills the objects with default values
✓ fills the objects with default values
✓ attaches getter and setter methods from attribute definition
✓ attaches getter and setter methods from options
✓ attaches getter and setter methods from options only if not defined in attribute
include
✓ should support basic includes
✓ should support includes with aliases
findOne
✓ supports the transaction option in the first parameter (86ms)
✔ should update even when multiple primary keys are used
✓ should not fail if model is paranoid and where is an empty array (84ms)
✓ should work if model is paranoid and only operator in where clause is a Symbol (#8406) (87ms)
findOrBuild
✓ supports transactions (92ms)
returns an instance if it already exists
✓ with a single find field
✓ with multiple find fields
✓ builds a new instance with default value.
save
✓ should map the correct fields when saving instance (#10589) (99ms)
✔ should update even with embeddeds
persistence > insert > update-relation-columns-after-insertion
update
✓ throws an error if no where clause is given (88ms)
✓ should map the correct fields when updating instance (#10589) (96ms)
✓ supports transactions (351ms)
✓ updates the attributes that we select only without updating createdAt (40ms)
✓ allows sql logging of updated statements (91ms)
✓ updates only values that match filter
✓ throws an error if where has a key with undefined value
✓ updates only values that match the allowed fields
✓ updates with casting
✓ updates with function and column value
✓ does not update virtual attributes
✓ doesn't update attributes that are altered by virtual setters when option is enabled (40ms)
✓ updates attributes that are altered by virtual setters (47ms)
✓ should properly set data when individualHooks are true
✓ sets updatedAt to the current timestamp
✔ should work perfectly
persistence > many-to-many
✓ returns the number of affected rows
✓ does not update soft deleted records when model is paranoid (131ms)
✓ updates soft deleted records when paranoid is overridden (124ms)
✓ calls update hook for soft deleted objects (92ms)
✓ supports limit clause
destroy
✓ `truncate` method should clear the table (126ms)
✓ `truncate` option should clear the table (119ms)
✓ `truncate` option returns a number (123ms)
✓ throws an error if no where clause is given (90ms)
✓ deletes all instances when given an empty where object (92ms)
✓ throws an error if where has a key with undefined value (84ms)
✔ add exist element to exist object with empty many-to-many relation and save it and it should contain a new category
✓ supports transactions (86ms)
✓ deletes values that match filter
✓ works without a primary key (49ms)
✓ supports .field (40ms)
✓ sets deletedAt to the current timestamp if paranoid is true (53ms)
✓ does not set deletedAt for previously destroyed instances if paranoid is true (47ms)
✓ should include deleted associated records if include has paranoid marked as false (142ms)
✓ should delete a paranoid record if I set force to true (53ms)
✓ returns the number of affected rows
✓ supports table schema/prefix (95ms)
✓ should work if model is paranoid and only operator in where clause is a Symbol (92ms)
can't find records marked as deleted with paranoid being true
✓ with the DAOFactory (45ms)
can find paranoid records if paranoid is marked as false in query
✓ with the DAOFactory (51ms)
restore
✓ rejects with an error if the model is not paranoid
✔ remove one element from many-to-many relation should remove from the database as well
✓ restores a previously deleted model (47ms)
equals
✓ correctly determines equality of objects
✓ correctly determines equality with multiple primary keys (38ms)
equalsOneOf
✓ determines equality if one is matching
✓ doesn't determine equality if none is matching
count
✓ supports transactions (88ms)
✓ counts all created objects
✓ returns multiple rows when using group
✓ allows sql logging
✓ filters object
✓ supports distinct option (85ms)
aggregate
Executing (default): SELECT `id` AS `id2`, count(`id`) AS `count` FROM `Users` AS `User` GROUP BY `id2`;
(node:719) [SEQUELIZE0002] DeprecationWarning: The logging-option should be either a function or false. Default: console.log
✓ allows grouping by aliased attribute
options sent to aggregate
✓ modifies option "limit" by setting it to null
✓ modifies option "offset" by setting it to null
✓ modifies option "order" by setting it to null
min
✓ supports transactions (88ms)
✓ returns the correct value
✔ remove all elements from many-to-many relation should remove from the database as well (39ms)
✓ allows sql logging
✓ should allow decimals
✓ should allow strings
✓ should allow dates
✓ should work with fields named as an SQL reserved keyword
max
✓ supports transactions (97ms)
✔ remove all elements (set to null) from many-to-many relation should remove from the database as well (41ms)
✓ returns the correct value
✓ allows sql logging
✓ should allow decimals
✓ should allow strings
✓ should allow dates
✓ should work with fields named as an SQL reserved keyword
sum
✓ should work in the simplest case
✓ should work with fields named as an SQL reserved keyword
✓ should allow decimals in sum
✔ remove all elements from many-to-many relation if parent entity is removed
persistence > many-to-one bi-directional relation
✓ should accept a where clause
✓ should accept a where clause with custom fields
✓ allows sql logging
schematic support
✓ should be able to drop with schemas
✓ should be able to list schemas
✓ should take schemaDelimiter into account if applicable (80ms)
✓ should describeTable using the default schema settings (73ms)
✔ should save a category with a post attached
✓ should be able to reference a table with a schema set (81ms)
✓ should be able to create and update records under any valid schematic (46ms)
references
✓ uses an existing dao factory and references the author table (50ms)
✓ uses a table name as a string and references the author table (44ms)
- emits an error event as the referenced table name is invalid
✓ works with comments (252ms)
blob
buffers
✓ should be able to take a buffer as parameter to a BLOB field
✓ should return a buffer when fetching a blob
✔ should save a category and a new post by cascades
✓ should work when the database returns null
strings
✓ should be able to take a string as parameter to a BLOB field
✓ should return a buffer when fetching a BLOB, even when the BLOB was inserted as a string
paranoid is true and where is an array
✓ should not fail when array contains Sequelize.or / and
✓ should fail when array contains strings
✓ should not fail with an include
✔ should update exist post by cascades when category is saved
✓ should not overwrite a specified deletedAt by setting paranoid: false
✓ should not overwrite a specified deletedAt (complex query) by setting paranoid: false
Unique
✓ should set unique when unique is true
✓ should not set unique when unique is false
✓ should not set unique when unique is unset
bulkCreate
✓ errors - should return array of errors if validate and individualHooks are true (98ms)
✓ should not use setter when renaming fields in dataValues (99ms)
[MYSQL] Model
attributes
set
✔ should NOT remove exist post by cascades when category is saved without a post (post is set to undefined)
✓ should only be called once when used on a join model called with an association getter (134ms)
✓ allows for an attribute to be called "toString" (45ms)
✓ allows for an attribute to be called "toString" with associations (99ms)
quote
✓ allows for an attribute with dots (38ms)
[MYSQL] Model
attributes
field
✓ increment should work (42ms)
✓ decrement should work (42ms)
✓ sum should work (40ms)
✔ should unset exist post when its set to null
✓ should create, fetch and update with alternative field names from a simple model
✓ should bulk update (433ms)
✓ should not contain the field properties after create (42ms)
✓ should make the aliased auto incremented primary key available after create
✔ should set category's post to NULL when post is removed from the database (database ON DELETE)
✓ should work with where on includes for find
✓ should work with where on includes for findAll
✓ should work with increment
✓ should work with a simple where
✓ should work with a where or
✓ should work with bulkCreate and findAll
✔ should work when relation id is directly set into relation (without related object)
persistence > many-to-one uni-directional relation
✓ should support renaming of sequelize method fields (422ms)
✓ should sync foreign keys with custom field names (398ms)
✔ should save a category with a post attached
✓ should find the value of an attribute with a custom field name
✓ field names that are the same as property names should create, update, and read correctly
✓ should work with a belongsTo association getter
✓ should work with paranoid instance.destroy() (90ms)
✓ should work with paranoid Model.destroy() (92ms)
✔ should save a category and a new post by cascades
✓ should work with `belongsToMany` association `count`
✓ should work with `hasMany` association `count`
primaryKey
✓ should support instance.destroy()
✓ should support Model.destroy()
in combination with allowNull
✓ sets the column to not allow null
field and attribute name is the same
✓ bulkCreate should work
✔ should update exist post by cascades when category is saved
✓ find with where should work
✓ reload should work
✓ save should work
[MYSQL] Model
attributes
types
VIRTUAL
✓ should not be ignored in dataValues get
✔ should NOT remove exist post by cascades when category is saved without a post (post is set to undefined)
✓ should be ignored in table creation
✓ should be ignored in find, findAll and includes
✓ should allow me to store selected values (387ms)
✓ should be ignored in create and update
✔ should unset exist post when its set to null
✓ should be ignored in bulkCreate and and bulkUpdate
✓ should be able to exclude with attributes
✓ should be able to include model with virtual attributes
[MYSQL] Model
bulkCreate
✓ supports transactions (79ms)
✔ should set category's post to NULL when post is removed from the database (database ON DELETE)
✓ should not alter options (94ms)
✓ should be able to set createdAt and updatedAt if using silent: true (87ms)
✓ should not fail on validate: true and individualHooks: true (85ms)
✓ should not map instance dataValues to fields with individualHooks: true (79ms)
✓ should not insert NULL for unused fields
✓ properly handles disparate field lists
✔ should work when relation id is directly set into relation (without related object)
persistence > multi primary keys
insert
✓ inserts multiple values respecting the white list
✓ should store all values if no whitelist is specified
✓ should set isNewRecord = false
✓ saves data with single quote
✓ saves data with double quote
✓ saves stringified JSON data
✔ should insert entity when there are multi column primary keys
persistence > multi primary keys on both sides
insert
✓ properly handles a model with a length column
✓ stores the current date in createdAt
✓ emits an error when validate is set to true
✓ doesn't emit an error when validate is set to true but our selectedValues are fine (40ms)
✓ should allow blank arrays (return immediately)
✔ should insert entity when there are multi column primary keys
persistence > null and default behaviour
✔ should insert value if it is set
✔ should insert default when post.title is undefined
✔ should insert NULL when post.title is null
✓ should allow blank creates (with timestamps: false) (46ms)
✔ should update nothing when post.title is undefined
✔ should update to null when post.title is null
persistence > one-to-many
✓ should allow autoincremented attributes to be set
✓ should support schemas (226ms)
✓ should support the ignoreDuplicates option
✓ should properly map field names to attribute names
updateOnDuplicate
✓ should support the updateOnDuplicate option
✔ should add exist element to exist object with empty one-to-many relation and save it
✓ should reject for non array updateOnDuplicate option
✓ should reject for empty array updateOnDuplicate option
should support the updateOnDuplicate option with primary keys
✓ when the primary key column names and model field names are the same
✓ when the primary key column names and model field names are different
✓ when the primary key column names and model field names are different and have unique constraints (43ms)
✔ should add exist element to new object with empty one-to-many relation and save it
✓ when the composite primary key column names and model field names are different
✓ when the primary key column names and model field names are different and have composite unique constraints (39ms)
✓ [#12516] when the primary key column names and model field names are different and have composite unique index constraints (1422ms)
✔ should remove exist element from one-to-many relation and save it
enums
✓ correctly restores enum values (40ms)
handles auto increment values
✓ should return auto increment primary key values
✓ should return supplied values on primary keys (106ms)
✓ should return supplied values on primary keys when some instances already exists (86ms)
virtual attribute
✔ should remove all elements from one-to-many relation and save it
✓ should validate (82ms)
✓ should not validate (84ms)
[MYSQL] Model
bulkCreate
include
✓ should bulkCreate data for BelongsTo relations (96ms)
✓ should bulkCreate data for BelongsTo relations with no nullable FK (90ms)
✓ should bulkCreate data for BelongsTo relations with alias (94ms)
✓ should bulkCreate data for HasMany relations (96ms)
✓ should bulkCreate data for HasMany relations with alias (97ms)
✔ set relation to null (elements exist there) from one-to-many relation and save it
persistence > one-to-one
set the relation with proper item
✓ should bulkCreate data for HasOne relations (90ms)
✔ should have an access token
doesn't allow the same relation to be used twice
✓ should bulkCreate data for HasOne relations with alias (95ms)
✓ should bulkCreate data for BelongsToMany relations (139ms)
✔ should reject the saving attempt (79ms)
persistence > orphanage > delete
when a Post is removed from a Category
✓ should bulkCreate data for polymorphic BelongsToMany relations (132ms)
✓ should bulkCreate data for BelongsToMany relations with alias (131ms)
[MYSQL] Model
count
✓ should count rows
✓ should support include
✓ should count groups correctly and return attributes
✓ should not return NaN
✓ should be able to specify column for COUNT()
✓ should be able to specify NO column for COUNT() with DISTINCT
✓ should be able to use where clause on included models
✓ should be able to specify column for COUNT() with includes
✓ should work correctly with include and whichever raw option (54ms)
✔ should retain a Post on the Category
[MYSQL] Model
✓ should return autoIncrement primary key (create) (38ms)
✓ should support logging
findOrCreate
✓ supports transactions
✓ supports more than one models per transaction
✓ should error correctly when defaults contain a unique key (87ms)
✔ should delete the orphaned Post from the database
(sequelize) Warning: Unknown attributes (foo,bar) passed to defaults option of findOrCreate
✓ should error correctly when defaults contain a unique key and a non-existent field (96ms)
✓ should error correctly when defaults contain a unique key and the where clause is complex (95ms)
✓ should work with empty uuid primary key in where (86ms)
✓ should not deadlock with no existing entries and no outer transaction (165ms)
✓ should not deadlock with existing entries and no outer transaction (194ms)
✔ should retain foreign keys on remaining Posts
persistence > orphanage > disable
when a User is updated without all settings being loaded...
✓ should not deadlock with concurrency duplicate entries and no outer transaction (179ms)
✓ should support special characters in defaults (103ms)
✓ should support bools in defaults (87ms)
✓ returns instance if already existent. Single find field.
✓ Returns instance if already existent. Multiple find fields.
✓ does not include exception catcher in response
✔ should not delete setting with orphanedRowAction=disabed
✓ creates new instance with default value.
✓ supports .or() (only using default values)
✓ should ignore option returning
✓ should release transaction when meeting errors
several concurrent calls
✓ works with a transaction
✓ should not fail silently with concurrency higher than pool, a unique constraint and a create hook resulting in mismatched values (123ms)
✓ should error correctly when defaults contain a unique key without a transaction (100ms)
✔ should not orphane any Settings
persistence > partial persist
✓ works without a transaction
findCreateFind
✔ should persist partial entities without data loss (60ms)
persistence > persistence options > chunks
✔ should save objects in chunks
persistence > persistence options > listeners
✓ [Flaky] should work with multiple concurrent calls
✓ should work with multiple concurrent calls within a transaction
create
✔ save listeners should work by default
✓ works with multiple non-integer primary keys with a default value (257ms)
✔ save listeners should be disabled if save option is specified
✔ remove listeners should work by default
✓ should return an error for a unique constraint error (273ms)
✔ remove listeners should be disabled if remove option is specified
✓ works without any primary key (330ms)
✔ soft-remove listeners should work by default
✔ soft-remove listeners should be disabled if remove option is specified
persistence > persistence options > transaction
✓ should be able to set createdAt and updatedAt if using silent: true (100ms)
✔ should disable transaction when option is specified
✔ should disable transaction when the drivers transactionSupport setting equals `none`
persistence > order of persistence execution operations
should throw exception when non-resolvable circular relations found
✔ should throw CircularRelationsError
should persist all entities in correct order
-
persistence > remove-topological-order
✓ works with custom timestamps with a default value (285ms)
✓ works with custom timestamps and underscored (273ms)
✓ supports transactions
✓ is possible to use casting when creating an instance
✓ is possible to use casting multiple times mixed in with other utilities
✓ is possible to just use .literal() to bypass escaping
✔ should remove depend properties in a proper order
query builder > brackets
✔ should put parentheses in the SQL
✔ should put brackets correctly into WHERE expression
query builder > cache
✓ is possible to use funtions when creating an instance
✓ should escape $ in sequelize functions arguments
✓ should escape multiple instances of $ in sequelize functions arguments
✓ should work with a non-id named uuid primary key columns (328ms)
✓ is possible to use functions as default values
✓ doesn't allow duplicated records with unique:true (40ms)
✔ should cache results properly (1033ms)
✓ raises an error if created object breaks definition constraints
✓ raises an error if created object breaks definition constraints (49ms)
✔ should cache results with pagination enabled properly (1033ms)
✓ raises an error if saving an empty string into a column allowing null or URL (46ms)
✓ raises an error if you mess up the datatype
✓ sets a 64 bit int in bigint (46ms)
✓ sets auto increment fields (47ms)
✓ allows the usage of options as attribute (51ms)
✓ allows sql logging (44ms)
✓ should only store the values passed in the whitelist
✔ should cache results with custom id and duration supplied (2036ms)
✓ should store all values if no whitelist is specified
✓ can omit autoincremental columns (83ms)
✓ saves data with single quote
✓ saves data with double quote
✓ saves stringified JSON data
✔ should cache results with custom id and duration supplied (1068ms)
query builder > comment
✔ should scrub end comment pattern from string
✓ stores the current date in createdAt
✔ should not allow an empty comment
✔ should allow a comment with just whitespaces
✔ should allow a multi-line comment
✔ should include comment in select
✓ allows setting custom IDs
✔ should include comment in update
✓ should allow blank creates (with timestamps: false)
✔ should include comment in insert
✔ should include comment in delete
query builder > composite primary
✔ should find entity by another entity with a composite key
query builder > count
✓ should allow truly blank creates (54ms)
✔ Count query should of empty table should be 0
✓ should only set passed fields (317ms)
✔ Count query should count database values
✓ Works even when SQL query has a values of transaction keywords such as BEGIN TRANSACTION (47ms)
enums
✓ correctly restores enum values (44ms)
✔ Count query should handle ambiguous values
✓ allows null values (47ms)
✔ counting joined query should count database values
when defined via { field: Sequelize.ENUM }
✓ allows values passed as parameters (46ms)
✔ counting joined queries should handle ambiguous values
query builder > cte > materialized
✓ allows values passed as an array (46ms)
✔ should allow MATERIALIZED hint
when defined via { field: { type: Sequelize.ENUM } }
✓ allows values passed as parameters (47ms)
✔ should allow NOT MATERIALIZED hint
✔ should omit hint if materialized option is not set
query builder > cte > recursive
✓ allows values passed as an array (46ms)
✔ should work with simple recursive query
query builder > cte > simple
can safely sync multiple times
✔ show allow select from CTE
✓ through the factory (139ms)
✔ should allow join with CTE
✔ should allow to use INSERT with RETURNING clause in CTE
✔ should allow string for CTE
query builder > delete
✔ should perform deletion correctly
✓ through sequelize (738ms)
[MYSQL] Model
create
include
✔ should be able to delete entities by embed criteria
✓ should create data for BelongsTo relations (104ms)
✔ should return correct delete result
✓ should create data for BelongsTo relations with no nullable FK (101ms)
✔ should throw error when unknown property in where criteria
query builder > distinct on
✔ should perform distinct on category authors
✔ should perform distinct on post authors and moderators combination
✔ should perform distinct on post and category authors
query builder > enabling transaction
✓ should create data for BelongsTo relations with alias (104ms)
✔ should execute query in a transaction
query builder > entity updation
✓ should create data for HasMany relations (116ms)
✔ should update entity model after insertion if updateEntity is set to true
✓ should create data for HasMany relations with alias (115ms)
✔ should not update entity model after insertion if updateEntity is set to false
✔ should not override already set properties
✓ should create data for HasOne relations (109ms)
✔ should update entity model after save
✓ should create data for HasOne relations with alias (106ms)
✔ should update special entity properties after entity updation if updateEntity is set to true
✓ should create data for BelongsToMany relations (169ms)
✔ should not update special entity properties after entity updation if updateEntity is set to false
query builder > exist
✔ Exists query of empty table should be false
✓ should create data for polymorphic BelongsToMany relations (165ms)
✔ Exists query of non empty table should be true
query builder > insert
✓ should create data for BelongsToMany relations with alias (155ms)
✔ should perform insertion correctly
[MYSQL] Model
✓ should support logging
findAll
✓ supports transactions (104ms)
✓ should not crash on an empty where array
✓ should throw on an attempt to fetch no attributes
✔ should perform bulk insertion correctly
✓ should not throw if overall attributes are nonempty (96ms)
special where conditions/smartWhere object
✓ should be able to find rows where attribute is in a list of values
✓ should not break when trying to find rows using an array of primary keys
✔ should be able to use sql functions
✓ should not break when using smart syntax on binary fields
✓ should be able to find a row using like
✓ should be able to find a row using not like
✓ should be able to find a row between a certain date using the between shortcut
✓ should be able to find a row not between a certain integer using the not between shortcut
✓ should be able to handle false/true values just fine...
✔ should be able to insert entities with different properties set even inside embeds
query builder > insertion > on conflict
✔ should perform insertion correctly using onConflict
✔ should support alias in insert
✔ should perform insertion correctly using orIgnore
✔ should perform insertion correctly using orUpdate
✔ should perform insertion on partial index using orUpdate
✔ should perform insertion using partial index and skipping update on no change
✔ should throw error if using indexPredicate amd an unsupported driver
query builder > joins
leftJoinAndSelect
✓ should be able to handle false/true values through associations as well... (184ms)
✓ should be able to handle binary values through associations as well... (166ms)
✓ should be able to find a row between a certain date
✓ should be able to find a row between a certain date and an additional where clause
✓ should be able to find a row not between a certain integer
✓ should be able to find a row using not between and between logic
✓ should be able to find a row using not between and between logic with dates
✓ should be able to find a row using greater than or equal to logic with dates
✓ should be able to find a row using greater than or equal to logic with moment dates
✓ should be able to find a row using greater than or equal to
✓ should be able to find a row using greater than
✓ should be able to find a row using lesser than or equal to
✓ should be able to find a row using lesser than
✓ should have no problem finding a row using lesser and greater than
✓ should be able to find a row using not equal to logic
✓ should be able to find multiple users with any of the special where logic properties
eager loading
✓ should not ignore where condition with empty includes, #8771
belongsTo
✓ throws an error about unexpected input if include contains a non-object
✓ throws an error if included DaoFactory is not associated
✔ should load data for all relation types (65ms)
✓ returns the associated worker via task.worker
✓ returns the associated worker via task.worker, using limit and sort
hasOne
✓ throws an error if included DaoFactory is not associated
✓ returns the associated task via worker.task
hasOne with alias
✓ throws an error if included DaoFactory is not referenced by alias
✓ throws an error if alias is not associated
✓ returns the associated task via worker.task
✓ returns the associated task via worker.task when daoFactory is aliased with model
hasMany
✓ throws an error if included DaoFactory is not associated
✔ should load data when additional condition used
✓ returns the associated tasks via worker.tasks
✓ supports sorting on renamed sub-query attribute (164ms)
✓ supports sorting DESC on renamed sub-query attribute (181ms)
✓ supports sorting on multiple renamed sub-query attributes (179ms)
hasMany with alias
✓ throws an error if included DaoFactory is not referenced by alias
✓ throws an error if alias is not associated
✓ returns the associated task via worker.task
✓ returns the associated task via worker.task when daoFactory is aliased with model
queryOptions
✓ should return a DAO when queryOptions are not set
✓ should return a DAO when raw is false
✓ should return raw data when raw is true
✔ should load data when join tables does not have direct relation
innerJoinAndSelect
include all
✓ includes all associations
✓ includes specific type of association
✔ should load only exist data for all relation types
✓ utilises specified attributes
✓ is over-ruled by specified include
✓ includes all nested associations
properly handles attributes:[] cases
✔ should load data when additional condition used
✓ N:M with ignoring include.attributes only
✓ N:M with ignoring through.attributes only
✓ N:M with ignoring include.attributes but having through.attributes
order by eager loaded tables
HasMany
✓ sorts simply
✓ sorts by 1st degree association
✔ should not return any result when related data does not exist
leftJoinAndMap
✓ sorts simply and by 1st degree association with limit where 1st degree associated instances returned for second one and not the first
✓ sorts by 2nd degree association
✓ sorts by 2nd degree association with alias
✓ sorts by 2nd degree association with alias while using limit
ManyToMany
✓ sorts by 1st degree association
✓ sorts by 1st degree association while using limit
✔ should load and map selected data when entity used as join argument
✓ sorts by through table attribute
normal findAll
✓ finds all entries
✓ can also handle object notation
✓ sorts the results via id in ascending order
✓ sorts the results via id in descending order
✓ sorts the results via a date column
✓ handles offset and limit
✓ should allow us to find IDs using capital letters (62ms)
✓ should be possible to order by sequelize.col() (40ms)
✓ should pull in dependent fields for a VIRTUAL
✓ should pull in dependent fields for a VIRTUAL in include (188ms)
✓ should throw for undefined where parameters
findAndCountAll
✓ supports transactions (124ms)
✓ handles where clause {only}
✔ should load and map selected data when table name used as join argument
✓ handles where clause with ordering {only}
✓ handles offset
✓ handles limit
✓ handles offset and limit
✓ handles offset with includes (180ms)
✓ handles attributes
all
✓ supports transactions (111ms)
✓ should return all users
rejectOnEmpty mode
✓ works from model options (45ms)
✓ throws custom error with initialized (45ms)
✓ throws custom error with instance (46ms)
[MYSQL] Model
findAll
group
✓ should correctly group with attributes, #3009 (131ms)
✓ should not add primary key when grouping using a belongsTo association (153ms)
[MYSQL] Model
findAll
groupedLimit
on: belongsToMany
✔ should load and map selected data when query builder used as join argument
✓ maps attributes from a grouped limit to models
✓ maps attributes from a grouped limit to models with include
✓ [Flaky] works with computed order
✔ should load and map selected data when data will given from same entity but with different conditions
✓ works with multiple orders
✓ works with paranoid junction models
on: hasMany
✓ Applies limit and order correctly
[MYSQL] Model
findAll
order
Sequelize.literal()
✓ should work with order: literal()
✓ should work with order: [literal()]
✔ should load and map selected data when data will given from same property but with different conditions (82ms)
innerJoinAndMap
✓ should work with order: [[literal()]]
injections
✓ should not throw on a literal
✓ should not throw with include when last order argument is a field
[MYSQL] Model
findAll
separate with limit
✓ should not throw syntax error (union) (196ms)
[MYSQL] Model
findOne
✓ supports transactions (120ms)
✓ should support logging
general / basic function
✓ allows bit fields as booleans (49ms)
✓ treats questionmarks in an array
✓ doesn't throw an error when entering in a non integer value for a specified primary field
✓ returns a single dao
✓ returns a single dao given a string id
✓ should make aliased attributes available
✓ should fail with meaningful error message on invalid attributes definition
✓ should not try to convert boolean values if they are not selected
✓ finds a specific user via where option
✔ should load and map selected data when entity used as join argument
✓ doesn't find a user if conditions are not matching
✓ allows sql logging
✓ ignores passed limit option
✓ finds entries via primary keys
✓ finds entries via a string primary key called id
✓ finds entries via a bigint primary key called id
✓ always honors ZERO as primary key
✓ should allow us to find IDs using capital letters (41ms)
eager loading
belongsTo
✓ returns the private and public ip (84ms)
✓ eager loads with non-id primary keys (225ms)
✓ getting parent data in many to one relationship (208ms)
✓ allows mulitple assocations of the same model with different alias (155ms)
generic
✓ throws an error about unexpected input if include contains a non-object
✓ throws an error if included DaoFactory is not associated
✓ returns the associated worker via task.worker (179ms)
hasOne
✓ throws an error if included DaoFactory is not associated
✔ should load and map selected data when table name used as join argument
✓ returns the associated task via worker.task
✓ eager loads with non-id primary keys (322ms)
hasOne with alias
✓ throws an error if included DaoFactory is not referenced by alias
alias
✓ throws an error indicating an incorrect alias was entered if an association and alias exist but the alias doesn't match
✓ returns the associated task via worker.task
✓ returns the associated task via worker.task when daoFactory is aliased with model
✓ allows mulitple assocations of the same model with different alias (246ms)
hasMany
✔ should load and map selected data when query builder used as join argument
✓ throws an error if included DaoFactory is not associated
✓ returns the associated tasks via worker.tasks
✓ including two has many relations should not result in duplicate values (402ms)
✓ eager loads with non-id primary keys (342ms)
hasMany with alias
✓ throws an error if included DaoFactory is not referenced by alias
alias
✓ throws an error indicating an incorrect alias was entered if an association and alias exist but the alias doesn't match
✓ returns the associated task via worker.task
✔ should load and map selected data when data will given from same entity but with different conditions
✓ returns the associated task via worker.task when daoFactory is aliased with model
✓ allows mulitple assocations of the same model with different alias (261ms)
hasMany (N:M) with alias
✓ returns the associated models when using through as string and alias (179ms)
✓ returns the associated models when using through as model and alias (190ms)
queryOptions
✓ should return a DAO when queryOptions are not set
✓ should return a DAO when raw is false
✓ should return raw data when raw is true
rejectOnEmpty mode
✓ throws error when record not found by findOne
✓ throws error when record not found by findByPk
✓ throws error when record not found by find
✓ works from model options
✓ override model options
✓ resolve null when disabled
[MYSQL] Model
findOrBuild
✓ initialize with includes
✔ should load and map selected data when data will given from same property but with different conditions (60ms)
[MYSQL] Model
GEOMETRY
- works with aliases fields
- should create a geometry object
- should update a geometry object
- works with crs field
GEOMETRY(POINT)
- should create a geometry object
- should update a geometry object
- works with crs field
GEOMETRY(LINESTRING)
- should create a geometry object
- should update a geometry object
- works with crs field
GEOMETRY(POLYGON)
- should create a geometry object
- works with crs field
- should update a geometry object
sql injection attacks
- should properly escape the single quotes
- should properly escape the single quotes in coordinates
[MYSQL] Model
increment
✓ supports where conditions
✓ uses correct column names for where conditions
✓ should still work right with other concurrent increments
✓ with array
✓ with single field
✓ with single field and no value
✓ with key value pair
✓ should still work right with other concurrent updates
✓ with timestamps set to true
✓ with timestamps set to true and options.silent set to true
✓ should work with scopes (85ms)
✓ should not care for attributes in the instance scope
✓ should not care for exclude-attributes in the instance scope
✓ should not care for include-attributes in the instance scope
decrement
✓ supports where conditions
✓ uses correct column names for where conditions
✓ should still work right with other concurrent increments
✓ with array
✓ with single field
✓ with single field and no value
✓ with key value pair
✓ should still work right with other concurrent updates
✓ with timestamps set to true (41ms)
✓ with timestamps set to true and options.silent set to true (43ms)
✓ should work with scopes (102ms)
✓ should not care for attributes in the instance scope
✓ should not care for exclude-attributes in the instance scope
✓ should not care for include-attributes in the instance scope
[MYSQL] Model
JSON
✓ findOrCreate supports transactions, json and locks
create
✓ should create an instance with JSON data
update
✓ should update with JSON column (dot notation)
✓ should update with JSON column (JSON notation)
✓ should update an instance with JSON data
find
✓ should be possible to query a nested value
✓ should be possible to query dates with array operators
✓ should be possible to query a boolean with array operators
✓ should be possible to query a nested integer value
✓ should be possible to query a nested null value
✓ should be possible to query for nested fields with hyphens/dashes, #8718
✓ should be possible to query multiple nested values
✓ should be possible to query a nested value and order results
destroy
✓ should be possible to destroy with where
sql injection attacks
✓ should properly escape the single quotes
✔ should not return any result when related data does not exist
query builder > locking
✓ should properly escape path keys
✓ should properly escape path keys with sequelize.json
✓ should properly escape the single quotes in array
✓ should be possible to find with properly escaped select query
✓ should query an instance with JSONB data and order while trying to inject
[MYSQL] Model
max
✓ type A to C should exist
✓ type D should not exist
[MYSQL] Model
optimistic locking
✓ should increment the version on save
✓ should increment the version on update
✓ prevents stale instances from being saved
✓ increment() also increments the version
✓ decrement() also increments the version
[MYSQL] Model
paranoid
✓ should be able to soft delete with timestamps (47ms)
✓ should be able to soft delete without timestamps (46ms)
JSON
✓ should soft delete with JSON condition
[MYSQL] Model
scope
✓ should be able to merge attributes as array
✓ should work with Symbol operators
✓ should keep symbols after default assignment
✓ should not throw error with sequelize.where
[MYSQL] Model
scope
aggregate
✓ should apply defaultScope
✓ should be able to override default scope
✓ should be able to unscope
✔ should not attach pessimistic read lock statement on query if locking is not used
✓ should be able to apply other scopes
✓ should be able to merge scopes with where
✓ should be able to use where on include
[MYSQL] Model
scope
associations
include
✓ should scope columns properly
✓ should apply default scope when including an associations
✓ should apply default scope when including a model
✓ should be able to include a scoped model
get
it should be able to unscope
✓ hasMany
✓ hasOne
✔ should throw error if pessimistic lock used without transaction
✓ belongsTo
✓ belongsToMany
it should apply default scope
✓ hasMany
✓ hasOne
✓ belongsTo
✓ belongsToMany
it should be able to apply another scope
1) should not throw error if pessimistic lock used with transaction
624 passing (7m)
26 pending
1 failing
1) query builder > locking
should not throw error if pessimistic lock used with transaction:
AssertionError: expected promise not to be rejected but it was rejected with 'QueryFailedError: ER_NOT_SUPPORTED_YE…'
typeorm-0.3.17 end
=========== ERROR EXIT [1]: FULL tidb.log BEGIN ============
[2024/05/17 07:15:25.520 +00:00] [INFO] [printer.go:47] ["Welcome to TiDB."] ["Release Version"=v8.2.0-alpha-184-g9c892270a3] [Edition=Community] ["Git Commit Hash"=9c892270a3fcefb872f6d8d921a32089bf40d25e] ["Git Branch"=HEAD] ["UTC Build Time"="2024-05-17 07:06:37"] [GoVersion=go1.21.0] ["Race Enabled"=false] ["Check Table Before Drop"=false]
[2024/05/17 07:15:25.521 +00:00] [INFO] [printer.go:52] ["loaded config"] [config="{\"host\":\"0.0.0.0\",\"advertise-address\":\"10.233.87.140\",\"port\":4001,\"cors\":\"\",\"store\":\"tikv\",\"path\":\"127.0.0.1:2379\",\"socket\":\"\",\"lease\":\"0\",\"split-table\":false,\"token-limit\":1000,\"temp-dir\":\"/tmp/tidb\",\"tmp-storage-path\":\"/tmp/0_tidb/MC4wLjAuMDo0MDAxLzAuMC4wLjA6OTA4MQ==/tmp-storage\",\"tmp-storage-quota\":-1,\"server-version\":\"\",\"version-comment\":\"\",\"tidb-edition\":\"\",\"tidb-release-version\":\"\",\"keyspace-name\":\"\",\"log\":{\"level\":\"error\",\"format\":\"text\",\"disable-timestamp\":null,\"enable-timestamp\":null,\"disable-error-stack\":null,\"enable-error-stack\":null,\"file\":{\"filename\":\"\",\"max-size\":300,\"max-days\":0,\"max-backups\":0,\"compression\":\"\"},\"slow-query-file\":\"tidb-slow.log\",\"expensive-threshold\":10000,\"general-log-file\":\"\",\"query-log-max-len\":4096,\"enable-slow-log\":true,\"slow-threshold\":300,\"record-plan-in-slow-log\":1,\"timeout\":0},\"instance\":{\"tidb_general_log\":false,\"tidb_pprof_sql_cpu\":false,\"ddl_slow_threshold\":300,\"tidb_expensive_query_time_threshold\":60,\"tidb_expensive_txn_time_threshold\":600,\"tidb_stmt_summary_enable_persistent\":false,\"tidb_stmt_summary_filename\":\"tidb-statements.log\",\"tidb_stmt_summary_file_max_days\":3,\"tidb_stmt_summary_file_max_size\":64,\"tidb_stmt_summary_file_max_backups\":0,\"tidb_enable_slow_log\":true,\"tidb_slow_log_threshold\":300,\"tidb_record_plan_in_slow_log\":1,\"tidb_check_mb4_value_in_utf8\":true,\"tidb_force_priority\":\"NO_PRIORITY\",\"tidb_memory_usage_alarm_ratio\":0.8,\"tidb_enable_collect_execution_info\":true,\"plugin_dir\":\"/data/deploy/plugin\",\"plugin_load\":\"\",\"max_connections\":0,\"tidb_enable_ddl\":true,\"tidb_rc_read_check_ts\":false,\"tidb_service_scope\":\"\"},\"security\":{\"skip-grant-table\":false,\"ssl-ca\":\"\",\"ssl-cert\":\"\",\"ssl-key\":\"\",\"cluster-ssl-ca\":\"\",\"cluster-ssl-cert\":\"\",\"cluster-ssl-key\":\"\",\"cluster-verify-cn\":null,\"session-token-signing-cert\":\"\",\"session-token-signing-key\":\"\",\"spilled-file-encryption-method\":\"plaintext\",\"enable-sem\":false,\"auto-tls\":false,\"tls-version\":\"\",\"rsa-key-size\":4096,\"secure-bootstrap\":false,\"auth-token-jwks\":\"\",\"auth-token-refresh-interval\":\"1h0m0s\",\"disconnect-on-expired-password\":true},\"status\":{\"status-host\":\"0.0.0.0\",\"metrics-addr\":\"\",\"status-port\":9081,\"metrics-interval\":15,\"report-status\":true,\"record-db-qps\":false,\"record-db-label\":false,\"grpc-keepalive-time\":10,\"grpc-keepalive-timeout\":3,\"grpc-concurrent-streams\":1024,\"grpc-initial-window-size\":2097152,\"grpc-max-send-msg-size\":2147483647},\"performance\":{\"max-procs\":0,\"max-memory\":0,\"server-memory-quota\":0,\"stats-lease\":\"0\",\"stmt-count-limit\":5000,\"pseudo-estimate-ratio\":0.8,\"bind-info-lease\":\"3s\",\"txn-entry-size-limit\":6291456,\"txn-total-size-limit\":104857600,\"tcp-keep-alive\":true,\"tcp-no-delay\":true,\"cross-join\":true,\"distinct-agg-push-down\":false,\"projection-push-down\":false,\"max-txn-ttl\":3600000,\"index-usage-sync-lease\":\"\",\"plan-replayer-gc-lease\":\"10m\",\"gogc\":100,\"enforce-mpp\":false,\"stats-load-concurrency\":0,\"stats-load-queue-size\":1000,\"analyze-partition-concurrency-quota\":16,\"plan-replayer-dump-worker-concurrency\":1,\"enable-stats-cache-mem-quota\":true,\"committer-concurrency\":128,\"run-auto-analyze\":true,\"force-priority\":\"NO_PRIORITY\",\"memory-usage-alarm-ratio\":0.8,\"enable-load-fmsketch\":false,\"lite-init-stats\":true,\"force-init-stats\":true,\"concurrently-init-stats\":true},\"prepared-plan-cache\":{\"enabled\":true,\"capacity\":100,\"memory-guard-ratio\":0.1},\"opentracing\":{\"enable\":false,\"rpc-metrics\":false,\"sampler\":{\"type\":\"const\",\"param\":1,\"sampling-server-url\":\"\",\"max-operations\":0,\"sampling-refresh-interval\":0},\"reporter\":{\"queue-size\":0,\"buffer-flush-interval\":0,\"log-spans\":false,\"local-agent-host-port\":\"\"}},\"proxy-protocol\":{\"networks\":\"\",\"header-timeout\":5,\"fallbackable\":false},\"pd-client\":{\"pd-server-timeout\":3},\"tikv-client\":{\"grpc-connection-count\":4,\"grpc-keepalive-time\":10,\"grpc-keepalive-timeout\":3,\"grpc-compression-type\":\"none\",\"grpc-shared-buffer-pool\":false,\"grpc-initial-window-size\":134217728,\"grpc-initial-conn-window-size\":134217728,\"commit-timeout\":\"41s\",\"async-commit\":{\"keys-limit\":256,\"total-key-size-limit\":4096,\"safe-window\":2000000000,\"allowed-clock-drift\":500000000},\"max-batch-size\":128,\"overload-threshold\":200,\"max-batch-wait-time\":0,\"batch-wait-size\":8,\"enable-chunk-rpc\":true,\"region-cache-ttl\":600,\"store-limit\":0,\"store-liveness-timeout\":\"1s\",\"copr-cache\":{\"capacity-mb\":1000},\"copr-req-timeout\":60000000000,\"ttl-refreshed-txn-size\":33554432,\"resolve-lock-lite-threshold\":16,\"max-concurrency-request-limit\":9223372036854775807,\"enable-replica-selector-v2\":true},\"binlog\":{\"enable\":false,\"ignore-error\":false,\"write-timeout\":\"15s\",\"binlog-socket\":\"\",\"strategy\":\"range\"},\"compatible-kill-query\":false,\"pessimistic-txn\":{\"max-retry-count\":256,\"deadlock-history-capacity\":10,\"deadlock-history-collect-retryable\":false,\"pessimistic-auto-commit\":false,\"constraint-check-in-place-pessimistic\":true},\"max-index-length\":3072,\"index-limit\":64,\"table-column-count-limit\":1017,\"graceful-wait-before-shutdown\":0,\"alter-primary-key\":false,\"treat-old-version-utf8-as-utf8mb4\":true,\"enable-table-lock\":false,\"delay-clean-table-lock\":0,\"split-region-max-num\":1000,\"top-sql\":{\"receiver-address\":\"\"},\"repair-mode\":false,\"repair-table-list\":[],\"isolation-read\":{\"engines\":[\"tikv\",\"tiflash\",\"tidb\"]},\"new_collations_enabled_on_first_bootstrap\":true,\"experimental\":{\"allow-expression-index\":false},\"skip-register-to-dashboard\":false,\"enable-telemetry\":false,\"labels\":{},\"enable-global-index\":false,\"deprecate-integer-display-length\":false,\"enable-enum-length-limit\":true,\"stores-refresh-interval\":60,\"enable-tcp4-only\":false,\"enable-forwarding\":false,\"max-ballast-object-size\":0,\"ballast-object-size\":0,\"transaction-summary\":{\"transaction-summary-capacity\":500,\"transaction-id-digest-min-duration\":2147483647},\"enable-global-kill\":true,\"enable-32bits-connection-id\":true,\"initialize-sql-file\":\"\",\"enable-batch-dml\":false,\"mem-quota-query\":1073741824,\"oom-action\":\"cancel\",\"oom-use-tmp-storage\":true,\"check-mb4-value-in-utf8\":true,\"enable-collect-execution-info\":true,\"plugin\":{\"dir\":\"/data/deploy/plugin\",\"load\":\"\"},\"max-server-connections\":0,\"run-ddl\":true,\"disaggregated-tiflash\":false,\"autoscaler-type\":\"aws\",\"autoscaler-addr\":\"tiflash-autoscale-lb.tiflash-autoscale.svc.cluster.local:8081\",\"is-tiflashcompute-fixed-pool\":false,\"autoscaler-cluster-id\":\"\",\"use-autoscaler\":false,\"tidb-max-reuse-chunk\":64,\"tidb-max-reuse-column\":256,\"tidb-enable-exit-check\":false,\"in-mem-slow-query-topn-num\":30,\"in-mem-slow-query-recent-num\":500}"]
[2024/05/17 07:16:01.482 +00:00] [ERROR] [advancer.go:400] ["listen task meet error, would reopen."] [error=EOF]
[2024/05/17 07:16:02.006 +00:00] [ERROR] [tso_client.go:365] ["[tso] update connection contexts failed"] [dc=global] [error="rpc error: code = Canceled desc = context canceled"]
=========== ERROR EXIT [1]: FULL tidb.log END ==============
[Pipeline] }
Cache not saved (inner-step execution failed)
[Pipeline] // cache
[Pipeline] }
[Pipeline] // dir
✓ hasMany
Post stage
[Pipeline] script
[Pipeline] {
[Pipeline] echo
Test failed, archive the log
[Pipeline] }
[Pipeline] // script
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // container
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // node
[Pipeline] }
[Pipeline] // podTemplate
[Pipeline] }
✓ hasOne
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
Failed in branch Matrix - TEST_DIR = 'typeorm_test'
Sending interrupt signal to process
Killing processes
kill finished with exit code 0
✓ belongsTo
Terminated
script returned exit code 143
[Pipeline] }
Cache not saved (inner-step execution failed)
[Pipeline] // cache
[Pipeline] }
[Pipeline] // dir
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // container
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // node
[Pipeline] }
[Pipeline] // podTemplate
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
Failed in branch Matrix - TEST_DIR = 'sequelize_test'
[Pipeline] // parallel
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // timeout
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // container
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // node
[Pipeline] }
[Pipeline] // podTemplate
[Pipeline] End of Pipeline
ERROR: script returned exit code 1
Finished: FAILURE