✔ properly loads config from ormconfig.env file
✔ properly loads config ormconfig.env when given multiple choices
cube-postgres
✔ should create correct schema with Postgres' cube type
✔ should persist cube correctly
✔ should update cube correctly
✔ should re-save cube correctly
✔ should persist cube of arity 0 correctly
✔ should be able to order cube by euclidean distance
✔ should persist cube array correctly
custom repository
✔ withRepository must work properly in transactions
database schema > column collation > cockroach
✔ should correctly create column with collation option
database schema > column collation > mssql
✔ should correctly create column with collation option
database schema > column collation > mysql
- should correctly create column with collation option
database schema > column collation > postgres
✔ should correctly create column with collation option
database schema > column collation > sqlite
- should correctly create column with collation option
database schema > column length > mssql
✔ all types should create with correct size
✔ all types should update their size
✔ all relevant types should update their size to max
database schema > column length > mysql
✔ all types should be created with correct length
✔ all types should update their length (204ms)
database schema > column length > postgres
✔ all types should create with correct size
✔ all types should update their size
database schema > column length > sap
✔ all types should create with correct size
✔ all types should update their size
database schema > column length > sqlite
✔ all types should create with correct size
✔ all types should update their size
database schema > column types > cockroachdb
✔ 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 > cockroachdb-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 > 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
✔ 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
tidb-server(PID: 305) started
loading test data to db ...
✔ all types should be created with correct width
✔ should update data type display width (117ms)
database schema > custom constraint names > foreign key
> sequelize@0.0.0-development build
> node ./build.js
Compiling sequelize...
✔ 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
✔ should not change constraint names when table renamed (41ms)
✔ should not change constraint names when column renamed
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 load constraints with custom names
✔ should not change constraint names when table renamed (40ms)
✔ should not change constraint names when column renamed
database schema > enums
✔ should correctly use default values
✔ should correctly save and retrieve
packages/client build: Analysis will use the bundled TypeScript version 5.0.4
✔ 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
✔ 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 (89ms)
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
> sequelize@0.0.0-development teaser
> node test/teaser.js
###########################
# Running tests for mysql #
###########################
> sequelize@0.0.0-development test-integration
> yarn mocha --timeout 60000 --exit "test/integration/**/*.test.[tj]s"
yarn run v1.22.19
$ mocha -r ./test/registerEsbuild --timeout 60000 --exit 'test/integration/**/*.test.[tj]s'
✔ should update the index to be unique (1366ms)
[MYSQL] Alias
✓ should uppercase the first letter in alias getter, but not in eager loading (118ms)
packages/client build: Writing package typings: /home/jenkins/agent/workspace/pingcap/tidb/merged_integration_nodejs_test/tidb-test/prisma_test/prisma-4.16.x/packages/client/runtime/index-browser.d.ts
✓ shouldnt touch the passed alias (86ms)
✓ should allow me to pass my own plural and singular forms to hasMany (77ms)
✓ should allow me to define plural and singular forms on the model (78ms)
[MYSQL] BelongsToMany
getAssociations
- supports transactions
✔ should update the index swapping the 2 columns (1359ms)
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
✔ should be used with prop
query builder > relation-count-decorator-many-to-many > many-to-many
✓ gets all associated objects with all fields
✔ should load relation count on owner side
✓ gets all associated objects when no options are passed
✓ only get objects that fulfill the options
packages/client build: Done
packages/cli build$ node -r esbuild-register helpers/build.ts
packages/react-prisma build$ node -r esbuild-register helpers/build.ts
✔ should load relation count on owner side with limitation
✓ supports a where not in
✔ should load relation count on owner side with additional conditions (64ms)
✓ supports a where not in on the primary key
✓ only gets objects that fulfill options with a formatted value
✓ get associated objects with an eager load
✔ should load relation count on both sides of relation (39ms)
✓ get associated objects with an eager load with conditions but not required (49ms)
✔ should load relation count on inverse side (40ms)
✔ should load relation count on inverse side with limitation (38ms)
✓ should support schemas (251ms)
packages/cli build: Done
✔ should load relation count on inverse side with additional conditions (38ms)
decorators > relation-count-decorator > one-to-many
✓ supports custom primary keys and foreign keys (288ms)
packages/react-prisma build: Done
✓ supports primary key attributes with different field and attribute names (278ms)
> @prisma/integration-tests@0.0.0 test:tidb /home/jenkins/agent/workspace/pingcap/tidb/merged_integration_nodejs_test/tidb-test/prisma_test/prisma-4.16.x/packages/integration-tests
> jest integration.tidb --maxWorkers=1 --silent
✔ should load relation count (47ms)
decorators > relation-id-decorator > many-to-many
✔ should load ids when RelationId decorator used on owner side
✔ 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 (sourceKey only) (2968ms)
✔ 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 (68ms)
✓ supports non primary key attributes for joins (targetKey only) (2951ms)
✔ should not load ids of nested relations when RelationId decorator used on inherit relation and parent relation was not found
✔ should load ids when RelationId decorator used on nested relation with additional conditions (54ms)
decorators > relation-id-decorator > many-to-one
✓ supports non primary key attributes for joins (sourceKey and targetKey) (2970ms)
✔ should load ids when RelationId decorator used
decorators > relation-id > one-to-many
✔ 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
✔ 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 (109ms)
✔ 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
✓ supports non primary key attributes for joins (custom through model) (4345ms)
✔ 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
inverse side
✔ should insert, load, update and remove entities with embeddeds when embedded entity having ManyToMany relation
embedded > embedded-many-to-many-case2
owner side
✔ should insert, load, update and remove entities with embeddeds when embedded entity having ManyToMany relation (38ms)
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) (40ms)
inverse side
PASS src/__tests__/integration/tidb/introspection.test.ts (15.457 s)
✔ should insert, load, update and remove entities with embeddeds when embedded entity having ManyToMany relation with multiple primary keys (one PK in each embed) (43ms)
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) (38ms)
inverse side
✓ supports non primary key attributes for joins for getting associations (sourceKey/targetKey) (2909ms)
✔ should insert, load, update and remove entities with embeddeds when embedded entity having ManyToMany relation with multiple primary keys (multiple keys in related entity) (41ms)
embedded > embedded-many-to-many-case5
owner 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) (41ms)
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) (62ms)
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
✓ supports non primary key attributes for joins (custom foreignKey) (2957ms)
✔ should insert, load, update and remove entities with embeddeds when embedded entity having ManyToOne relation
embedded > embedded-many-to-one-case2
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
embedded > embedded-many-to-one-case3
owner side
✓ supports non primary key attributes for joins (custom foreignKey, custom through model) (4372ms)
✓ supports primary key attributes with different field names where parent include is required (286ms)
✔ should insert, load, update and remove entities with embeddeds when embedded entity having ManyToOne relation with multiple primary keys (one PK in each embed) (38ms)
inverse side
hasAssociations
- supports transactions
✓ 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
✔ 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
✓ answers true for labels that have been assigned multitple times (225ms)
✓ answers true for labels that have been assigned multitple times when passing a primary key instead of an object (233ms)
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 (multiple keys in related entity)
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 (115ms)
✓ should be able to set twice with custom primary keys (111ms)
✔ 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
✓ joins an association with custom primary keys (142ms)
✓ supports passing the primary key instead of an object (127ms)
PASS src/__tests__/integration/tidb/runtime.test.ts (14.522 s)
Test Suites: 2 passed, 2 total
Tests: 130 passed, 130 total
Snapshots: 130 passed, 130 total
Time: 30.422 s
prisma-4.16.x end
[Pipeline] }
Cache not saved (ws/jenkins-pingcap-tidb-merged_integration_nodejs_test-1165/tidb-test already exists)
[Pipeline] // cache
[Pipeline] }
[Pipeline] // dir
[Pipeline] }
✓ using scope to set associations (163ms)
[Pipeline] // stage
[Pipeline] }
[Pipeline] // container
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // node
[Pipeline] }
✓ updating association via set associations with scope (156ms)
[Pipeline] // podTemplate
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
✔ 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 catch EmptyResultError when rejectOnEmpty is set (112ms)
createAssociations
✓ creates a new associated object (106ms)
- supports transactions
✓ supports setting through table attributes (133ms)
✓ supports using the field parameter (112ms)
addAssociations
✓ supports both single instance and array (109ms)
- supports transactions
✓ supports transactions when updating a through model (126ms)
✓ supports passing the primary key instead of an object (110ms)
✔ 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 insert, load, update and remove entities with embeddeds when embeds contains special columns (e.g. CreateDateColumn, UpdateDateColumn, DeleteDateColumn, VersionColumn (1018ms)
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
✔ should save successfully and use static methods successfully
✔ should reload given entity successfully (290ms)
✔ should reload exactly the same entity (289ms)
upsert
✓ should not pass indexes to the join table (2785ms)
✓ should catch EmptyResultError when rejectOnEmpty is set (112ms)
✓ should returns array of intermediate table (113ms)
addMultipleAssociations
✔ should upsert successfully
entity schemas > basic functionality
✔ should perform basic operations with entity using repository
✓ supports both single instance and array (118ms)
✓ adds associations without removing the current ones (125ms)
through model validations
✔ should perform basic operations with entity using manager
entity-schema > checks
entity-schema > checks > postgres, cockroachdb, oracle, mssql
✔ should create a check constraints
entity-schema > checks > spanner
✔ should create a check constraints
entity-schema > columns > mysql
✔ should create columns with different options
entity schema > custom constraint names > foreign key
✓ runs on add
✓ runs on set
✓ runs on create
optimizations using bulk create, destroy and update
✓ uses one insert into statement
✓ uses one delete from statement
join table creation
✔ should set custom constraint names
✓ should work with non integer primary keys (356ms)
✓ makes join table non-paranoid by default
✓ should allow creation of a paranoid join table
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 correctly get associations even after a child instance is deleted (158ms)
✓ should correctly get associations when doubly linked (144ms)
✔ 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 be able to handle nested includes properly (232ms)
✔ should not change constraint names when table renamed (60ms)
✔ should not change constraint names when column renamed (56ms)
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 load constraints with custom names
✔ should not change constraint names when table renamed (51ms)
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
✔ should not change constraint names when column renamed (43ms)
entity-schema > embedded - class-instance
✔ should create an table
✓ gets only non-deleted records by default
✔ should not create table with embedded
✔ should create embedded column name with prefix
✔ should create index for embedded
entity-schema > embedded - class-instance
✓ returns both deleted and non-deleted records with paranoid=false
✔ should save entity with embedded
✔ should contains instance of target class embedded entity
entity-schema > embedded - plain-object
✔ should save entity with embedded
✓ hasAssociation also respects paranoid option
✔ 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
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 update the index to be unique (1429ms)
✓ should be able to add twice (second call result in UPDATE call) without any attributes (and timestamps off) on the through model (368ms)
✓ 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 (371ms)
✔ should update the index swaping the 2 columns (1407ms)
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
✓ should be able to create an instance along with its many-to-many association which has an extra column in the junction table (374ms)
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 (383ms)
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 (131ms)
✓ should remove multiple entries without any attributes (and timestamps off) on the through model (134ms)
belongsTo and hasMany at once
source belongs to target
✓ correctly uses bId in A
target belongs to source
✓ correctly uses bId in A
✔ order by id DESC (49ms)
alias
✓ creates the join table when through is a string (119ms)
✓ creates the join table when through is a model (124ms)
✓ 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 (140ms)
✓ can restrict deletes both ways (137ms)
✓ can cascade and restrict deletes (125ms)
✓ should be possible to remove all constraints (116ms)
✓ create custom unique identifier (158ms)
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
✔ order by title (45ms)
✓ should work with this reference (82ms)
✓ should work with custom this reference (135ms)
✓ should setup correct foreign keys
Eager loading
✓ should load with an alias (125ms)
✓ should load all (124ms)
[MYSQL] BelongsTo
Model.associations
✓ should store all associations when associating to the same table multiple times
get
multiple
✓ should fetch associations for multiple instances (86ms)
getAssociation
✓ supports transactions (101ms)
✓ should be able to handle a where object that's a first class citizen. (87ms)
✓ supports schemas (87ms)
✓ supports schemas when defining custom foreign key attribute #9029 (85ms)
setAssociation
✓ supports transactions (89ms)
✓ can set the association with declared primary keys... (93ms)
✓ clears the association if null is passed (89ms)
✓ should throw a ForeignKeyConstraintError if the associated record does not exist (86ms)
✓ supports passing the primary key instead of an object (87ms)
✔ where two criteria (41ms)
✓ should support logging (86ms)
✓ should not clobber atributes (81ms)
✓ should set the foreign key value without saving when using save: false (83ms)
✓ supports setting same association twice (86ms)
createAssociation
✓ creates an associated model instance (89ms)
✓ supports transactions (91ms)
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 (104ms)
✓ should set foreignKey on foreign table (211ms)
foreign key constraints
✓ are enabled by default (101ms)
✓ sets to NO ACTION if allowNull: false (95ms)
✓ should be possible to disable them (83ms)
✓ can cascade deletes (96ms)
✓ can restrict deletes (96ms)
✓ can restrict updates (100ms)
✓ can cascade updates (92ms)
association column
✓ has correct type and name for non-id primary keys with non-integer type (90ms)
✓ should support a non-primary key as the association column on a target without a primary key (96ms)
✓ should support a non-primary unique key as the association column (93ms)
✓ 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 (95ms)
association options
✓ can specify data type for auto-generated relational keys (148ms)
✓ 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
✔ order by relation (45ms)
✓ should load with an alias (104ms)
✓ should load all (93ms)
[MYSQL] HasMany
Model.associations
✓ should store all assocations when associting to the same table multiple times
count
✓ should not fail due to ambiguous field (102ms)
get
multiple
✓ should fetch associations for multiple instances (102ms)
✓ should fetch associations for multiple instances with limit and order (107ms)
✓ should fetch multiple layers of associations with limit and order with separate=true (165ms)
✓ should fetch associations for multiple instances with limit and order and a belongsTo relation (235ms)
✓ supports schemas (164ms)
(1:N)
✓ clears associations when passing null to the set-method with omitNull set to true (102ms)
✔ order by relation with where relation applied (42ms)
hasAssociation
✓ should only generate one set of foreignKeys
✓ supports transactions (207ms)
✓ 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
✓ supports transactions (210ms)
✓ 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 (93ms)
✓ clears associations when passing null to the set-method (116ms)
✓ supports passing the primary key instead of an object (98ms)
addAssociations
✓ supports transactions (100ms)
✓ supports passing the primary key instead of an object (95ms)
addMultipleAssociations
✓ adds associations without removing the current ones (112ms)
✔ order by nested relations (47ms)
✓ handles decent sized bulk creates (218ms)
createAssociations
✓ creates a new associated object (94ms)
✓ creates the object with the association directly (94ms)
✓ supports transactions (98ms)
✓ supports passing the field option (101ms)
getting assocations with options
✓ should treat the where object of associations as a first class citizen (330ms)
✓ 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
✔ order by complex nested relations (45ms)
✓ should count scoped associations
thisAssociations
✓ should work with alias (52ms)
foreign key constraints
1:m
✓ sets null by default (94ms)
✓ sets to CASCADE if allowNull: false (106ms)
✓ should be possible to remove all constraints (84ms)
✓ can cascade deletes (95ms)
✓ can cascade updates (100ms)
✓ can restrict deletes (90ms)
✓ 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 (105ms)
✓ infers the keyType if none provided (86ms)
✓ should throw an error if foreignKey and as result in a name clash
(node:747) [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 (150ms)
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
✔ order by column in embed (43ms)
✓ should use sourceKey
✓ should count related records
✔ order by relation in embed (44ms)
find options > relations
✓ should set right field when add relative
✓ should create with nested associated models
✔ basic relation (109ms)
✓ should create nested associations with symmetric getters/setters on FK (1669ms)
sourceKey with where clause in include
✔ complex relation #1 (44ms)
✓ should use the specified sourceKey instead of the primary key
Eager loading
✓ should load with an alias (96ms)
✓ should load all (89ms)
[MYSQL] HasOne
Model.associations
✓ should store all associations when associating to the same table multiple times
get
multiple
✓ should fetch associations for multiple instances (93ms)
getAssociation
✓ supports transactions (101ms)
✓ should be able to handle a where object that's a first class citizen. (110ms)
✓ supports schemas (104ms)
setAssociation
✓ supports transactions (99ms)
✓ can set an association with predefined primary keys (99ms)
✓ clears the association if null is passed (104ms)
✓ should throw a ForeignKeyConstraintError if the associated record does not exist (92ms)
✓ supports passing the primary key instead of an object (97ms)
✓ supports updating with a primary key instead of an object (109ms)
✔ complex relation #2 (50ms)
✓ supports setting same association twice (111ms)
createAssociation
✓ creates an associated model instance (102ms)
✓ supports transactions (110ms)
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 (97ms)
✓ should support custom primary key field name in sub queries (92ms)
foreign key constraints
✓ are enabled by default (109ms)
✓ sets to CASCADE if allowNull: false (100ms)
✓ should be possible to disable them (80ms)
✓ can cascade deletes (107ms)
✓ works when cascading a delete with hooks but there is no associate (i.e. "has zero") (86ms)
✓ can cascade updates (92ms)
✓ can restrict deletes (102ms)
✓ can restrict updates (103ms)
association column
✓ has correct type for non-id primary keys with non-integer type (87ms)
✓ should support a non-primary key as the association column on a target with custom primary key (106ms)
✓ should support a non-primary unique key as the association column (127ms)
✓ should support a non-primary unique key as the association column with a field option (136ms)
Association options
✔ relation in embed (44ms)
find options > select
✓ can specify data type for autogenerated relational keys (527ms)
✓ 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 (136ms)
✓ should load all (107ms)
[MYSQL] Multiple Level Filters
✓ can filter through belongsTo (177ms)
✓ avoids duplicated tables in query (187ms)
✓ can filter through hasMany (189ms)
✓ can filter through hasMany connector (172ms)
[MYSQL] associations
scope
1:1
✔ select id (46ms)
✓ should create, find and include associations with scope values (219ms)
✓ should create included association with scope values (207ms)
1:M
✓ should create, find and include associations with scope values (218ms)
✓ should make the same query if called multiple time (#4470) (198ms)
✓ should created included association with scope values (173ms)
✓ should include associations with operator scope values (177ms)
✓ should not mutate scope when running SELECT query (#12868) (175ms)
N:M
on the target
✔ select title (46ms)
✓ [Flaky] should create, find and include associations with scope values (138ms)
on the through model
✓ should create, find and include associations with scope values (686ms)
[MYSQL] Self
✓ supports freezeTableName (54ms)
✓ can handle 1:m associations (67ms)
✓ can handle n:m associations (118ms)
✓ can handle n:m associations with pre-defined through table (103ms)
[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 (505ms)
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 (502ms)
✓ does not leak variables to the following promise chain
✔ select title and text (43ms)
✓ 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 (52ms)
✓ calls parse and stringify for JSON (56ms)
✓ calls parse and stringify for DATE (50ms)
✓ calls parse and stringify for DATEONLY (49ms)
✔ select column in embed (40ms)
find options > where
✓ calls parse and stringify for TIME (48ms)
✓ calls parse and stringify for BLOB (54ms)
✓ calls parse and stringify for CHAR (52ms)
✓ calls parse and stringify/bindParam for STRING (61ms)
✓ calls parse and stringify for TEXT (52ms)
✓ calls parse and stringify for BOOLEAN (49ms)
✓ calls parse and stringify for INTEGER (48ms)
✓ calls parse and stringify for DECIMAL (51ms)
✓ calls parse and stringify for BIGINT (49ms)
✓ should handle JS BigInt type (44ms)
✓ should handle TINYINT booleans (53ms)
✓ calls parse and bindParam for DOUBLE (51ms)
✓ calls parse and bindParam for FLOAT (48ms)
✓ calls parse and bindParam for REAL (46ms)
✓ 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 (49ms)
✓ should parse BIGINT as string (43ms)
✓ should allow spaces in ENUM (49ms)
✓ should return YYYY-MM-DD format string for DATEONLY (56ms)
✓ should return set DATEONLY field to NULL correctly (48ms)
✓ should be able to cast buffer as boolean (46ms)
[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 (88ms)
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
✔ where id (46ms)
✓ should correctly remove associated objects
[MYSQL Specific] Connection Manager
✓ -FOUND_ROWS can be suppressed to get back legacy behavior (57ms)
✓ 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 (163ms)
✓ 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 (54ms)
[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 (61ms)
ConstraintError
✓ Can be intercepted as UniqueConstraintError using .catch (56ms)
✓ Can be intercepted as ValidationError using .catch (49ms)
✓ Supports newlines in keys (48ms)
✓ Works when unique keys are not defined in sequelize (47ms)
✓ adds parent and sql properties (51ms)
[MYSQL] Hooks
associations
1:1
cascade onUpdate
✓ on success
✓ on error
cascade onDelete
#remove
✓ with no errors
✔ where title (41ms)
✓ with errors
no cascade update
✓ on success
✓ on error
no cascade delete
#remove
✓ with no errors
✓ with errors
1:M
cascade
#remove
✓ with no errors
✓ with errors
✔ where two criteria (47ms)
no cascade
#remove
✓ with no errors
✓ with errors
M:M
cascade
#remove
✓ with no errors
✓ with errors
no cascade
#remove
✓ with no errors
✔ where two criteria without match (43ms)
✓ with errors
multiple 1:M
cascade
#remove
✓ with no errors
✓ with errors
multiple 1:M sequential hooks
cascade
#remove
✓ with no errors
✓ with errors
✔ where relation (54ms)
[MYSQL] Hooks
#bulkCreate
on success
✓ should run hooks
on error
✓ should return an error from before
✓ should return an error from after
with the {individualHooks: true} option
✓ should run the afterCreate/beforeCreate functions for each item created successfully
✓ should run the afterCreate/beforeCreate functions for each item created with an error
#bulkUpdate
on success
✓ should run hooks
on error
✓ should return an error from before
✓ should return an error from after
with the {individualHooks: true} option
✓ should run the after/before functions for each item created successfully
✓ should run the after/before functions for each item created successfully changing some data before updating
✓ should run the after/before functions for each item created with an error
#bulkDestroy
on success
✓ should run hooks
on error
✓ should return an error from before
✓ should return an error from after
with the {individualHooks: true} option
✓ should run the after/before functions for each item created successfully
✓ should run the after/before functions for each item created with an error
#bulkRestore
on success
✓ should run hooks
on error
✓ should return an error from before
✓ should return an error from after
with the {individualHooks: true} option
✓ should run the after/before functions for each item restored successfully
✓ 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
✔ where column and relation (46ms)
✓ should not trigger hooks on parent when using N:M association setters (194ms)
on success
✓ should run hooks
on error
✓ should return an error from before
✓ should return an error from after
preserves changes to instance
✓ beforeValidate
✓ afterValidate
✓ beforeCreate
✓ beforeSave
✓ beforeSave with beforeCreate
[MYSQL] Hooks
#destroy
on success
✓ should run hooks
on error
✓ should return an error from before
✓ should return an error from after
with paranoid mode enabled
✓ sets other changed values when soft deleting and a beforeDestroy hooks kicks in
✓ should not throw error when a beforeDestroy hook changes a virtual column
[MYSQL] Hooks
#find
✓ allow changing attributes via beforeFind #5675
on success
✓ all hooks run
✓ beforeFind hook can change options
✓ beforeFindAfterExpandIncludeAll hook can change options
✓ beforeFindAfterOptions hook can change options
✓ afterFind hook can change results
on error
✓ in beforeFind hook returns error
✓ in beforeFindAfterExpandIncludeAll hook returns error
✓ in beforeFindAfterOptions hook returns error
✓ in afterFind hook returns error
[MYSQL] Hooks
#define
✓ beforeDefine hook can change model name
✓ beforeDefine hook can alter options
✓ beforeDefine hook can alter attributes
✓ 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 (69ms)
beforeDestroy / afterDestroy
✓ should pass a DAO instance to the hook (68ms)
beforeUpdate / afterUpdate
✓ should pass a DAO instance to the hook (69ms)
Model#sync
on success
✓ should run hooks
✓ should not run hooks when "hooks = false" option passed
✔ where nested relations (52ms)
on error
✓ should return an error from before
✓ should return an error from after
sequelize#sync
on success
✓ should run hooks
✓ should not run hooks if "hooks = false" option passed
on error
✓ should return an error from before
✓ should return an error from after
#removal
✓ should be able to remove by name
✓ should be able to remove by reference
✓ should be able to remove proxies
Sequelize hooks
✓ should run before/afterPoolAcquire hooks
[MYSQL] Hooks
#restore
on success
✓ should run hooks
on error
✓ should return an error from before
✓ should return an error from after
[MYSQL] Hooks
#update
on success
✓ should run hooks
on error
✓ should return an error from before
✓ 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
✔ where complex nested relations (44ms)
✓ 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 (84ms)
✓ should support a belongsTo association reference (78ms)
✓ should support to use associations with Sequelize.col (134ms)
✓ should support a belongsTo association reference with a where (87ms)
✓ should support a empty hasOne include (80ms)
✓ should support a hasOne association reference (78ms)
✓ should support including a belongsTo association rather than a model/as pair (81ms)
✓ should support a hasMany association reference (93ms)
✓ should support a hasMany association reference with a where condition (97ms)
✓ should support a belongsToMany association reference (120ms)
✓ should support a simple nested belongsTo -> belongsTo include (131ms)
✓ should support a simple sibling set of belongsTo include (124ms)
✔ where or + optional relations (43ms)
✓ should support a simple nested hasOne -> hasOne include (137ms)
✓ should support a simple nested hasMany -> belongsTo include (126ms)
✓ should support a simple nested belongsTo -> hasMany include (147ms)
✓ should support a simple nested hasMany to hasMany include (196ms)
✓ should support an include with multiple different association types (364ms)
✓ should support specifying attributes (87ms)
✓ should support Sequelize.literal and renaming of attributes in included model attributes (82ms)
✓ should support self associated hasMany (with through) include (87ms)
✓ should support including date fields, with the correct timeszone (129ms)
✓ should support include when retrieving associated objects (136ms)
where
✓ should support Sequelize.and()
✓ should support Sequelize.or()
findAndCountAll
✓ should include associations to findAndCountAll (86ms)
✔ where column in embed (47ms)
association getter
✓ should support getting an include on a N:M association getter (145ms)
right join
✓ should support getting an include with a right join (77ms)
✓ should support getting an include through with a right join (123ms)
nested includes
✓ should not ripple grandchild required to top level find when required of child is set to false
✓ should support eager loading associations using the name of the relation (string)
✓ should not ripple grandchild required to top level find when required of child is not given (implicitly false)
✓ should ripple grandchild required to top level find when required of child is set to true as well
[MYSQL] Include
findAll
✓ should work on a nested set of relations with a where condition in between relations (227ms)
✓ should accept nested `where` and `limit` at the same time (170ms)
✓ should support an include with multiple different association types (421ms)
✔ where relation in embed (51ms)
✓ should support many levels of belongsTo (463ms)
✓ should support many levels of belongsTo (with a lower level having a where) (430ms)
✓ should support ordering with only belongsTo includes (121ms)
✓ should include attributes from through models (115ms)
✓ should support a required belongsTo include (86ms)
✓ should be possible to extend the on clause with a where option on a belongsTo include (86ms)
✔ where complex with or + and (41ms)
✓ should be possible to extend the on clause with a where option on a belongsTo include (89ms)
✓ should be possible to define a belongsTo include as required with child hasMany not required (125ms)
✓ should be possible to define a belongsTo include as required with child hasMany with limit (130ms)
✓ 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 (126ms)
✓ should be possible to extend the on clause with a where option on a hasOne include (93ms)
✓ should be possible to extend the on clause with a where option on a hasMany include with a through model (125ms)
✓ should be possible to extend the on clause with a where option on nested includes (381ms)
✓ should be possible to use limit and a where with a belongsTo include (86ms)
✓ should be possible use limit, attributes and a where on a belongsTo with additional hasMany includes (467ms)
✔ where relations with operators (56ms)
✓ should be possible to have the primary key in attributes (88ms)
✓ should be possible to turn off the attributes for the through table (460ms)
✓ should be possible to select on columns inside a through table (480ms)
✓ should be possible to select on columns inside a through table and a limit (488ms)
✔ should not apply inner join if all conditions return undefined (46ms)
✓ should be possible not to include the main id in the attributes (84ms)
✓ should be possible to use limit and a where on a hasMany with additional includes (472ms)
✓ should be possible to use limit and a where on a hasMany with a through model with additional includes (502ms)
✓ 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 (114ms)
✓ should work with paranoid, a main record where, an include where, and a limit (90ms)
✓ should work on a nested set of required 1:1 relations (125ms)
✔ should apply inner join if true is applied (43ms)
find options > where
✔ should skip undefined properties
✔ should skip null properties
find options > opaque-types-over-primitives
✔ should work in select
✓ should work with an empty include.where (159ms)
✔ should work in where
✔ 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 be able to order on the main table and a required belongsTo relation with custom tablenames and limit (91ms)
✔ should work without errors
indices > fulltext index
- should correctly create fulltext indices
- with default parser
- with ngram parser
jsonb type
✔ should make correct schema with Postgres' jsonb type
✔ should persist jsonb correctly
✔ should persist jsonb string correctly
✔ should persist jsonb array correctly
✔ should create updates when changing object
✔ should not create updates when resorting object
✔ should not create new migrations when everything is equivalent
json > defaults
✔ should insert default values properly
ltree-postgres
✔ should create correct schema with Postgres' ltree type
✔ should persist ltree correctly
✔ should update ltree correctly
✔ should re-save ltree correctly
✔ should persist ltree correctly with trailing '.'
✔ should persist ltree correctly when containing spaces
✔ should be able to query ltree correctly
metadata-builder > ColumnMetadata
✔ getValue
✓ should ignore include with attributes: [] (used for aggregates) (92ms)
✔ getValueMap
metadata builder > MetadataArgsUtils
✔ getInheritanceTree
✔ filterByTargetClasses
migrations > generate command
✔ can recognize model changes
✓ should ignore include with attributes: [] and through: { attributes: [] } (used for aggregates) (128ms)
✔ does not generate when no model changes (218ms)
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 not add primary key when including and aggregating with raw: true (83ms)
✔ 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
✓ should return posts with nested include with inner join with a m:n association (214ms)
✔ should save an entity
✓ should be able to generate a correct request with inner and outer join (179ms)
✔ 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 throw an exception if object literal is given instead of constructed entity because it cannot determine what to save
✔ should be able to save and remove entities of different types
persistence > bulk-insert-remove-optimization
✓ should be able to generate a correct request for entity with 1:n and m:1 associations and limit (487ms)
✔ should group multiple insert and remove queries
persistence > cascades > example 1
✔ should insert everything by cascades properly
persistence > cascades > example 2
✓ should allow through model to be paranoid (123ms)
[MYSQL] Include
findAndCountAll
✓ should be able to include two required models with a limit. Result rows should match limit. (127ms)
✓ should be able to include a required model. Result rows should match count (183ms)
✓ should count on a where and not use an uneeded include (79ms)
✓ should return the correct count and rows when using a required belongsTo and a limit (88ms)
✓ should return the correct count and rows when using a required belongsTo with a where condition and a limit (84ms)
✓ should correctly filter, limit and sort when multiple includes and types of associations are present. (210ms)
✓ should properly work with sequelize.function (90ms)
[MYSQL] Include
findOne
✓ should include a non required model, with conditions and two includes N:M 1:M (202ms)
✓ should work with a 1:M to M:1 relation with a where on the last include (122ms)
✓ should include a model with a where condition but no required (86ms)
✓ should include a model with a where clause when the PK field name and attribute name are different (84ms)
✓ should include a model with a through.where and required true clause when the PK field name and attribute name are different (117ms)
✓ should still pull the main record when an included model is not required and has where restrictions without matches (117ms)
✓ should support a nested include (with a where) (132ms)
✓ should support a belongsTo with the targetKey option (92ms)
✓ should support many levels of belongsTo (with a lower level having a where) (376ms)
✓ should work with combinding a where and a scope (69ms)
[MYSQL] Include
LIMIT
✓ supports many-to-many association with where clause (506ms)
✔ 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 2 levels of required many-to-many associations (515ms)
✔ should remove relation
persistence > entity updation
✔ should update generated auto-increment id after saving
✔ should update generated uuid after saving
✓ supports 2 levels of required many-to-many associations with where clause (508ms)
✔ should update default values after saving
✔ should update special columns after saving
✔ should update even when multiple primary keys are used
✓ supports 2 levels of required many-to-many associations with through.where clause (569ms)
✔ should update even with embeddeds
persistence > insert > update-relation-columns-after-insertion
✓ supports 3 levels of required many-to-many associations with where clause (580ms)
✔ should work perfectly
persistence > many-to-many
✓ supports required many-to-many association (546ms)
✔ add exist element to exist object with empty many-to-many relation and save it and it should contain a new category
✓ supports 2 required many-to-many association (561ms)
✓ supports required one-to-many association (537ms)
✔ remove one element from many-to-many relation should remove from the database as well
✓ supports required one-to-many association with where clause (551ms)
✔ remove all elements from many-to-many relation should remove from the database as well
✓ supports required one-to-many association with where clause (findOne) (566ms)
✔ remove all elements (set to null) from many-to-many relation should remove from the database as well (41ms)
✓ supports 2 levels of required one-to-many associations (566ms)
✔ remove all elements from many-to-many relation if parent entity is removed
persistence > many-to-one bi-directional relation
✓ supports required one-to-many association with nested required many-to-many association (573ms)
✔ should save a category with a post attached
✓ supports required many-to-many association with nested required one-to-many association (613ms)
✔ should save a category and a new post by cascades
✓ supports required many-to-one association with nested many-to-many association with where clause (615ms)
✔ should update exist post by cascades when category is saved
✓ supports required many-to-one association with nested many-to-many association with through.where clause (633ms)
✔ should NOT remove exist post by cascades when category is saved without a post (post is set to undefined)
✓ supports required many-to-one association with multiple nested associations with where clause (599ms)
✔ should unset exist post when its set to null
✓ supports required many-to-one association with nested one-to-many association with where clause (580ms)
✔ should set category's post to NULL when post is removed from the database (database ON DELETE)
[MYSQL] Paranoid
✓ paranoid with timestamps: false should be ignored / not crash (553ms)
✓ test if non required is marked as false
✔ should work when relation id is directly set into relation (without related object)
persistence > many-to-one uni-directional relation
✓ test if required is marked as true
✔ should save a category with a post attached
✓ should not load paranoid, destroyed instances, with a non-paranoid parent (608ms)
[MYSQL] Includes with schemas
findAll
✓ should support an include with multiple different association types (494ms)
✔ should save a category and a new post by cascades
✓ should support many levels of belongsTo (504ms)
✓ should support ordering with only belongsTo includes (144ms)
✔ should update exist post by cascades when category is saved
✓ should include attributes from through models (148ms)
✓ should support a required belongsTo include (100ms)
✓ should be possible to extend the on clause with a where option on a belongsTo include (99ms)
✓ should be possible to extend the on clause with a where option on a belongsTo include (100ms)
✓ should be possible to define a belongsTo include as required with child hasMany with limit (160ms)
✔ should NOT remove exist post by cascades when category is saved without a post (post is set to undefined)
✓ should be possible to define a belongsTo include as required with child hasMany with limit and aliases (173ms)
✓ should be possible to define a belongsTo include as required with child hasMany which is not required with limit (166ms)
✓ should be possible to extend the on clause with a where option on a hasOne include (103ms)
✓ should be possible to extend the on clause with a where option on a hasMany include with a through model (141ms)
✓ should be possible to extend the on clause with a where option on nested includes (490ms)
✔ should unset exist post when its set to null
✓ should be possible to use limit and a where with a belongsTo include (104ms)
✔ 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 be possible to use limit and a where on a hasMany with additional includes (558ms)
✔ should work when relation id is directly set into relation (without related object)
persistence > multi primary keys
insert
✓ should be possible to use limit and a where on a hasMany with a through model with additional includes (558ms)
✓ should support including date fields, with the correct timezone (133ms)
✔ should insert entity when there are multi column primary keys
persistence > multi primary keys on both sides
insert
findOne
✓ should work with schemas (104ms)
[MYSQL] Include
separate
✓ should run a hasMany association in a separate query (111ms)
✓ should work even if the id was not included (115ms)
✓ should work even if include does not specify foreign key attribute with custom sourceKey (116ms)
✓ should not break a nested include with null values (166ms)
✔ should insert entity when there are multi column primary keys
persistence > null and default behaviour
✔ should insert value if it is set
✔ should insert default when post.title is undefined
✔ should insert NULL when post.title is null
✔ should update nothing when post.title is undefined
✓ should run a hasMany association with limit in a separate query (201ms)
✔ should update to null when post.title is null
persistence > one-to-many
✓ should run a nested (from a non-separate include) hasMany association in a separate query (174ms)
✓ should work having a separate include between a parent and child include (215ms)
✓ should run two nested hasMany association in a separate queries (169ms)
✓ should work with two schema models in a hasMany association (111ms)
✓ should work with required non-separate parent and required child (163ms)
✔ should add exist element to exist object with empty one-to-many relation and save it
[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
✔ should add exist element to new object with empty one-to-many relation and save it
allowNull date
✓ should be just "null" and not Date with Invalid Date
✓ should be the same valid date when saving the date
super user boolean
✓ should default to false
✓ should override default when given truthy boolean
✓ should override default when given truthy boolean-string ("true")
✓ should override default when given truthy boolean-int (1)
✓ should throw error when given value of incorrect type
complete
✓ gets triggered if an error occurs
✓ gets triggered if everything was ok
findAll
✓ sql should have paranoid condition
✓ sequelize.and as where should include paranoid condition
✓ sequelize.or as where should include paranoid condition
✓ escapes a single single quotes properly in where clauses
✔ should remove exist element from one-to-many relation and save it
✓ escapes two single quotes properly in where clauses
✓ returns the timestamps if no attributes have been specified
✓ does not return the timestamps if the username attribute has been specified
✓ creates the deletedAt property, when defining paranoid as true
✓ destroys a record with a primary key of something other than id (43ms)
✓ sets deletedAt property to a specific date when deleting an instance
✔ should remove all elements from one-to-many relation and save it
✓ keeps the deletedAt-attribute with value null, when running update
✓ keeps the deletedAt-attribute with value null, when updating associations
✓ can reuse query option objects
findOne
✓ can reuse query option objects
✓ returns null for null, undefined, and unset boolean values (45ms)
equals
✓ can compare records with Date field
✓ does not compare the existence of associations (95ms)
values
✓ returns all values
isSoftDeleted
✔ set relation to null (elements exist there) from one-to-many relation and save it
persistence > one-to-one
set the relation with proper item
✓ should return false when model is just created
✓ returns false if user is not soft deleted
✔ should have an access token
doesn't allow the same relation to be used twice
✓ returns true if user is soft deleted
✔ should reject the saving attempt (62ms)
persistence > orphanage > delete
when a Post is removed from a Category
✓ works with custom `deletedAt` field name (44ms)
restore
✓ returns an error if the model is not paranoid
✓ restores a previously deleted model (45ms)
✓ supports custom deletedAt field (45ms)
✓ supports custom deletedAt field name (43ms)
✓ supports custom deletedAt field and database column (43ms)
✓ supports custom default value (40ms)
[MYSQL] InstanceValidator
✓ correctly validates using custom validation methods
✓ supports promises with custom validation methods (38ms)
✓ 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 (42ms)
✓ 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 (46ms)
✓ should be able to emit an error upon updating when a validation has failed from an instance (39ms)
✔ should retain a Post on the Category
✓ should be able to emit an error upon updating when a validation has failed from the factory (49ms)
✓ should enforce a unique constraint (44ms)
✓ should allow a custom unique constraint error message (46ms)
✓ should handle multiple unique messages correctly (51ms)
#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
✓ should emit an error when we try to enter in a string for an auto increment key (not named id)
primaryKey with the name as id with arguments for it's validatio
✓ should emit an error when we try to enter in a string for the id key with validation arguments
✓ should emit an error when we try to enter in a string for an auto increment key through .build().validate()
✓ should emit an error when we try to .save()
pass all paths when validating
✓ produce 3 errors
not null schema validation
✓ correctly throws an error using create method
✓ correctly throws an error using create method with default generated messages
[MYSQL] Instance
decrement
✓ supports transactions (99ms)
✓ 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
✔ should delete the orphaned Post from the database
✓ with negative value
✓ with timestamps set to true (40ms)
✓ with timestamps set to true and options.silent set to true (39ms)
[MYSQL] Instance
destroy
✓ supports transactions (45ms)
✓ does not set the deletedAt date in subsequent destroys if dao is paranoid (48ms)
✔ should retain foreign keys on remaining Posts
persistence > orphanage > disable
when a User is updated without all settings being loaded...
✓ does not update deletedAt with custom default in subsequent destroys (42ms)
✓ deletes a record from the database if dao is not paranoid (47ms)
✓ allows updating soft deleted instance (43ms)
✓ supports custom deletedAt field (42ms)
✓ supports custom deletedAt database column (43ms)
✓ supports custom deletedAt field and database column (45ms)
✓ persists other model changes when soft deleting (49ms)
✓ allows sql logging of delete statements (66ms)
✓ allows sql logging of update statements (46ms)
✓ should not call save hooks when soft deleting (45ms)
✓ delete a record of multiple primary keys table (48ms)
[MYSQL] Instance
increment
✓ supports transactions (122ms)
✓ 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
✔ should not delete setting with orphanedRowAction=disabed
✓ with key value pair
✓ single value should work when field name is different from database column name
✓ array should work when field name is different from database column name
✓ key value should work when field name is different from database column name
✓ with timestamps set to true (40ms)
✓ with timestamps set to true and options.silent set to true (45ms)
[MYSQL] Instance
reload
✓ supports transactions (105ms)
✓ 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 not orphane any Settings
persistence > partial persist
✓ should update internal options of the instance (95ms)
✔ should persist partial entities without data loss
persistence > persistence options > chunks
✔ should save objects in chunks
persistence > persistence options > listeners
✓ should return an error when reload fails
✔ save listeners should work by default
✔ save listeners should be disabled if save option is specified
✓ should set an association to null after deletion, 1-1 (221ms)
✔ remove listeners should work by default
✔ remove listeners should be disabled if remove option is specified
✓ should set an association to empty after all deletion, 1-N (209ms)
✔ soft-remove listeners should work by default
✔ soft-remove listeners should be disabled if remove option is specified
persistence > persistence options > transaction
✓ should update the associations after one element deleted (198ms)
✔ 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 inject default scope when reloading (98ms)
[MYSQL] Instance
save
✓ supports transactions (95ms)
✓ only updates fields in passed array
✓ should work on a model with an attribute named length (44ms)
✓ only validates fields in passed array
✓ stores an entry in the database
✓ handles an entry with primaryKey of zero (42ms)
✓ updates the timestamps
✓ does not update timestamps when passing silent=true
✓ does not update timestamps when passing silent=true in a bulk update
✓ updates with function and column value
✓ updates with function that contains escaped dollar symbol
✔ 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
✓ updates with function that contains multiple escaped dollar symbols
✓ should fail a validation upon creating
✓ should fail a validation upon creating with hooks false
✓ should fail a validation upon building
✓ should fail a validation when updating
✓ takes zero into account
✓ saves a record with no primary key (43ms)
hooks
✓ should update attributes added in hooks when default fields are used (46ms)
✓ should update attributes changed in hooks when default fields are used (55ms)
✓ should validate attributes added in hooks when default fields are used (48ms)
✔ should cache results properly (1026ms)
✓ should validate attributes changed in hooks when default fields are used (45ms)
when nothing changed
✓ does not update timestamps
✓ should not throw ER_EMPTY_QUERY if changed only virtual fields (42ms)
without timestamps option
✓ doesn't update the updatedAt column (40ms)
with custom timestamp options
✓ updates the createdAt column if updatedAt is disabled (44ms)
✔ should cache results with pagination enabled properly (1022ms)
✓ updates the updatedAt column if createdAt is disabled (46ms)
✓ 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
✓ 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
✔ should cache results with custom id and duration supplied (2025ms)
✓ returns a response that can be stringified
✓ returns a response that can be stringified and then parsed
create
✓ returns an object containing all values
✓ returns a response that can be stringified
✓ returns a response that can be stringified and then parsed
find
✓ returns an object containing all values
✔ should cache results with custom id and duration supplied (1023ms)
query builder > comment
✔ should scrub end comment pattern from string
✔ should not allow an empty comment
✓ returns a response that can be stringified
✔ should allow a comment with just whitespaces
✔ should allow a multi-line comment
✔ should include comment in select
✓ returns a response that can be stringified and then parsed
✔ should include comment in update
✔ should include comment in insert
[MYSQL] Instance
update
✓ supports transactions (100ms)
✔ should include comment in delete
query builder > composite primary
✔ should find entity by another entity with a composite key
query builder > count
✓ should update fields that are not specified on create (46ms)
✔ Count query should of empty table should be 0
✓ should succeed in updating when values are unchanged (without timestamps) (44ms)
✓ should update timestamps with milliseconds (46ms)
✔ Count query should count database values
✓ should only save passed attributes
✓ should save attributes affected by setters
✔ Count query should handle ambiguous values
✓ should not set attributes that are not specified by fields (43ms)
✔ counting joined query should count database values
✓ updates attributes in the database
✓ ignores unknown attributes
✔ counting joined queries should handle ambiguous values
query builder > cte > materialized
✓ ignores undefined attributes (100ms)
✓ doesn't update primary keys or timestamps (42ms)
✔ should allow MATERIALIZED hint
✓ stores and restores null values (44ms)
✔ should allow NOT MATERIALIZED hint
✔ should omit hint if materialized option is not set
query builder > cte > recursive
✓ should support logging
hooks
✓ should update attributes added in hooks when default fields are used (46ms)
✔ should work with simple recursive query
query builder > cte > simple
✓ should update attributes changed in hooks when default fields are used (52ms)
✔ show allow select from CTE
✔ should allow join with CTE
✓ should validate attributes added in hooks when default fields are used (48ms)
✔ should allow to use INSERT with RETURNING clause in CTE
✔ should allow string for CTE
query builder > delete
✓ should validate attributes changed in hooks when default fields are used (44ms)
[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
✔ should perform deletion correctly
✓ allows use of sequelize.fn and sequelize.col in date and bool fields (43ms)
includes
✓ should support basic includes
✓ should support basic includes (with raw: true)
get
✓ should use custom attribute getters in get(key)
✓ should custom virtual getters in get(key)
✓ should use custom getters in toJSON
✓ should work with save (42ms)
✓ 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 (40ms)
✔ should be able to delete entities by embed criteria
✔ should return correct delete result
✓ should return true if previous value is different
✓ should return false immediately after saving (39ms)
✓ should be available to a afterUpdate hook (43ms)
previous
✓ should return an object with the previous values
✓ should return the previous value
model
json
✓ should tell me that a column is json
✔ should 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
✔ should update entity model after insertion if updateEntity is set to true
✓ should use a placeholder for json with insert
✓ should insert json using a custom field name (39ms)
✔ should not update entity model after insertion if updateEntity is set to false
✔ should not override already set properties
✔ should update entity model after save
✔ should update special entity properties after entity updation if updateEntity is set to true
✓ should update json using a custom field name (43ms)
✔ should not update special entity properties after entity updation if updateEntity is set to false
query builder > exist
✓ should be able retrieve json value as object
✔ Exists query of empty table should be false
✔ Exists query of non empty table should be true
query builder > insert
✓ should be able to retrieve element of array by index
✔ should perform insertion correctly
✓ should be able to retrieve root level value of an object by key
✔ should perform bulk insertion correctly
✓ should be able to retrieve nested value of an object by path
✔ should be able to use sql functions
✓ 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 insert entities with different properties set even inside embeds
query builder > insertion > on conflict
✔ should perform insertion correctly using onConflict
✔ should support alias in insert
✔ should perform insertion correctly using orIgnore
✔ should perform insertion correctly using orUpdate
✔ should perform insertion on partial index using orUpdate
✔ should perform insertion using partial index and skipping update on no change
✔ should throw error if using indexPredicate amd an unsupported driver
query builder > joins
leftJoinAndSelect
✓ should be able to query using dot notation
✓ should be able to query using dot notation with uppercase name
✓ should be able to query array using property accessor
✓ should be able to store strings
✓ should be able to store values that require JSON escaping
✓ should be able to findOrCreate with values that require JSON escaping
✓ should be able retrieve json value with nested include
[MYSQL] Model
✔ should load data for all relation types (47ms)
✓ supports multiple async transactions (2112ms)
✓ should be possible to use a key named UUID as foreign key (144ms)
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 (39ms)
✓ throws an error if 2 autoIncrements are passed
✓ throws an error if a custom model-wide validation is not a function
✔ should load data when additional condition used
✓ 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 (45ms)
✓ 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 (44ms)
✓ should allow me to override updatedAt, createdAt, and deletedAt fields (48ms)
✓ should allow me to disable some of the timestamp fields (46ms)
✓ returns proper defaultValues after save when setter is set (41ms)
✓ should work with both paranoid and underscored being true (42ms)
✓ allows multiple column unique keys to be defined (39ms)
✓ allows unique on column with field aliases (38ms)
✓ allows us to customize the error message for unique constraint (42ms)
✔ should load data when join tables does not have direct relation
innerJoinAndSelect
✓ allows us to map the customized error message with unique constraint name (1433ms)
- should allow the user to specify indexes in options
descending indices (MySQL 8 specific)
✓ complains about missing support for descending indexes (1415ms)
✔ should load only exist data for all relation types
✓ works fine with InnoDB (1414ms)
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
✓ attaches getter and setter methods from options
✓ attaches getter and setter methods from options only if not defined in attribute
include
✓ should support basic includes
✓ should support includes with aliases
findOne
✓ supports the transaction option in the first parameter (104ms)
✓ should not fail if model is paranoid and where is an empty array (101ms)
✔ should load data when additional condition used
✓ should work if model is paranoid and only operator in where clause is a Symbol (#8406) (96ms)
findOrBuild
✓ supports transactions (101ms)
returns an instance if it already exists
✓ with a single find field
✓ with multiple find fields
✓ builds a new instance with default value.
save
✓ should map the correct fields when saving instance (#10589) (109ms)
update
✓ throws an error if no where clause is given (101ms)
✓ should map the correct fields when updating instance (#10589) (108ms)
✓ supports transactions (107ms)
✓ updates the attributes that we select only without updating createdAt (46ms)
✓ allows sql logging of updated statements (112ms)
✓ 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
✔ should not return any result when related data does not exist
leftJoinAndMap
✓ 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 (47ms)
✓ updates attributes that are altered by virtual setters (47ms)
✓ should properly set data when individualHooks are true
✓ sets updatedAt to the current timestamp
✓ returns the number of affected rows
✓ does not update soft deleted records when model is paranoid (182ms)
✓ updates soft deleted records when paranoid is overridden (159ms)
✓ calls update hook for soft deleted objects (113ms)
✓ supports limit clause
destroy
✓ `truncate` method should clear the table (144ms)
✓ `truncate` option should clear the table (144ms)
✔ should load and map selected data when entity used as join argument
✓ `truncate` option returns a number (141ms)
✓ throws an error if no where clause is given (100ms)
✓ deletes all instances when given an empty where object (106ms)
✓ throws an error if where has a key with undefined value (100ms)
✓ supports transactions (105ms)
✓ deletes values that match filter
✓ works without a primary key (49ms)
✓ supports .field (47ms)
✓ sets deletedAt to the current timestamp if paranoid is true (50ms)
✓ does not set deletedAt for previously destroyed instances if paranoid is true (53ms)
✓ should include deleted associated records if include has paranoid marked as false (172ms)
✓ should delete a paranoid record if I set force to true (61ms)
✓ returns the number of affected rows
✓ supports table schema/prefix (114ms)
✓ should work if model is paranoid and only operator in where clause is a Symbol (111ms)
✔ should load and map selected data when table name used as join argument
can't find records marked as deleted with paranoid being true
✓ with the DAOFactory (57ms)
can find paranoid records if paranoid is marked as false in query
✓ with the DAOFactory (55ms)
restore
✓ rejects with an error if the model is not paranoid
✓ restores a previously deleted model (51ms)
equals
✓ correctly determines equality of objects
✓ correctly determines equality with multiple primary keys (43ms)
equalsOneOf
✓ determines equality if one is matching
✓ doesn't determine equality if none is matching
count
✓ supports transactions (117ms)
✓ counts all created objects
✓ returns multiple rows when using group
✓ allows sql logging
✓ filters object
✔ should load and map selected data when query builder used as join argument
✓ supports distinct option (104ms)
aggregate
Executing (default): SELECT `id` AS `id2`, count(`id`) AS `count` FROM `Users` AS `User` GROUP BY `id2`;
(node:747) [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 (116ms)
✓ returns the correct value
✓ allows sql logging
✓ should allow decimals
✓ should allow strings
✔ should load and map selected data when data will given from same entity but with different conditions
✓ should allow dates
✓ should work with fields named as an SQL reserved keyword
max
✓ supports transactions (125ms)
✓ returns the correct value
✓ allows sql logging
✓ should allow decimals
✔ should load and map selected data when data will given from same property but with different conditions (40ms)
innerJoinAndMap
✓ should allow strings
✓ should allow dates
✓ should work with fields named as an SQL reserved keyword
sum
✓ should work in the simplest case
✓ should work with fields named as an SQL reserved keyword
✓ should allow decimals in sum
✔ should load and map selected data when entity used as join argument
✓ should accept a where clause
✓ should accept a where clause with custom fields
✓ allows sql logging
✔ should load and map selected data when table name used as join argument
schematic support
✓ should be able to drop with schemas
✓ should be able to list schemas
✓ should take schemaDelimiter into account if applicable (88ms)
✓ should describeTable using the default schema settings (87ms)
✓ should be able to reference a table with a schema set (106ms)
✓ should be able to create and update records under any valid schematic (54ms)
references
✔ should load and map selected data when query builder used as join argument
✓ uses an existing dao factory and references the author table (65ms)
✓ uses a table name as a string and references the author table (55ms)
- emits an error event as the referenced table name is invalid
✓ works with comments (313ms)
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
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
✔ should load and map selected data when data will given from same entity but with different conditions
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 not overwrite a specified deletedAt (complex query) by setting paranoid: false
Unique
✓ should set unique when unique is true (41ms)
✓ should not set unique when unique is false (52ms)
✓ should not set unique when unique is unset (44ms)
bulkCreate
✔ should load and map selected data when data will given from same property but with different conditions (42ms)
✓ errors - should return array of errors if validate and individualHooks are true (110ms)
✓ should not use setter when renaming fields in dataValues (107ms)
[MYSQL] Model
attributes
set
✓ should only be called once when used on a join model called with an association getter (163ms)
✓ allows for an attribute to be called "toString" (48ms)
✓ allows for an attribute to be called "toString" with associations (111ms)
quote
✓ allows for an attribute with dots (47ms)
[MYSQL] Model
attributes
field
✓ increment should work (62ms)
✔ should not return any result when related data does not exist
query builder > locking
✓ decrement should work (68ms)
✓ sum should work (49ms)
✓ should create, fetch and update with alternative field names from a simple model
✔ should not attach pessimistic read lock statement on query if locking is not used
✓ should bulk update (567ms)
✓ should not contain the field properties after create (53ms)
✓ should make the aliased auto incremented primary key available after create
✔ should throw error if pessimistic lock used without transaction
✓ 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
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 01:44:32.643 +00:00] [INFO] [printer.go:47] ["Welcome to TiDB."] ["Release Version"=v8.2.0-alpha-181-g491740bb83] [Edition=Community] ["Git Commit Hash"=491740bb837bcdb5797da44954f75953b4bfe849] ["Git Branch"=HEAD] ["UTC Build Time"="2024-05-17 01:37:22"] [GoVersion=go1.21.0] ["Race Enabled"=false] ["Check Table Before Drop"=false]
[2024/05/17 01:44:32.644 +00:00] [INFO] [cgmon.go:130] ["set the maxprocs"] [quota=6]
[2024/05/17 01:44:32.644 +00:00] [INFO] [cgmon.go:154] ["set the memory limit"] [memLimit=17179869184]
[2024/05/17 01:44:32.645 +00:00] [INFO] [printer.go:52] ["loaded config"] [config="{\"host\":\"0.0.0.0\",\"advertise-address\":\"10.233.106.178\",\"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 01:44:34.967 +00:00] [ERROR] [advancer.go:400] ["listen task meet error, would reopen."] [error=EOF]
[2024/05/17 01:44:35.043 +00:00] [ERROR] [tso_client.go:365] ["[tso] update connection contexts failed"] [dc=global] [error="rpc error: code = Canceled desc = context canceled"]
=========== ERROR EXIT [1]: FULL tidb.log END ==============
[Pipeline] }
Cache not saved (inner-step execution failed)
[Pipeline] // cache
[Pipeline] }
[Pipeline] // dir
Post stage
[Pipeline] script
[Pipeline] {
[Pipeline] echo
Test failed, archive the log
[Pipeline] }
[Pipeline] // script
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // container
[Pipeline] }
✓ should work with a where or
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // node
[Pipeline] }
[Pipeline] // podTemplate
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
Failed in branch Matrix - TEST_DIR = 'typeorm_test'
Sending interrupt signal to process
Killing processes
kill finished with exit code 0
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