✔ should not create new type if same `enumName` is used more than once
✔ should change both ENUM value and ENUM name and revert change
✔ should rename ENUM when column renamed and revert rename
✔ should rename ENUM when table renamed and revert rename
database schema > column types > mssql
✔ all types should work correctly - persist and hydrate
✔ all types should work correctly - persist and hydrate when options are specified on columns
✔ all types should work correctly - persist and hydrate when types are not specified on columns
database schema > column types > mysql
tidb-server(PID: 309) started
loading test data to db ...
✔ all types should work correctly - persist and hydrate
✔ all types should work correctly - persist and hydrate when options are specified on columns
✔ all types should work correctly - persist and hydrate when types are not specified on columns
database schema > column types > oracle
✔ all types should work correctly - persist and hydrate
✔ all types should work correctly - persist and hydrate when options are specified on columns
✔ all types should work correctly - persist and hydrate when types are not specified on columns
database schema > column types > postgres
✔ all types should work correctly - persist and hydrate
✔ all types should work correctly - persist and hydrate when options are specified on columns
✔ all types should work correctly - persist and hydrate when types are not specified on columns
database schema > column types > postgres-enum
✔ should create table with ENUM column and save data to it
✔ should create ENUM column and revert creation
✔ should drop ENUM column and revert drop
✔ should create table with ENUM column and revert creation
✔ should drop table with ENUM column and revert drop
✔ should change non-enum column in to ENUM and revert change
✔ should change ENUM column in to non-enum and revert change
✔ should change ENUM array column in to non-array and revert change
✔ should change ENUM value and revert change
✔ should change `enumName` and revert change
✔ should not create new type if same `enumName` is used more than once
✔ should change both ENUM value and ENUM name and revert change
✔ should rename ENUM when column renamed and revert rename
✔ should rename ENUM when table renamed and revert rename
database schema > column types > sap
✔ all types should work correctly - persist and hydrate
✔ all types should work correctly - persist and hydrate when options are specified on columns
✔ all types should work correctly - persist and hydrate when types are not specified on columns
database schema > column types > spanner
✔ all types should work correctly - persist and hydrate
✔ all types should work correctly - persist and hydrate when options are specified on columns
✔ all types should work correctly - persist and hydrate when types are not specified on columns
database schema > column types > sqlite
✔ all types should work correctly - persist and hydrate
✔ all types should work correctly - persist and hydrate when types are not specified on columns
database schema > column width
> sequelize@0.0.0-development build
> node ./build.js
✔ all types should be created with correct width
Compiling sequelize...
✔ should update data type display width (154ms)
database schema > custom constraint names > foreign 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 > index
✔ should set custom constraint names
✔ should load constraints with custom names
PASS src/__tests__/integration/tidb/runtime.test.ts (14.179 s)
Test Suites: 2 passed, 2 total
Tests: 130 passed, 130 total
Snapshots: 130 passed, 130 total
Time: 29.602 s
✔ should not change constraint names when table renamed (51ms)
✔ should not change constraint names when column renamed (39ms)
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
✔ should set custom constraint names
> sequelize@0.0.0-development teaser
> node test/teaser.js
prisma-4.16.x end
[Pipeline] }
Cache not saved (ws/jenkins-pingcap-tidb-merged_integration_nodejs_test-1172/tidb-test already exists)
[Pipeline] // cache
[Pipeline] }
###########################
# Running tests for mysql #
###########################
✔ should load constraints with custom names
✔ should not change constraint names when table renamed (48ms)
[Pipeline] // dir
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // container
[Pipeline] }
✔ should not change constraint names when column renamed (43ms)
database schema > enums
✔ should correctly use default values
✔ should correctly save and retrieve
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // node
[Pipeline] }
[Pipeline] // podTemplate
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
✔ should not generate queries when no model changes
database schema > enum arrays
✔ should correctly create default values
✔ should correctly save and retrieve
database schema > generated columns > cockroachdb
✔ should not generate queries when no model changes
✔ should create table with generated columns
✔ should add generated column and revert add
✔ should drop generated column and revert drop
✔ should change generated column and revert change
✔ should remove data from 'typeorm_metadata' when table dropped
database schema > generated columns > mssql
✔ should not generate queries when no model changes
✔ should create table with generated columns
✔ should add generated column and revert add
✔ should drop generated column and revert drop
✔ should change generated column and revert change
✔ should remove data from 'typeorm_metadata' when table dropped
database schema > generated columns > mysql
> sequelize@0.0.0-development test-integration
> yarn mocha --timeout 60000 --exit "test/integration/**/*.test.[tj]s"
✔ should not generate queries when no model changes
yarn run v1.22.19
✔ should create table with generated columns
- should add generated column and revert add
- should drop generated column and revert drop
- should change generated column and revert change
$ mocha -r ./test/registerEsbuild --timeout 60000 --exit 'test/integration/**/*.test.[tj]s'
✔ should remove data from 'typeorm_metadata' when table dropped (122ms)
database schema > generated columns > oracle
✔ should not generate queries when no model changes
✔ should create table with generated columns
✔ should add generated column and revert add
✔ should drop generated column and revert drop
✔ should change generated column and revert change
✔ should remove data from 'typeorm_metadata' when table dropped
database schema > generated columns > postgres
✔ should not generate queries when no model changes
✔ should create table with generated columns
✔ should add generated column and revert add
✔ should drop generated column and revert drop
✔ should change generated column and revert change
✔ should remove data from 'typeorm_metadata' when table dropped
database schema > generated columns > spanner
✔ should not generate queries when no model changes
✔ should create table with generated columns
✔ should add generated column and revert add
✔ should drop generated column and revert drop
✔ should change generated column and revert change
✔ should remove data from 'typeorm_metadata' when table dropped
database schema > generated columns > sqlite
✔ should not generate queries when no model changes
✔ should create table with generated columns
✔ should add generated column and revert add
✔ should drop generated column and revert drop
✔ should change generated column and revert change
✔ should remove data from 'typeorm_metadata' when table dropped
database schema > indices > reading index from entity and updating database
✔ should create a non unique index with 2 columns
[MYSQL] Alias
✓ should uppercase the first letter in alias getter, but not in eager loading (136ms)
✓ shouldnt touch the passed alias (87ms)
✓ should allow me to pass my own plural and singular forms to hasMany (83ms)
✓ should allow me to define plural and singular forms on the model (69ms)
[MYSQL] BelongsToMany
getAssociations
- supports transactions
✓ gets all associated objects with all fields
✔ should update the index to be unique (1409ms)
✓ gets all associated objects when no options are passed
✓ only get objects that fulfill the options
✓ supports a where not in
✓ supports a where not in on the primary key
✔ should update the index swapping the 2 columns (1399ms)
database schema > mssql-parameters
✔ should correctly insert/update/delete entities on SqlServer driver
database-schema > rowid-column
✔ should create `rowid` generated column
sequences > creating a sequence and marking the column as generated
create table and check that primary key column is marked as generated
✔ should check that the primary key column is generated automatically
database schema > simple-enums
✔ should correctly use default values
✔ should correctly save and retrieve
database schema > simple enum arrays
✔ should correctly create default values
✔ should correctly save and retrieve
decorators > embedded
basic functionality
✔ should persist and load entities with embeddeds properly
✓ only gets objects that fulfill options with a formatted value
✔ should be used with prop
query builder > relation-count-decorator-many-to-many > many-to-many
✓ get associated objects with an eager load
✔ should load relation count on owner side (38ms)
✓ get associated objects with an eager load with conditions but not required (43ms)
✔ should load relation count on owner side with limitation
✓ should support schemas (261ms)
✔ should load relation count on owner side with additional conditions (68ms)
✓ supports custom primary keys and foreign keys (271ms)
✔ should load relation count on both sides of relation (46ms)
✓ supports primary key attributes with different field and attribute names (267ms)
✔ should load relation count on inverse side (50ms)
✔ should load relation count on inverse side with limitation (40ms)
✔ should load relation count on inverse side with additional conditions (42ms)
decorators > relation-count-decorator > one-to-many
✓ supports non primary key attributes for joins (sourceKey only) (2943ms)
✔ should load relation count (54ms)
decorators > relation-id-decorator > many-to-many
✔ should load ids when RelationId decorator used on owner side (45ms)
✔ should load ids when RelationId decorator used on owner side with additional condition
✔ should load ids when RelationId decorator used on owner side without inverse side
✓ supports non primary key attributes for joins (targetKey only) (2936ms)
✔ should load ids when RelationId decorator used on owner side without inverse side and with additional condition
✔ should load ids when RelationId decorator used on inverse side
✔ should load ids when RelationId decorator used on inverse side with additional condition
✔ should load ids when RelationId decorator used on nested relation (63ms)
✔ should not load ids of nested relations when RelationId decorator used on inherit relation and parent relation was not found
✓ supports non primary key attributes for joins (sourceKey and targetKey) (3135ms)
✔ should load ids when RelationId decorator used on nested relation with additional conditions (63ms)
decorators > relation-id-decorator > many-to-one
✔ should load ids when RelationId decorator used
decorators > relation-id > one-to-many
✓ supports non primary key attributes for joins (custom through model) (4245ms)
✔ should load id when RelationId decorator used
✔ should load id when RelationId decorator used with additional condition
decorators > relation-id > one-to-one
✔ should load ids when loadRelationIdAndMap used on owner side
✓ supports non primary key attributes for joins for getting associations (sourceKey/targetKey) (2937ms)
✔ should load id when loadRelationIdAndMap used on inverse side
deferrable uq constraints should be check at the end of transaction
✔ use initially deferred deferrable uq constraints
✔ use initially immediated deferrable uq constraints
deferrable fk constraints should be check at the end of transaction (#2191)
✔ use initially deferred deferrable fk constraints
✔ use initially immediated deferrable fk constraints
MongoDriver
connection string
✔ should create a connection string for replica sets (146ms)
✔ should create a connection string for non replica sets
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
✔ should return null value in entity property when record column is null
✔ should return true in entity property when record column is true
✔ 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
✔ getters and setters should work correctly
embedded > embedded-many-to-many-case1
owner side
✔ should insert, load, update and remove entities with embeddeds when embedded entity having ManyToMany relation (48ms)
inverse side
✔ should insert, load, update and remove entities with embeddeds when embedded entity having ManyToMany relation (42ms)
embedded > embedded-many-to-many-case2
owner side
✔ should insert, load, update and remove entities with embeddeds when embedded entity having ManyToMany relation (48ms)
inverse side
✔ should insert, load, update and remove entities with embeddeds when embedded entity having ManyToMany relation (43ms)
embedded > embedded-many-to-many-case3
owner side
✔ should insert, load, update and remove entities with embeddeds when embedded entity having ManyToMany relation with multiple primary keys (one PK in each embed) (51ms)
inverse side
✔ should insert, load, update and remove entities with embeddeds when embedded entity having ManyToMany relation with multiple primary keys (one PK in each embed) (49ms)
embedded > embedded-many-to-many-case4
owner side
✔ should insert, load, update and remove entities with embeddeds when embedded entity having ManyToMany relation with multiple primary keys (multiple keys in related entity) (42ms)
inverse side
✔ should insert, load, update and remove entities with embeddeds when embedded entity having ManyToMany relation with multiple primary keys (multiple keys in related entity) (43ms)
embedded > embedded-many-to-many-case5
owner side
✓ supports non primary key attributes for joins (custom foreignKey) (2981ms)
✔ should insert, load, update and remove entities with embeddeds when embedded entity having ManyToMany relation with multiple primary keys (multiple keys in both sides) (44ms)
inverse side
✔ should insert, load, update and remove entities with embeddeds when embedded entity having ManyToMany relation with multiple primary keys (multiple keys in both sides) (47ms)
embedded > embedded-many-to-one-case1
owner side
✔ should insert, load, update and remove entities with embeddeds when embedded entity having ManyToOne relation
inverse side
✔ should insert, load, update and remove entities with embeddeds when embedded entity having ManyToOne relation (40ms)
embedded > embedded-many-to-one-case2
owner side
✓ supports non primary key attributes for joins (custom foreignKey, custom through model) (4311ms)
✓ supports primary key attributes with different field names where parent include is required (342ms)
hasAssociations
- supports transactions
✓ answers false if only some labels have been assigned
✔ should insert, load, update and remove entities with embeddeds when embedded entity having ManyToOne relation
inverse side
✓ answers false if only some labels have been assigned when passing a primary key instead of an object
✓ answers true if all label have been assigned
✓ answers true if all label have been assigned when passing a primary key instead of an object
✓ answers true for labels that have been assigned multitple times (270ms)
✔ should insert, load, update and remove entities with embeddeds when embedded entity having ManyToOne relation
embedded > embedded-many-to-one-case3
owner side
✓ answers true for labels that have been assigned multitple times when passing a primary key instead of an object (268ms)
hasAssociations with binary key
✓ answers true for labels that have been assigned
✓ answer false for labels that have not been assigned
countAssociations
✓ should count all associations
✔ should insert, load, update and remove entities with embeddeds when embedded entity having ManyToOne relation with multiple primary keys (one PK in each embed)
inverse side
✓ should count filtered associations
✓ should count scoped associations
✓ should count scoped through associations
setAssociations
✓ clears associations when passing null to the set-method (130ms)
✔ should insert, load, update and remove entities with embeddeds when embedded entity having ManyToOne relation with multiple primary keys (one PK in each embed)
embedded > embedded-many-to-one-case4
owner side
✓ should be able to set twice with custom primary keys (127ms)
✓ joins an association with custom primary keys (134ms)
✓ supports passing the primary key instead of an object (126ms)
✓ using scope to set associations (173ms)
✓ updating association via set associations with scope (174ms)
✔ should insert, load, update and remove entities with embeddeds when embedded entity having ManyToOne relation with multiple primary keys (multiple keys in related entity)
inverse side
✓ should catch EmptyResultError when rejectOnEmpty is set (128ms)
createAssociations
✓ creates a new associated object (117ms)
- supports transactions
✓ supports setting through table attributes (115ms)
✓ supports using the field parameter (117ms)
addAssociations
✓ supports both single instance and array (113ms)
✔ should insert, load, update and remove entities with embeddeds when embedded entity having ManyToOne relation with multiple primary keys (multiple keys in related entity)
embedded > embedded-many-to-one-case5
owner side
- supports transactions
✓ supports transactions when updating a through model (120ms)
✓ supports passing the primary key instead of an object (135ms)
✔ should insert, load, update and remove entities with embeddeds when embedded entity having ManyToOne relation with multiple primary keys (multiple keys in both sides)
inverse side
✔ should insert, load, update and remove entities with embeddeds when embedded entity having ManyToOne relation with multiple primary keys (multiple keys in both sides)
embedded > embedded-one-to-one
owner side
✔ should insert, load, update and remove entities with embeddeds when embedded entity having OneToOne relation
inverse side
- should insert, load, update and remove entities with embeddeds when embedded entity having OneToOne relation
embedded > embedded-with-special-columns
✓ should not pass indexes to the join table (2811ms)
✓ should catch EmptyResultError when rejectOnEmpty is set (119ms)
✓ should returns array of intermediate table (125ms)
✔ should insert, load, update and remove entities with embeddeds when embeds contains special columns (e.g. CreateDateColumn, UpdateDateColumn, DeleteDateColumn, VersionColumn (1026ms)
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 insert, load, update and remove entities with embeddeds when primary column defined only in embedded entity
embedded > prefix functionality
✔ 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
✔ 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
addMultipleAssociations
✓ supports both single instance and array (118ms)
✓ adds associations without removing the current ones (132ms)
through model validations
✓ runs on add
✓ runs on set
✓ runs on create
optimizations using bulk create, destroy and update
✔ should save successfully and use static methods successfully
✓ uses one insert into statement
✓ uses one delete from statement
join table creation
✔ should reload given entity successfully (335ms)
✓ should work with non integer primary keys (381ms)
✔ should reload exactly the same entity (327ms)
upsert
✔ should upsert successfully
entity schemas > basic functionality
✓ makes join table non-paranoid by default
✓ should allow creation of a paranoid join table
✔ should perform basic operations with entity using repository
foreign keys
✓ should correctly generate underscored keys
✓ should infer otherKey from paired BTM relationship with a through string defined
✓ should infer otherKey from paired BTM relationship with a through model defined
foreign key with fields specified
✔ 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 correctly get associations even after a child instance is deleted (162ms)
✔ should create columns with different options
entity schema > custom constraint names > foreign key
✓ should correctly get associations when doubly linked (145ms)
✓ should be able to handle nested includes properly (217ms)
primary key handling for join table
✓ removes the primary key if it was added by sequelize
✓ keeps the primary key if it was added by the user
without sync
✓ removes all associations
through
paranoid
✓ gets only non-deleted records by default
✓ returns both deleted and non-deleted records with paranoid=false
✔ should set custom constraint names
✓ hasAssociation also respects paranoid option
fetching from join table
✓ should contain the data from the join table on .UserProjects a DAO
✓ should be able to alias the default name of the join table
✓ should be able to limit the join table attributes returned
inserting in join table
add
✓ should insert data provided on the object into the join table
✓ should insert data provided as a second argument into the join table
✔ 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
✔ should set custom constraint names
✔ should load constraints with custom names
✔ should not change constraint names when table renamed (57ms)
✔ should not change constraint names when column renamed (43ms)
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
✔ should set custom constraint names
✓ should be able to add twice (second call result in UPDATE call) without any attributes (and timestamps off) on the through model (397ms)
✔ should load constraints with custom names
✔ should not change constraint names when table renamed (52ms)
✔ should not change constraint names when column renamed (42ms)
entity-schema > embedded - class-instance
✔ should create an table
✔ should not create table with embedded
✔ should create embedded column name with prefix
✔ should create index for embedded
entity-schema > embedded - class-instance
✔ should save entity with embedded
✔ should contains instance of target class embedded entity
entity-schema > embedded - plain-object
✔ should save entity with embedded
✓ should be able to add twice (second call result in UPDATE call) with custom primary keys and without any attributes (and timestamps off) on the through model (388ms)
✔ should contains instance of plain object for embedded entity
entity-schema > exclusions
✔ should create an exclusion constraint
entity-schema > indices > basic
✔ should create a non unique index with 2 columns
✓ should be able to create an instance along with its many-to-many association which has an extra column in the junction table (365ms)
set
✓ should be able to combine properties on the associated objects, and default values
✓ should be able to set twice (second call result in UPDATE calls) without any attributes (and timestamps off) on the through model (362ms)
✔ should update the index to be unique (1423ms)
query with through.where
✓ should support query the through model
removing from the join table
✓ should remove a single entry without any attributes (and timestamps off) on the through model (130ms)
✓ should remove multiple entries without any attributes (and timestamps off) on the through model (126ms)
belongsTo and hasMany at once
source belongs to target
✔ should update the index swaping the 2 columns (1409ms)
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
✔ 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
✓ correctly uses bId in A
target belongs to source
✓ correctly uses bId in A
alias
✓ creates the join table when through is a string (117ms)
✓ creates the join table when through is a model (117ms)
✓ correctly identifies its counterpart when through is a string
✓ correctly identifies its counterpart when through is a model
multiple hasMany
project has owners and users and owners and users have projects
✓ correctly sets user and owner
Foreign key constraints
✓ can cascade deletes both ways by default (159ms)
✓ can restrict deletes both ways (134ms)
✓ can cascade and restrict deletes (132ms)
✓ should be possible to remove all constraints (125ms)
✔ order by id DESC (57ms)
✓ create custom unique identifier (160ms)
Association options
✓ should throw an error if foreignKey and as result in a name clash
allows the user to provide an attribute definition object as foreignKey
✓ works when taking a column directly from the object
thisAssociations
✓ should work with this reference (88ms)
✓ should work with custom this reference (140ms)
✓ should setup correct foreign keys
Eager loading
✓ should load with an alias (143ms)
✓ should load all (130ms)
[MYSQL] BelongsTo
Model.associations
✓ should store all associations when associating to the same table multiple times
get
multiple
✓ should fetch associations for multiple instances (97ms)
getAssociation
✓ supports transactions (98ms)
✓ should be able to handle a where object that's a first class citizen. (91ms)
✓ supports schemas (94ms)
✓ supports schemas when defining custom foreign key attribute #9029 (94ms)
setAssociation
✓ supports transactions (95ms)
✓ can set the association with declared primary keys... (95ms)
✓ clears the association if null is passed (96ms)
✓ should throw a ForeignKeyConstraintError if the associated record does not exist (117ms)
✓ supports passing the primary key instead of an object (107ms)
✔ order by title (41ms)
✓ should support logging (108ms)
✓ should not clobber atributes (97ms)
✓ should set the foreign key value without saving when using save: false (95ms)
✓ supports setting same association twice (92ms)
createAssociation
✓ creates an associated model instance (97ms)
✓ supports transactions (98ms)
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 (87ms)
✓ should set foreignKey on foreign table (180ms)
foreign key constraints
✓ are enabled by default (92ms)
✓ sets to NO ACTION if allowNull: false (88ms)
✓ should be possible to disable them (86ms)
✓ can cascade deletes (97ms)
✓ can restrict deletes (95ms)
✓ can restrict updates (90ms)
✔ where two criteria (47ms)
✓ can cascade updates (97ms)
association column
✓ has correct type and name for non-id primary keys with non-integer type (79ms)
✓ should support a non-primary key as the association column on a target without a primary key (92ms)
✓ should support a non-primary unique key as the association column (97ms)
✓ should support a non-primary key as the association column with a field option (92ms)
✓ should support a non-primary key as the association column in a table with a composite primary key (98ms)
association options
✓ can specify data type for auto-generated relational keys (146ms)
✓ should throw an error if foreignKey and as result in a name clash
✓ 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
Eager loading
✓ should load with an alias (88ms)
✓ should load all (98ms)
[MYSQL] HasMany
Model.associations
✓ should store all assocations when associting to the same table multiple times
count
✓ should not fail due to ambiguous field (99ms)
get
multiple
✓ should fetch associations for multiple instances (89ms)
✓ should fetch associations for multiple instances with limit and order (162ms)
✓ should fetch multiple layers of associations with limit and order with separate=true (166ms)
✔ order by relation (44ms)
✓ should fetch associations for multiple instances with limit and order and a belongsTo relation (148ms)
✓ supports schemas (166ms)
(1:N)
✓ clears associations when passing null to the set-method with omitNull set to true (99ms)
hasAssociation
✓ should only generate one set of foreignKeys
✓ supports transactions (201ms)
✓ does not have any labels assigned to it initially
✓ answers true if the label has been assigned
✓ answers correctly if the label has been assigned when passing a primary key instead of an object
hasAssociations
✔ order by relation with where relation applied (48ms)
✓ supports transactions (302ms)
✓ 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
✓ answers true if all label have been assigned
✓ answers true if all label have been assigned when passing a primary key instead of an object
setAssociations
✓ supports transactions (102ms)
✓ clears associations when passing null to the set-method (99ms)
✓ supports passing the primary key instead of an object (98ms)
addAssociations
✓ supports transactions (100ms)
✓ supports passing the primary key instead of an object (98ms)
addMultipleAssociations
✓ adds associations without removing the current ones (107ms)
✓ handles decent sized bulk creates (188ms)
createAssociations
✓ creates a new associated object (92ms)
✓ creates the object with the association directly (88ms)
✓ supports transactions (103ms)
✓ supports passing the field option (97ms)
✔ order by nested relations (45ms)
getting assocations with options
✓ should treat the where object of associations as a first class citizen (306ms)
✓ gets all associated objects when no options are passed
✓ 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 (50ms)
foreign key constraints
1:m
✓ sets null by default (93ms)
✓ sets to CASCADE if allowNull: false (96ms)
✓ should be possible to remove all constraints (81ms)
✓ can cascade deletes (90ms)
✓ can cascade updates (99ms)
✔ order by complex nested relations (48ms)
✓ can restrict deletes (89ms)
✓ can restrict updates (92ms)
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 (107ms)
✓ infers the keyType if none provided (87ms)
✓ should throw an error if foreignKey and as result in a name clash
(node:677) [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 (161ms)
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 use sourceKey
✔ order by column in embed (43ms)
✓ should count related records
✓ should set right field when add relative
✔ order by relation in embed (51ms)
find options > relations
✓ should create with nested associated models
✔ basic relation (50ms)
✓ should create nested associations with symmetric getters/setters on FK (1688ms)
sourceKey with where clause in include
✓ should use the specified sourceKey instead of the primary key
Eager loading
✓ should load with an alias (91ms)
✓ should load all (90ms)
[MYSQL] HasOne
Model.associations
✓ should store all associations when associating to the same table multiple times
get
multiple
✓ should fetch associations for multiple instances (91ms)
getAssociation
✓ supports transactions (98ms)
✓ should be able to handle a where object that's a first class citizen. (93ms)
✔ complex relation #1 (47ms)
✓ supports schemas (107ms)
setAssociation
✓ supports transactions (107ms)
✓ can set an association with predefined primary keys (102ms)
✓ clears the association if null is passed (104ms)
✓ should throw a ForeignKeyConstraintError if the associated record does not exist (99ms)
✓ supports passing the primary key instead of an object (100ms)
✓ supports updating with a primary key instead of an object (110ms)
✓ supports setting same association twice (93ms)
createAssociation
✓ creates an associated model instance (92ms)
✓ supports transactions (95ms)
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 (108ms)
✓ should support custom primary key field name in sub queries (99ms)
foreign key constraints
✓ are enabled by default (98ms)
✓ sets to CASCADE if allowNull: false (102ms)
✓ should be possible to disable them (87ms)
✓ can cascade deletes (105ms)
✔ complex relation #2 (45ms)
✓ works when cascading a delete with hooks but there is no associate (i.e. "has zero") (101ms)
✓ can cascade updates (102ms)
✓ can restrict deletes (92ms)
✓ can restrict updates (99ms)
association column
✓ has correct type for non-id primary keys with non-integer type (85ms)
✓ should support a non-primary key as the association column on a target with custom primary key (100ms)
✓ should support a non-primary unique key as the association column (94ms)
✓ should support a non-primary unique key as the association column with a field option (100ms)
Association options
✓ can specify data type for autogenerated relational keys (99ms)
✓ 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 (107ms)
✓ should load all (101ms)
[MYSQL] Multiple Level Filters
✓ can filter through belongsTo (158ms)
✓ avoids duplicated tables in query (152ms)
✔ relation in embed (47ms)
find options > select
✓ can filter through hasMany (151ms)
✓ can filter through hasMany connector (136ms)
[MYSQL] associations
scope
1:1
✓ should create, find and include associations with scope values (177ms)
✓ should create included association with scope values (158ms)
1:M
✓ should create, find and include associations with scope values (176ms)
✓ should make the same query if called multiple time (#4470) (183ms)
✓ should created included association with scope values (168ms)
✓ should include associations with operator scope values (164ms)
✔ select id (44ms)
✓ should not mutate scope when running SELECT query (#12868) (165ms)
N:M
on the target
✓ [Flaky] should create, find and include associations with scope values (147ms)
on the through model
✓ should create, find and include associations with scope values (229ms)
[MYSQL] Self
✓ supports freezeTableName (54ms)
✓ can handle 1:m associations (72ms)
✓ can handle n:m associations (115ms)
✓ can handle n:m associations with pre-defined through table (113ms)
[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 (503ms)
context
✓ does not use continuation storage on manually managed transactions
✓ supports several concurrent transactions
✓ supports nested promise chains
✓ does not leak variables to the outer scope (503ms)
✔ select title (43ms)
✓ 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
✓ 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
✓ 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)
✓ 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
✓ passes the transaction to hooks {beforeRestore,afterRestore} when calling Model.restore with individualHooks
✓ passes the transaction to hooks {beforeRestore,afterRestore} when calling Model#restore
[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 (50ms)
✓ calls parse and stringify for JSON (50ms)
✓ calls parse and stringify for DATE (46ms)
✓ calls parse and stringify for DATEONLY (55ms)
✓ calls parse and stringify for TIME (48ms)
✓ calls parse and stringify for BLOB (45ms)
✓ calls parse and stringify for CHAR (47ms)
✓ calls parse and stringify/bindParam for STRING (47ms)
✓ calls parse and stringify for TEXT (53ms)
✔ select title and text (46ms)
✓ calls parse and stringify for BOOLEAN (45ms)
✓ calls parse and stringify for INTEGER (53ms)
✓ calls parse and stringify for DECIMAL (46ms)
✓ calls parse and stringify for BIGINT (42ms)
✓ should handle JS BigInt type (48ms)
✓ should handle TINYINT booleans (44ms)
✓ calls parse and bindParam for DOUBLE (54ms)
✓ calls parse and bindParam for FLOAT (46ms)
✓ calls parse and bindParam for REAL (43ms)
✓ 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 (43ms)
✓ should parse BIGINT as string (42ms)
✓ should allow spaces in ENUM (39ms)
✓ should return YYYY-MM-DD format string for DATEONLY (46ms)
✓ should return set DATEONLY field to NULL correctly (44ms)
✓ should be able to cast buffer as boolean (42ms)
[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 (84ms)
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
[MYSQL Specific] Connection Manager
✓ -FOUND_ROWS can be suppressed to get back legacy behavior (51ms)
✓ 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 (161ms)
✔ select column in embed (45ms)
find options > where
✓ in context of missing relation (151ms)
[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 (53ms)
[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 (47ms)
ConstraintError
✓ Can be intercepted as UniqueConstraintError using .catch (44ms)
✓ Can be intercepted as ValidationError using .catch (43ms)
✓ Supports newlines in keys (41ms)
✓ Works when unique keys are not defined in sequelize (46ms)
✓ adds parent and sql properties (45ms)
[MYSQL] Hooks
associations
1:1
cascade onUpdate
✓ on success
✓ on error
cascade onDelete
#remove
✓ with no errors
✓ with errors
no cascade update
✓ on success
✔ where id (44ms)
✓ 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
✔ where title (40ms)
✓ with errors
M:M
cascade
#remove
✓ with no errors
✓ with errors
no cascade
#remove
✓ with no errors
✔ where two criteria (47ms)
✓ with errors
multiple 1:M
cascade
#remove
✓ with no errors
✓ with errors
multiple 1:M sequential hooks
cascade
#remove
✓ with no errors
✓ with errors
[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
✔ where two criteria without match (44ms)
✓ 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
✓ 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 (159ms)
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
✔ where relation (47ms)
✓ 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
✓ 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 (68ms)
beforeCreate / afterCreate
✓ should pass a DAO instance to the hook (65ms)
beforeDestroy / afterDestroy
✓ should pass a DAO instance to the hook (70ms)
beforeUpdate / afterUpdate
✓ should pass a DAO instance to the hook (73ms)
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
✔ where column and relation (43ms)
✓ 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
✓ 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 (81ms)
✓ should support a belongsTo association reference (89ms)
✓ should support to use associations with Sequelize.col (127ms)
✓ should support a belongsTo association reference with a where (83ms)
✓ should support a empty hasOne include (75ms)
✓ should support a hasOne association reference (73ms)
✓ should support including a belongsTo association rather than a model/as pair (79ms)
✔ where nested relations (45ms)
✓ should support a hasMany association reference (82ms)
✓ should support a hasMany association reference with a where condition (89ms)
✓ should support a belongsToMany association reference (118ms)
✓ should support a simple nested belongsTo -> belongsTo include (129ms)
✓ should support a simple sibling set of belongsTo include (124ms)
✓ should support a simple nested hasOne -> hasOne include (132ms)
✓ should support a simple nested hasMany -> belongsTo include (128ms)
✓ should support a simple nested belongsTo -> hasMany include (130ms)
✓ should support a simple nested hasMany to hasMany include (174ms)
✓ should support an include with multiple different association types (341ms)
✔ where complex nested relations (48ms)
✓ should support specifying attributes (80ms)
✓ should support Sequelize.literal and renaming of attributes in included model attributes (78ms)
✓ should support self associated hasMany (with through) include (81ms)
✓ should support including date fields, with the correct timeszone (105ms)
✓ should support include when retrieving associated objects (128ms)
where
✓ should support Sequelize.and()
✓ should support Sequelize.or()
findAndCountAll
✓ should include associations to findAndCountAll (81ms)
association getter
✓ should support getting an include on a N:M association getter (138ms)
right join
✓ should support getting an include with a right join (74ms)
✓ should support getting an include through with a right join (110ms)
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)
✔ where or + optional relations (44ms)
✓ 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 (239ms)
✓ should accept nested `where` and `limit` at the same time (173ms)
✓ should support an include with multiple different association types (434ms)
✓ should support many levels of belongsTo (460ms)
✔ where column in embed (60ms)
✓ should support many levels of belongsTo (with a lower level having a where) (500ms)
✓ should support ordering with only belongsTo includes (133ms)
✓ should include attributes from through models (126ms)
✓ should support a required belongsTo include (83ms)
✓ should be possible to extend the on clause with a where option on a belongsTo include (88ms)
✓ 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 (129ms)
✓ should be possible to define a belongsTo include as required with child hasMany with limit (138ms)
✓ should be possible to define a belongsTo include as required with child hasMany with limit and aliases (139ms)
✓ should be possible to define a belongsTo include as required with child hasMany which is not required with limit (140ms)
✓ should be possible to extend the on clause with a where option on a hasOne include (101ms)
✔ where relation in embed (50ms)
✓ should be possible to extend the on clause with a where option on a hasMany include with a through model (133ms)
✓ should be possible to extend the on clause with a where option on nested includes (372ms)
✓ should be possible to use limit and a where with a belongsTo include (88ms)
✓ should be possible use limit, attributes and a where on a belongsTo with additional hasMany includes (507ms)
✓ should be possible to have the primary key in attributes (89ms)
✓ should be possible to turn off the attributes for the through table (482ms)
✔ where complex with or + and (49ms)
✓ should be possible to select on columns inside a through table (464ms)
✓ should be possible to select on columns inside a through table and a limit (510ms)
✓ should be possible not to include the main id in the attributes (95ms)
✔ where relations with operators (60ms)
✓ should be possible to use limit and a where on a hasMany with additional includes (959ms)
✓ should be possible to use limit and a where on a hasMany with a through model with additional includes (498ms)
✓ should support including date fields, with the correct timeszone (112ms)
✓ should still pull the main record(s) when an included model is not required and has where restrictions without matches (121ms)
✓ should work with paranoid, a main record where, an include where, and a limit (93ms)
✓ should work on a nested set of required 1:1 relations (119ms)
✓ should work with an empty include.where (161ms)
✓ should be able to order on the main table and a required belongsTo relation with custom tablenames and limit (95ms)
✓ should ignore include with attributes: [] (used for aggregates) (88ms)
✓ should ignore include with attributes: [] and through: { attributes: [] } (used for aggregates) (135ms)
✔ should not apply inner join if all conditions return undefined (49ms)
✓ should not add primary key when including and aggregating with raw: true (87ms)
✓ should return posts with nested include with inner join with a m:n association (208ms)
✓ should be able to generate a correct request with inner and outer join (161ms)
✓ should be able to generate a correct request for entity with 1:n and m:1 associations and limit (494ms)
✓ should allow through model to be paranoid (136ms)
[MYSQL] Include
findAndCountAll
✓ should be able to include two required models with a limit. Result rows should match limit. (111ms)
✔ should apply inner join if true is applied (45ms)
find options > where
✔ should skip undefined properties
✔ should skip null properties
find options > opaque-types-over-primitives
✓ should be able to include a required model. Result rows should match count (187ms)
✔ should work in select
✔ should work in where
✓ should count on a where and not use an uneeded include (88ms)
✔ should work in order by
indices > basic unique index test
unique index
✔ 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 work without errors
indices > fulltext index
✓ should return the correct count and rows when using a required belongsTo and a limit (93ms)
✓ should return the correct count and rows when using a required belongsTo with a where condition and a limit (86ms)
- 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
✔ getValue
✔ getValueMap
metadata builder > MetadataArgsUtils
✔ getInheritanceTree
✔ filterByTargetClasses
migrations > generate command
✔ can recognize model changes
✓ should correctly filter, limit and sort when multiple includes and types of associations are present. (217ms)
✔ does not generate when no model changes (237ms)
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 properly work with sequelize.function (100ms)
✔ 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 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
[MYSQL] Include
findOne
✓ should include a non required model, with conditions and two includes N:M 1:M (200ms)
✓ should work with a 1:M to M:1 relation with a where on the last include (123ms)
✔ should save an entity
✔ should remove an entity
✔ 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 include a model with a where condition but no required (84ms)
✓ should include a model with a where clause when the PK field name and attribute name are different (87ms)
✔ should throw an exception if object literal is given instead of constructed entity because it cannot determine what to save
✓ should include a model with a through.where and required true clause when the PK field name and attribute name are different (124ms)
✓ should still pull the main record when an included model is not required and has where restrictions without matches (118ms)
✔ should be able to save and remove entities of different types
persistence > bulk-insert-remove-optimization
✔ should group multiple insert and remove queries
persistence > cascades > example 1
✓ should support a nested include (with a where) (121ms)
✓ should support a belongsTo with the targetKey option (88ms)
✔ should insert everything by cascades properly
persistence > cascades > example 2
✓ should support many levels of belongsTo (with a lower level having a where) (365ms)
✓ should work with combinding a where and a scope (72ms)
[MYSQL] Include
LIMIT
✓ supports many-to-many association with where clause (522ms)
✓ supports 2 levels of required many-to-many associations (592ms)
✓ supports 2 levels of required many-to-many associations with where clause (542ms)
✓ supports 2 levels of required many-to-many associations with through.where clause (540ms)
✔ 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
✓ supports 3 levels of required many-to-many associations with where clause (564ms)
✔ should remove relation
persistence > entity updation
✔ should update generated auto-increment id after saving
✔ should update generated uuid after saving
✓ supports required many-to-many association (561ms)
✔ should update default values after saving
✔ should update special columns after saving
✔ should update even when multiple primary keys are used
✓ supports 2 required many-to-many association (588ms)
✔ should update even with embeddeds
persistence > insert > update-relation-columns-after-insertion
✓ supports required one-to-many association (555ms)
✓ supports required one-to-many association with where clause (513ms)
✔ should work perfectly
persistence > many-to-many
✓ supports required one-to-many association with where clause (findOne) (510ms)
✔ add exist element to exist object with empty many-to-many relation and save it and it should contain a new category
✓ supports 2 levels of required one-to-many associations (528ms)
✓ supports required one-to-many association with nested required many-to-many association (536ms)
✔ remove one element from many-to-many relation should remove from the database as well (47ms)
✓ supports required many-to-many association with nested required one-to-many association (572ms)
✔ remove all elements from many-to-many relation should remove from the database as well (45ms)
✓ supports required many-to-one association with nested many-to-many association with where clause (559ms)
✓ supports required many-to-one association with nested many-to-many association with through.where clause (557ms)
✔ remove all elements (set to null) from many-to-many relation should remove from the database as well (50ms)
✓ supports required many-to-one association with multiple nested associations with where clause (563ms)
✔ remove all elements from many-to-many relation if parent entity is removed (40ms)
persistence > many-to-one bi-directional relation
✓ supports required many-to-one association with nested one-to-many association with where clause (587ms)
[MYSQL] Paranoid
✔ should save a category with a post attached
✓ paranoid with timestamps: false should be ignored / not crash (460ms)
✓ test if non required is marked as false
✓ test if required is marked as true
✔ should save a category and a new post by cascades
✓ should not load paranoid, destroyed instances, with a non-paranoid parent (544ms)
[MYSQL] Includes with schemas
findAll
✓ should support an include with multiple different association types (542ms)
✔ should update exist post by cascades when category is saved
✓ should support many levels of belongsTo (485ms)
✓ should support ordering with only belongsTo includes (137ms)
✓ should include attributes from through models (150ms)
✓ should support a required belongsTo include (92ms)
✓ should be possible to extend the on clause with a where option on a belongsTo include (93ms)
✔ should NOT remove exist post by cascades when category is saved without a post (post is set to undefined)
✓ should be possible to extend the on clause with a where option on a belongsTo include (91ms)
✓ should be possible to define a belongsTo include as required with child hasMany with limit (149ms)
✓ should be possible to define a belongsTo include as required with child hasMany with limit and aliases (152ms)
✓ should be possible to define a belongsTo include as required with child hasMany which is not required with limit (145ms)
✔ should unset exist post when its set to null (44ms)
✓ should be possible to extend the on clause with a where option on a hasOne include (97ms)
✓ should be possible to extend the on clause with a where option on a hasMany include with a through model (140ms)
✓ should be possible to extend the on clause with a where option on nested includes (453ms)
✓ should be possible to use limit and a where with a belongsTo include (103ms)
✔ should set category's post to NULL when post is removed from the database (database ON DELETE)
✓ should be possible use limit, attributes and a where on a belongsTo with additional hasMany includes (553ms)
✔ should work when relation id is directly set into relation (without related object)
persistence > many-to-one uni-directional relation
✓ should be possible to use limit and a where on a hasMany with additional includes (571ms)
✓ should be possible to use limit and a where on a hasMany with a through model with additional includes (547ms)
✔ should save a category with a post attached
✓ should support including date fields, with the correct timezone (130ms)
findOne
✓ should work with schemas (93ms)
[MYSQL] Include
separate
✓ should run a hasMany association in a separate query (111ms)
✓ should work even if the id was not included (97ms)
✓ should work even if include does not specify foreign key attribute with custom sourceKey (103ms)
✓ should not break a nested include with null values (140ms)
✔ should save a category and a new post by cascades
✓ should run a hasMany association with limit in a separate query (103ms)
✓ should run a nested (from a non-separate include) hasMany association in a separate query (154ms)
✓ should work having a separate include between a parent and child include (201ms)
✓ should run two nested hasMany association in a separate queries (159ms)
✓ should work with two schema models in a hasMany association (118ms)
✔ should update exist post by cascades when category is saved
✓ should work with required non-separate parent and required child (161ms)
[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
✔ should NOT remove exist post by cascades when category is saved without a post (post is set to undefined)
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
✓ escapes two single quotes properly in where clauses
✔ should unset exist post when its set to null
✓ 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 (42ms)
✓ 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
✔ should set category's post to NULL when post is removed from the database (database ON DELETE)
✓ can reuse query option objects
findOne
✓ can reuse query option objects
✓ returns null for null, undefined, and unset boolean values (44ms)
equals
✓ can compare records with Date field
✓ does not compare the existence of associations (106ms)
values
✓ returns all values (38ms)
✔ should work when relation id is directly set into relation (without related object)
persistence > multi primary keys
insert
isSoftDeleted
✓ should return false when model is just created
✓ returns false if user is not soft deleted
✓ returns true if user is soft deleted
✓ works with custom `deletedAt` field name (50ms)
restore
✓ returns an error if the model is not paranoid
✓ restores a previously deleted model (50ms)
✓ supports custom deletedAt field (57ms)
✓ supports custom deletedAt field name (53ms)
✔ should insert entity when there are multi column primary keys
persistence > multi primary keys on both sides
insert
✓ supports custom deletedAt field and database column (48ms)
✓ supports custom default value (52ms)
[MYSQL] InstanceValidator
✓ correctly validates using custom validation methods
✓ supports promises with custom validation methods (45ms)
✓ 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 (47ms)
✓ 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 (51ms)
✓ should be able to emit an error upon updating when a validation has failed from an instance (128ms)
✓ should be able to emit an error upon updating when a validation has failed from the factory (41ms)
✓ should enforce a unique constraint (48ms)
✓ should allow a custom unique constraint error message (45ms)
✓ should handle multiple unique messages correctly (44ms)
#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 (39ms)
✓ should emit an error when we try to enter in a string for an auto increment key (not named id) (38ms)
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 insert entity when there are multi column primary keys
persistence > null and default behaviour
✓ 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
✔ should insert value if it is set
✔ should insert default when post.title is undefined
✓ produce 3 errors
not null schema validation
✔ should insert NULL when post.title is null
✔ should update nothing when post.title is undefined
✓ correctly throws an error using create method
✓ correctly throws an error using create method with default generated messages
[MYSQL] Instance
decrement
✔ should update to null when post.title is null
persistence > one-to-many
✓ supports transactions (107ms)
✓ 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 (46ms)
✓ with timestamps set to true and options.silent set to true (44ms)
[MYSQL] Instance
destroy
✓ supports transactions (47ms)
✓ does not set the deletedAt date in subsequent destroys if dao is paranoid (49ms)
✓ does not update deletedAt with custom default in subsequent destroys (44ms)
✓ deletes a record from the database if dao is not paranoid (49ms)
✓ allows updating soft deleted instance (46ms)
✓ supports custom deletedAt field (46ms)
✓ supports custom deletedAt database column (43ms)
✔ should add exist element to exist object with empty one-to-many relation and save it
✓ supports custom deletedAt field and database column (46ms)
✓ persists other model changes when soft deleting (47ms)
✓ allows sql logging of delete statements (45ms)
✓ allows sql logging of update statements (46ms)
✓ should not call save hooks when soft deleting (43ms)
✓ delete a record of multiple primary keys table (47ms)
[MYSQL] Instance
increment
✓ supports transactions (103ms)
✓ 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
✓ single value should work when field name is different from database column name
✔ should add exist element to new object with empty one-to-many relation and save it
✓ 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 (43ms)
✓ with timestamps set to true and options.silent set to true (43ms)
[MYSQL] Instance
reload
✓ supports transactions (109ms)
✓ 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 (103ms)
✔ should remove exist element from one-to-many relation and save it (53ms)
✓ should update internal options of the instance (123ms)
✓ should return an error when reload fails
✓ should set an association to null after deletion, 1-1 (223ms)
✓ should set an association to empty after all deletion, 1-N (220ms)
✓ should update the associations after one element deleted (224ms)
✔ should remove all elements from one-to-many relation and save it
✓ should inject default scope when reloading (104ms)
[MYSQL] Instance
save
✓ supports transactions (109ms)
✓ only updates fields in passed array
✓ should work on a model with an attribute named length (48ms)
✓ only validates fields in passed array
✓ stores an entry in the database
✓ handles an entry with primaryKey of zero (46ms)
✓ updates the timestamps
✔ 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
✓ 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 have an access token
doesn't allow the same relation to be used twice
✓ should fail a validation upon creating
✓ should fail a validation upon creating with hooks false
✔ should reject the saving attempt (65ms)
persistence > orphanage > delete
when a Post is removed from a Category
✓ should fail a validation upon building
✓ should fail a validation when updating
✓ takes zero into account
✓ saves a record with no primary key (47ms)
hooks
✓ should update attributes added in hooks when default fields are used (50ms)
✓ should update attributes changed in hooks when default fields are used (47ms)
✓ should validate attributes added in hooks when default fields are used (50ms)
✓ should validate attributes changed in hooks when default fields are used (47ms)
when nothing changed
✓ does not update timestamps
✓ should not throw ER_EMPTY_QUERY if changed only virtual fields (43ms)
✔ should retain a Post on the Category
without timestamps option
✓ doesn't update the updatedAt column (43ms)
with custom timestamp options
✓ updates the createdAt column if updatedAt is disabled (43ms)
✓ updates the updatedAt column if createdAt is disabled (44ms)
✓ works with `allowNull: false` on createdAt and updatedAt columns (42ms)
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
✔ should delete the orphaned Post from the database
✓ 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
✔ should retain foreign keys on remaining Posts
persistence > orphanage > disable
when a User is updated without all settings being loaded...
✓ 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 (103ms)
✓ should update fields that are not specified on create (44ms)
✓ should succeed in updating when values are unchanged (without timestamps) (49ms)
✓ should update timestamps with milliseconds (45ms)
✔ should not delete setting with orphanedRowAction=disabed
✓ should only save passed attributes
✓ should save attributes affected by setters
✓ should not set attributes that are not specified by fields (47ms)
✓ updates attributes in the database
✓ ignores unknown attributes
✓ ignores undefined attributes (98ms)
✓ doesn't update primary keys or timestamps (43ms)
✓ stores and restores null values (47ms)
✓ should support logging
hooks
✓ should update attributes added in hooks when default fields are used (43ms)
✓ should update attributes changed in hooks when default fields are used (46ms)
✔ should not orphane any Settings
persistence > partial persist
✓ should validate attributes added in hooks when default fields are used (41ms)
✓ should validate attributes changed in hooks when default fields are used (41ms)
✔ should persist partial entities without data loss (48ms)
persistence > persistence options > chunks
✔ should save objects in chunks
persistence > persistence options > listeners
[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 (42ms)
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
✔ save listeners should work by default
✓ should work with save (39ms)
✓ 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 (38ms)
✓ should return true if previous value is different
✓ should return false immediately after saving (38ms)
✔ save listeners should be disabled if save option is specified
✓ should be available to a afterUpdate hook (45ms)
previous
✓ should return an object with the previous values
✓ should return the previous value
model
json
✓ should tell me that a column is json
✔ remove listeners should work by default
✓ should use a placeholder for json with insert
✔ remove listeners should be disabled if remove option is specified
✓ should insert json using a custom field name (40ms)
✔ soft-remove listeners should work by default
✔ soft-remove listeners should be disabled if remove option is specified
persistence > persistence options > transaction
✓ should update json using a custom field name (47ms)
✔ 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
✓ should be able retrieve json value as object
✓ should be able to retrieve element of array by index
✓ 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 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 be able to query using dot notation
✔ 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
✓ 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
✔ should cache results properly (1029ms)
✔ should cache results with pagination enabled properly (1027ms)
✓ supports multiple async transactions (1927ms)
✓ should be possible to use a key named UUID as foreign key (145ms)
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 (41ms)
✓ 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 (43ms)
✓ should allow me to set a function as default value (40ms)
✓ 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 cache results with custom id and duration supplied (2028ms)
✓ should allow me to override updatedAt, createdAt, and deletedAt fields (44ms)
✓ should allow me to disable some of the timestamp fields (46ms)
✓ returns proper defaultValues after save when setter is set (38ms)
✓ should work with both paranoid and underscored being true (41ms)
✓ allows multiple column unique keys to be defined (38ms)
✓ allows unique on column with field aliases
✔ should cache results with custom id and duration supplied (1028ms)
query builder > comment
✔ should scrub end comment pattern from string
✓ allows us to customize the error message for unique constraint (41ms)
✔ should not allow an empty comment
✔ should allow a comment with just whitespaces
✔ should allow a multi-line comment
✔ should include comment in select
✔ should include comment in update
✔ 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
✔ Count query should of empty table should be 0
✔ Count query should count database values
✔ Count query should handle ambiguous values
✓ allows us to map the customized error message with unique constraint name (1419ms)
- should allow the user to specify indexes in options
descending indices (MySQL 8 specific)
✔ counting joined query should count database values
✔ counting joined queries should handle ambiguous values
query builder > cte > materialized
✔ should allow MATERIALIZED hint
✔ should allow NOT MATERIALIZED hint
✔ should omit hint if materialized option is not set
query builder > cte > recursive
✓ complains about missing support for descending indexes (1420ms)
✔ should work with simple recursive query
query builder > cte > simple
✔ show allow select from CTE
✔ 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
✔ should be able to delete entities by embed criteria
✔ should return correct delete result
✓ works fine with InnoDB (1413ms)
build
✓ doesn't create database entries
✓ fills the objects with default values
✓ fills the objects with default values
✓ attaches getter and setter methods from attribute definition
✔ 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 execute query in a transaction
query builder > entity updation
✓ 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 update entity model after insertion if updateEntity is set to true
✔ should not update entity model after insertion if updateEntity is set to false
✓ should support includes with aliases
findOne
✔ should not override already set properties
✔ should update entity model after save
✓ supports the transaction option in the first parameter (96ms)
✓ should not fail if model is paranoid and where is an empty array (106ms)
✔ should update special entity properties after entity updation if updateEntity is set to true
✔ should not update special entity properties after entity updation if updateEntity is set to false
query builder > exist
✓ should work if model is paranoid and only operator in where clause is a Symbol (#8406) (98ms)
findOrBuild
✔ Exists query of empty table should be false
✓ supports transactions (101ms)
returns an instance if it already exists
✓ with a single find field
✔ Exists query of non empty table should be true
query builder > insert
✓ with multiple find fields
✓ builds a new instance with default value.
save
✔ should perform insertion correctly
✓ should map the correct fields when saving instance (#10589) (102ms)
update
✔ should perform bulk insertion correctly
✓ throws an error if no where clause is given (95ms)
✓ should map the correct fields when updating instance (#10589) (95ms)
✔ should be able to use sql functions
✓ supports transactions (99ms)
✔ 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
✓ updates the attributes that we select only without updating createdAt (43ms)
✓ allows sql logging of updated statements (97ms)
✓ 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 (44ms)
✓ updates attributes that are altered by virtual setters (45ms)
✓ should properly set data when individualHooks are true
✔ should load data for all relation types (46ms)
✓ sets updatedAt to the current timestamp
✓ returns the number of affected rows
✓ does not update soft deleted records when model is paranoid (144ms)
✓ updates soft deleted records when paranoid is overridden (150ms)
✓ calls update hook for soft deleted objects (109ms)
✓ supports limit clause
destroy
✓ `truncate` method should clear the table (131ms)
✓ `truncate` option should clear the table (134ms)
✓ `truncate` option returns a number (134ms)
✓ throws an error if no where clause is given (95ms)
✓ deletes all instances when given an empty where object (96ms)
✓ throws an error if where has a key with undefined value (92ms)
✓ supports transactions (94ms)
✓ deletes values that match filter
✓ works without a primary key (43ms)
✓ supports .field (41ms)
✓ sets deletedAt to the current timestamp if paranoid is true (60ms)
✔ should load data when additional condition used
✓ does not set deletedAt for previously destroyed instances if paranoid is true (48ms)
✓ should include deleted associated records if include has paranoid marked as false (165ms)
✓ should delete a paranoid record if I set force to true (53ms)
✓ returns the number of affected rows
✓ supports table schema/prefix (111ms)
✓ should work if model is paranoid and only operator in where clause is a Symbol (97ms)
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 (47ms)
restore
✓ rejects with an error if the model is not paranoid
✓ restores a previously deleted model (44ms)
equals
✓ correctly determines equality of objects
✓ correctly determines equality with multiple primary keys (39ms)
equalsOneOf
✓ determines equality if one is matching
✓ doesn't determine equality if none is matching
count
✓ supports transactions (103ms)
✓ counts all created objects
✓ returns multiple rows when using group
✓ allows sql logging
✓ filters object
✓ supports distinct option (96ms)
✔ should load data when join tables does not have direct relation
innerJoinAndSelect
aggregate
Executing (default): SELECT `id` AS `id2`, count(`id`) AS `count` FROM `Users` AS `User` GROUP BY `id2`;
(node:677) [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 (100ms)
✓ returns the correct value
✓ allows sql logging
✓ should allow decimals
✓ should allow strings
✓ should allow dates
✔ should load only exist data for all relation types
✓ should work with fields named as an SQL reserved keyword
max
✓ supports transactions (101ms)
✓ 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 load data when additional condition used
✓ should allow decimals in sum
✓ 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 (86ms)
✓ should describeTable using the default schema settings (83ms)
✔ should not return any result when related data does not exist
leftJoinAndMap
✓ should be able to reference a table with a schema set (91ms)
✓ should be able to create and update records under any valid schematic (50ms)
references
✓ uses an existing dao factory and references the author table (57ms)
✓ uses a table name as a string and references the author table (51ms)
- emits an error event as the referenced table name is invalid
✓ works with comments (288ms)
blob
buffers
✓ should be able to take a buffer as parameter to a BLOB field
✓ should return a buffer when fetching a blob
✓ should work when the database returns null
✔ should load and map selected data when entity used as join argument
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 not overwrite a specified deletedAt by setting paranoid: false
✔ should load and map selected data when table name used as join argument
✓ should not overwrite a specified deletedAt (complex query) by setting paranoid: false
Unique
✓ should set unique when unique is true (44ms)
✓ should not set unique when unique is false (38ms)
✓ should not set unique when unique is unset
bulkCreate
✓ errors - should return array of errors if validate and individualHooks are true (95ms)
✓ should not use setter when renaming fields in dataValues (103ms)
[MYSQL] Model
attributes
set
✓ should only be called once when used on a join model called with an association getter (140ms)
✓ allows for an attribute to be called "toString" (44ms)
✓ allows for an attribute to be called "toString" with associations (107ms)
quote
✓ allows for an attribute with dots (40ms)
[MYSQL] Model
attributes
field
✓ increment should work (47ms)
✔ should load and map selected data when query builder used as join argument
✓ decrement should work (45ms)
✓ sum should work (40ms)
✓ should create, fetch and update with alternative field names from a simple model
✓ should bulk update (462ms)
✓ should not contain the field properties after create (41ms)
✓ should make the aliased auto incremented primary key available after create
✔ should load and map selected data when data will given from same entity but with different conditions
✓ 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 load and map selected data when data will given from same property but with different conditions (50ms)
innerJoinAndMap
✓ should work with a where or
✓ should work with bulkCreate and findAll
✓ should support renaming of sequelize method fields (496ms)
✔ should load and map selected data when entity used as join argument
✓ should sync foreign keys with custom field names (436ms)
✓ 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() (103ms)
✓ should work with paranoid Model.destroy() (109ms)
✓ should work with `belongsToMany` association `count`
✔ should load and map selected data when table name used as join argument
✓ 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
✓ find with where should work
✓ reload should work
✔ should load and map selected data when query builder used as join argument
✓ save should work
[MYSQL] Model
attributes
types
VIRTUAL
✓ should not be ignored in dataValues get
✓ should be ignored in table creation
✓ should be ignored in find, findAll and includes
✔ should load and map selected data when data will given from same entity but with different conditions
✓ should allow me to store selected values (423ms)
✓ should be ignored in create and update
✓ 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 (97ms)
✔ should load and map selected data when data will given from same property but with different conditions (43ms)
✓ should not alter options (91ms)
✓ should be able to set createdAt and updatedAt if using silent: true (91ms)
✓ should not fail on validate: true and individualHooks: true (95ms)
✓ should not map instance dataValues to fields with individualHooks: true (95ms)
✔ should not return any result when related data does not exist
✓ should not insert NULL for unused fields (40ms)
query builder > locking
✓ properly handles disparate field lists
✓ 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 not attach pessimistic read lock statement on query if locking is not used
✓ properly handles a model with a length column (40ms)
✓ stores the current date in createdAt
✓ emits an error when validate is set to true (38ms)
✓ doesn't emit an error when validate is set to true but our selectedValues are fine (42ms)
✓ should allow blank arrays (return immediately)
✓ should allow blank creates (with timestamps: false) (39ms)
✔ should throw error if pessimistic lock used without transaction
✓ should allow autoincremented attributes to be set (43ms)
✓ should support schemas (264ms)
✓ should support the ignoreDuplicates option
✓ should properly map field names to attribute names (45ms)
updateOnDuplicate
✓ should support the updateOnDuplicate option
✓ 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
1) should not throw error if pessimistic lock used with transaction
624 passing (6m)
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 10:45:10.607 +00:00] [INFO] [printer.go:47] ["Welcome to TiDB."] ["Release Version"=v8.2.0-alpha-188-g2037a2f52b] [Edition=Community] ["Git Commit Hash"=2037a2f52b3ec2488a404d8da6c201f72c3d3405] ["Git Branch"=HEAD] ["UTC Build Time"="2024-05-17 10:37:16"] [GoVersion=go1.21.0] ["Race Enabled"=false] ["Check Table Before Drop"=false]
[2024/05/17 10:45:10.608 +00:00] [INFO] [cgmon.go:130] ["set the maxprocs"] [quota=6]
[2024/05/17 10:45:10.608 +00:00] [INFO] [printer.go:52] ["loaded config"] [config="{\"host\":\"0.0.0.0\",\"advertise-address\":\"10.233.71.61\",\"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 10:45:13.101 +00:00] [ERROR] [advancer.go:400] ["listen task meet error, would reopen."] [error=EOF]
[2024/05/17 10:45:13.176 +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)
✓ when the primary key column names and model field names are different
[Pipeline] // cache
[Pipeline] }
[Pipeline] // dir
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] }
[Pipeline] // withEnv
✓ when the primary key column names and model field names are different and have unique constraints (43ms)
[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
✓ when the composite primary key column names and model field names are different (42ms)
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