question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add a time comparison between `mysql:8.0` and `vitess/vttestserver:mysql80` over `relationMode = "prisma"` tests.

See original GitHub issue

In https://github.com/prisma/prisma/pull/16051, we have noticed Vitess is notably slower than other databases when running the relationMode test suites. We thus want to compare the time taken by the MySQL image we use (mysql:8.0) and the Vitess image we use (vitess/vttestserver:mysql80) to complete those tests.

We should:

  • run a test suite that mirrors the tests and content of the relationMode functional suite, but supporting mysql and vitess only, ideally something like the following:
    RELATION_MODE="prisma" PROVIDER_FLAVOR="vitess-8" pnpm run test:functional:code --relation-mode-tests-only relationMode
    
  • exposes commands to run the test suite with a single database
  • call the Github Actions workflow as client-relationMode-prisma-mysql-vs-vitess

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
Jolg42commented, Nov 3, 2022

It could be that it’s the creation and deletion of the database/tables that is very slow, which is not reflected in the step time.

1reaction
jkomynocommented, Nov 2, 2022

I have run the 1:1 relationMode test suite with the command

RELATION_MODE=prisma pnpm run test:functional:code --relation-mode-tests-only relationMode/tests_1-to-1.ts

on a MacBook Pro M1. This command was run 10s after bootstrapping the database instance (either Vitess / MySQL). Here are the results:

TL/DR

  • mysql:8.0 takes 12.829s
  • vitess/vttestserver:mysql80 takes 599.321s

Output

Vitess

❯ RELATION_MODE=prisma pnpm run test:functional:code --relation-mode-tests-only relationMode/tests_1-to-1.ts > vitess-1-to-1.txt
PASS tests/functional/relationMode/tests_1-to-1.ts (599.321 s)
  relationMode.tests_1-to-1 (relationMode=prisma,provider=mysql,providerFlavor=vitess_8,onUpdate=DEFAULT,onDelete=DEFAULT,id=String @id, previewFeatures=referentialIntegrity)
    1:1 mandatory (explicit)
      [create]
        βœ“ relationMode=prisma [create] child with non existing parent should succeed (133 ms)
        βœ“ [create] child with undefined parent should throw with type error (243 ms)
        βœ“ [create] nested child [create] should succeed (60 ms)
        βœ“ relationMode=prisma [create] child with non existing parent should succeed (79 ms)
        βœ“ [create] child with undefined parent should throw with type error (30 ms)
        βœ“ [create] nested child [create] should succeed (53 ms)
        β—‹ skipped relationMode=foreignKeys [create] child with non existing parent should throw
        β—‹ skipped relationMode=foreignKeys [create] child with non existing parent should throw
      [update]
        βœ“ [update] (user) optional boolean field should succeed (122 ms)
        βœ“ [update] (profile) optional boolean field should succeed (109 ms)
        βœ“ [update] (user) optional boolean field should succeed (150 ms)
        βœ“ [update] (profile) optional boolean field should succeed (113 ms)
        mutate id tests (skipped only for MongoDB)
          βœ“ [upsert] child id with non-existing id should succeed (95 ms)
          βœ“ [update] child id with non-existing id should succeed (101 ms)
          βœ“ [update] nested child [connect] child should succeed if the relationship didn't exist (127 ms)
          βœ“ [update] nested child [update] should succeed (130 ms)
          βœ“ [update] nested child [connect] should succeed if the relationship already existed (125 ms)
          βœ“ [upsert] child id with non-existing id should succeed (87 ms)
          βœ“ [update] child id with non-existing id should succeed (97 ms)
          βœ“ [update] nested child [connect] child should succeed if the relationship didn't exist (106 ms)
          βœ“ [update] nested child [update] should succeed (102 ms)
          βœ“ [update] nested child [connect] should succeed if the relationship already existed (81 ms)
          onUpdate: DEFAULT, Cascade
            βœ“ [update] parent id with non-existing id should succeed (102 ms)
            βœ“ [updateMany] parent id should succeed (112 ms)
            βœ“ [update] parent id with non-existing id should succeed (95 ms)
            βœ“ [updateMany] parent id should succeed (101 ms)
          onUpdate: Restrict, NoAction
            β—‹ skipped [update] parent id with non-existing id should throw
            β—‹ skipped [updateMany] parent id with non-existing id should throw
            β—‹ skipped [update] parent id with non-existing id should throw
            β—‹ skipped [updateMany] parent id with non-existing id should throw
          onUpdate: DEFAULT, Restrict, NoAction, SetNull
            βœ“ [update] parent id with existing id should throw (127 ms)
            βœ“ [updateMany] parent id with existing id should throw (97 ms)
            βœ“ [update] child id with existing id should throw (98 ms)
            βœ“ [update] nested child [disconnect] should throw (93 ms)
            βœ“ [update] parent id with existing id should throw (87 ms)
            βœ“ [updateMany] parent id with existing id should throw (86 ms)
            βœ“ [update] child id with existing id should throw (85 ms)
            βœ“ [update] nested child [disconnect] should throw (72 ms)
      [delete]
        βœ“ [delete] child should succeed (95 ms)
        βœ“ [delete] child and then [delete] parent should succeed (104 ms)
        βœ“ [delete] child should succeed (93 ms)
        βœ“ [delete] child and then [delete] parent should succeed (101 ms)
        onDelete: DEFAULT, Restrict, NoAction
          βœ“ [delete] parent should throw (76 ms)
          βœ“ [deleteMany] parents should throw (79 ms)
          βœ“ [delete] parent should throw (83 ms)
          βœ“ [deleteMany] parents should throw (82 ms)
        onDelete: SetNull
          β—‹ skipped [delete] parent should throw
          β—‹ skipped [deleteMany] parents should throw
          β—‹ skipped relationMode=prisma / SetNull: [delete] parent should throw
          β—‹ skipped relationMode=prisma / SetNull: [deleteMany] parents should throw
          β—‹ skipped [delete] parent should throw
          β—‹ skipped [deleteMany] parents should throw
          β—‹ skipped relationMode=prisma / SetNull: [delete] parent should throw
          β—‹ skipped relationMode=prisma / SetNull: [deleteMany] parents should throw
        onDelete: Cascade
          β—‹ skipped [delete] parent should succeed
          β—‹ skipped [delete] parent should succeed
  relationMode.tests_1-to-1 (relationMode=prisma,provider=mysql,providerFlavor=vitess_8,onUpdate=Cascade,onDelete=Cascade,id=String @id, previewFeatures=referentialIntegrity)
    1:1 mandatory (explicit)
      [create]
        βœ“ relationMode=prisma [create] child with non existing parent should succeed (72 ms)
        βœ“ [create] child with undefined parent should throw with type error (28 ms)
        βœ“ [create] nested child [create] should succeed (48 ms)
        βœ“ relationMode=prisma [create] child with non existing parent should succeed (81 ms)
        βœ“ [create] child with undefined parent should throw with type error (41 ms)
        βœ“ [create] nested child [create] should succeed (63 ms)
        β—‹ skipped relationMode=foreignKeys [create] child with non existing parent should throw
        β—‹ skipped relationMode=foreignKeys [create] child with non existing parent should throw
      [update]
        βœ“ [update] (user) optional boolean field should succeed (108 ms)
        βœ“ [update] (profile) optional boolean field should succeed (129 ms)
        βœ“ [update] (user) optional boolean field should succeed (143 ms)
        βœ“ [update] (profile) optional boolean field should succeed (133 ms)
        mutate id tests (skipped only for MongoDB)
          βœ“ [upsert] child id with non-existing id should succeed (113 ms)
          βœ“ [update] child id with non-existing id should succeed (90 ms)
          βœ“ [update] nested child [connect] child should succeed if the relationship didn't exist (120 ms)
          βœ“ [update] nested child [update] should succeed (112 ms)
          βœ“ [update] nested child [connect] should succeed if the relationship already existed (84 ms)
          βœ“ [upsert] child id with non-existing id should succeed (118 ms)
          βœ“ [update] child id with non-existing id should succeed (116 ms)
          βœ“ [update] nested child [connect] child should succeed if the relationship didn't exist (143 ms)
          βœ“ [update] nested child [update] should succeed (129 ms)
          βœ“ [update] nested child [connect] should succeed if the relationship already existed (80 ms)
          onUpdate: DEFAULT, Cascade
            βœ“ [update] parent id with non-existing id should succeed (100 ms)
            βœ“ [updateMany] parent id should succeed (101 ms)
            βœ“ [update] parent id with non-existing id should succeed (120 ms)
            βœ“ [updateMany] parent id should succeed (108 ms)
          onUpdate: Restrict, NoAction
            β—‹ skipped [update] parent id with non-existing id should throw
            β—‹ skipped [updateMany] parent id with non-existing id should throw
            β—‹ skipped [update] parent id with non-existing id should throw
            β—‹ skipped [updateMany] parent id with non-existing id should throw
          onUpdate: DEFAULT, Restrict, NoAction, SetNull
            β—‹ skipped [update] parent id with existing id should throw
            β—‹ skipped [updateMany] parent id with existing id should throw
            β—‹ skipped [update] child id with existing id should throw
            β—‹ skipped [update] nested child [disconnect] should throw
            β—‹ skipped [update] parent id with existing id should throw
            β—‹ skipped [updateMany] parent id with existing id should throw
            β—‹ skipped [update] child id with existing id should throw
            β—‹ skipped [update] nested child [disconnect] should throw
      [delete]
        βœ“ [delete] child should succeed (95 ms)
        βœ“ [delete] child and then [delete] parent should succeed (102 ms)
        βœ“ [delete] child should succeed (115 ms)
        βœ“ [delete] child and then [delete] parent should succeed (132 ms)
        onDelete: DEFAULT, Restrict, NoAction
          β—‹ skipped [delete] parent should throw
          β—‹ skipped [deleteMany] parents should throw
          β—‹ skipped [delete] parent should throw
          β—‹ skipped [deleteMany] parents should throw
        onDelete: SetNull
          β—‹ skipped [delete] parent should throw
          β—‹ skipped [deleteMany] parents should throw
          β—‹ skipped relationMode=prisma / SetNull: [delete] parent should throw
          β—‹ skipped relationMode=prisma / SetNull: [deleteMany] parents should throw
          β—‹ skipped [delete] parent should throw
          β—‹ skipped [deleteMany] parents should throw
          β—‹ skipped relationMode=prisma / SetNull: [delete] parent should throw
          β—‹ skipped relationMode=prisma / SetNull: [deleteMany] parents should throw
        onDelete: Cascade
          βœ“ [delete] parent should succeed (103 ms)
          βœ“ [delete] parent should succeed (116 ms)
  relationMode.tests_1-to-1 (relationMode=prisma,provider=mysql,providerFlavor=vitess_8,onUpdate=NoAction,onDelete=NoAction,id=String @id, previewFeatures=referentialIntegrity)
    1:1 mandatory (explicit)
      [create]
        βœ“ relationMode=prisma [create] child with non existing parent should succeed (73 ms)
        βœ“ [create] child with undefined parent should throw with type error (29 ms)
        βœ“ [create] nested child [create] should succeed (48 ms)
        βœ“ relationMode=prisma [create] child with non existing parent should succeed (73 ms)
        βœ“ [create] child with undefined parent should throw with type error (37 ms)
        βœ“ [create] nested child [create] should succeed (78 ms)
        β—‹ skipped relationMode=foreignKeys [create] child with non existing parent should throw
        β—‹ skipped relationMode=foreignKeys [create] child with non existing parent should throw
      [update]
        βœ“ [update] (user) optional boolean field should succeed (110 ms)
        βœ“ [update] (profile) optional boolean field should succeed (97 ms)
        βœ“ [update] (user) optional boolean field should succeed (137 ms)
        βœ“ [update] (profile) optional boolean field should succeed (99 ms)
        mutate id tests (skipped only for MongoDB)
          βœ“ [upsert] child id with non-existing id should succeed (87 ms)
          βœ“ [update] child id with non-existing id should succeed (83 ms)
          βœ“ [update] nested child [connect] child should succeed if the relationship didn't exist (111 ms)
          βœ“ [update] nested child [update] should succeed (101 ms)
          βœ“ [update] nested child [connect] should succeed if the relationship already existed (84 ms)
          βœ“ [upsert] child id with non-existing id should succeed (85 ms)
          βœ“ [update] child id with non-existing id should succeed (84 ms)
          βœ“ [update] nested child [connect] child should succeed if the relationship didn't exist (112 ms)
          βœ“ [update] nested child [update] should succeed (132 ms)
          βœ“ [update] nested child [connect] should succeed if the relationship already existed (94 ms)
          onUpdate: DEFAULT, Cascade
            β—‹ skipped [update] parent id with non-existing id should succeed
            β—‹ skipped [updateMany] parent id should succeed
            β—‹ skipped [update] parent id with non-existing id should succeed
            β—‹ skipped [updateMany] parent id should succeed
          onUpdate: Restrict, NoAction
            βœ“ [update] parent id with non-existing id should throw (81 ms)
            βœ“ [updateMany] parent id with non-existing id should throw (81 ms)
            βœ“ [update] parent id with non-existing id should throw (119 ms)
            βœ“ [updateMany] parent id with non-existing id should throw (108 ms)
          onUpdate: DEFAULT, Restrict, NoAction, SetNull
            βœ“ [update] parent id with existing id should throw (83 ms)
            βœ“ [updateMany] parent id with existing id should throw (81 ms)
            βœ“ [update] child id with existing id should throw (85 ms)
            βœ“ [update] nested child [disconnect] should throw (75 ms)
            βœ“ [update] parent id with existing id should throw (104 ms)
            βœ“ [updateMany] parent id with existing id should throw (94 ms)
            βœ“ [update] child id with existing id should throw (85 ms)
            βœ“ [update] nested child [disconnect] should throw (81 ms)
      [delete]
        βœ“ [delete] child should succeed (92 ms)
        βœ“ [delete] child and then [delete] parent should succeed (100 ms)
        βœ“ [delete] child should succeed (101 ms)
        βœ“ [delete] child and then [delete] parent should succeed (123 ms)
        onDelete: DEFAULT, Restrict, NoAction
          βœ“ [delete] parent should throw (75 ms)
          βœ“ [deleteMany] parents should throw (78 ms)
          βœ“ [delete] parent should throw (108 ms)
          βœ“ [deleteMany] parents should throw (96 ms)
        onDelete: SetNull
          β—‹ skipped [delete] parent should throw
          β—‹ skipped [deleteMany] parents should throw
          β—‹ skipped relationMode=prisma / SetNull: [delete] parent should throw
          β—‹ skipped relationMode=prisma / SetNull: [deleteMany] parents should throw
          β—‹ skipped [delete] parent should throw
          β—‹ skipped [deleteMany] parents should throw
          β—‹ skipped relationMode=prisma / SetNull: [delete] parent should throw
          β—‹ skipped relationMode=prisma / SetNull: [deleteMany] parents should throw
        onDelete: Cascade
          β—‹ skipped [delete] parent should succeed
          β—‹ skipped [delete] parent should succeed
  relationMode.tests_1-to-1 (relationMode=prisma,provider=mysql,providerFlavor=vitess_8,onUpdate=Restrict,onDelete=Restrict,id=String @id, previewFeatures=referentialIntegrity)
    1:1 mandatory (explicit)
      [create]
        βœ“ relationMode=prisma [create] child with non existing parent should succeed (67 ms)
        βœ“ [create] child with undefined parent should throw with type error (28 ms)
        βœ“ [create] nested child [create] should succeed (51 ms)
        βœ“ relationMode=prisma [create] child with non existing parent should succeed (77 ms)
        βœ“ [create] child with undefined parent should throw with type error (36 ms)
        βœ“ [create] nested child [create] should succeed (65 ms)
        β—‹ skipped relationMode=foreignKeys [create] child with non existing parent should throw
        β—‹ skipped relationMode=foreignKeys [create] child with non existing parent should throw
      [update]
        βœ“ [update] (user) optional boolean field should succeed (117 ms)
        βœ“ [update] (profile) optional boolean field should succeed (103 ms)
        βœ“ [update] (user) optional boolean field should succeed (136 ms)
        βœ“ [update] (profile) optional boolean field should succeed (117 ms)
        mutate id tests (skipped only for MongoDB)
          βœ“ [upsert] child id with non-existing id should succeed (88 ms)
          βœ“ [update] child id with non-existing id should succeed (84 ms)
          βœ“ [update] nested child [connect] child should succeed if the relationship didn't exist (108 ms)
          βœ“ [update] nested child [update] should succeed (104 ms)
          βœ“ [update] nested child [connect] should succeed if the relationship already existed (96 ms)
          βœ“ [upsert] child id with non-existing id should succeed (104 ms)
          βœ“ [update] child id with non-existing id should succeed (132 ms)
          βœ“ [update] nested child [connect] child should succeed if the relationship didn't exist (139 ms)
          βœ“ [update] nested child [update] should succeed (131 ms)
          βœ“ [update] nested child [connect] should succeed if the relationship already existed (106 ms)
          onUpdate: DEFAULT, Cascade
            β—‹ skipped [update] parent id with non-existing id should succeed
            β—‹ skipped [updateMany] parent id should succeed
            β—‹ skipped [update] parent id with non-existing id should succeed
            β—‹ skipped [updateMany] parent id should succeed
          onUpdate: Restrict, NoAction
            βœ“ [update] parent id with non-existing id should throw (93 ms)
            βœ“ [updateMany] parent id with non-existing id should throw (91 ms)
            βœ“ [update] parent id with non-existing id should throw (104 ms)
            βœ“ [updateMany] parent id with non-existing id should throw (108 ms)
          onUpdate: DEFAULT, Restrict, NoAction, SetNull
            βœ“ [update] parent id with existing id should throw (83 ms)
            βœ“ [updateMany] parent id with existing id should throw (84 ms)
            βœ“ [update] child id with existing id should throw (80 ms)
            βœ“ [update] nested child [disconnect] should throw (71 ms)
            βœ“ [update] parent id with existing id should throw (121 ms)
            βœ“ [updateMany] parent id with existing id should throw (100 ms)
            βœ“ [update] child id with existing id should throw (103 ms)
            βœ“ [update] nested child [disconnect] should throw (88 ms)
      [delete]
        βœ“ [delete] child should succeed (98 ms)
        βœ“ [delete] child and then [delete] parent should succeed (120 ms)
        βœ“ [delete] child should succeed (117 ms)
        βœ“ [delete] child and then [delete] parent should succeed (129 ms)
        onDelete: DEFAULT, Restrict, NoAction
          βœ“ [delete] parent should throw (82 ms)
          βœ“ [deleteMany] parents should throw (84 ms)
          βœ“ [delete] parent should throw (100 ms)
          βœ“ [deleteMany] parents should throw (100 ms)
        onDelete: SetNull
          β—‹ skipped [delete] parent should throw
          β—‹ skipped [deleteMany] parents should throw
          β—‹ skipped relationMode=prisma / SetNull: [delete] parent should throw
          β—‹ skipped relationMode=prisma / SetNull: [deleteMany] parents should throw
          β—‹ skipped [delete] parent should throw
          β—‹ skipped [deleteMany] parents should throw
          β—‹ skipped relationMode=prisma / SetNull: [delete] parent should throw
          β—‹ skipped relationMode=prisma / SetNull: [deleteMany] parents should throw
        onDelete: Cascade
          β—‹ skipped [delete] parent should succeed
          β—‹ skipped [delete] parent should succeed
  relationMode.tests_1-to-1 (relationMode=prisma,provider=mysql,providerFlavor=vitess_8,onUpdate=SetNull,onDelete=SetNull,id=String @id, previewFeatures=referentialIntegrity)
    1:1 mandatory (explicit)
      [create]
        βœ“ relationMode=prisma [create] child with non existing parent should succeed (77 ms)
        βœ“ [create] child with undefined parent should throw with type error (36 ms)
        βœ“ [create] nested child [create] should succeed (61 ms)
        βœ“ relationMode=prisma [create] child with non existing parent should succeed (76 ms)
        βœ“ [create] child with undefined parent should throw with type error (34 ms)
        βœ“ [create] nested child [create] should succeed (55 ms)
        β—‹ skipped relationMode=foreignKeys [create] child with non existing parent should throw
        β—‹ skipped relationMode=foreignKeys [create] child with non existing parent should throw
      [update]
        βœ“ [update] (user) optional boolean field should succeed (145 ms)
        βœ“ [update] (profile) optional boolean field should succeed (124 ms)
        βœ“ [update] (user) optional boolean field should succeed (140 ms)
        βœ“ [update] (profile) optional boolean field should succeed (126 ms)
        mutate id tests (skipped only for MongoDB)
          βœ“ [upsert] child id with non-existing id should succeed (105 ms)
          βœ“ [update] child id with non-existing id should succeed (114 ms)
          βœ“ [update] nested child [connect] child should succeed if the relationship didn't exist (132 ms)
          βœ“ [update] nested child [update] should succeed (116 ms)
          βœ“ [update] nested child [connect] should succeed if the relationship already existed (96 ms)
          βœ“ [upsert] child id with non-existing id should succeed (102 ms)
          βœ“ [update] child id with non-existing id should succeed (110 ms)
          βœ“ [update] nested child [connect] child should succeed if the relationship didn't exist (137 ms)
          βœ“ [update] nested child [update] should succeed (123 ms)
          βœ“ [update] nested child [connect] should succeed if the relationship already existed (104 ms)
          onUpdate: DEFAULT, Cascade
            β—‹ skipped [update] parent id with non-existing id should succeed
            β—‹ skipped [updateMany] parent id should succeed
            β—‹ skipped [update] parent id with non-existing id should succeed
            β—‹ skipped [updateMany] parent id should succeed
          onUpdate: Restrict, NoAction
            β—‹ skipped [update] parent id with non-existing id should throw
            β—‹ skipped [updateMany] parent id with non-existing id should throw
            β—‹ skipped [update] parent id with non-existing id should throw
            β—‹ skipped [updateMany] parent id with non-existing id should throw
          onUpdate: DEFAULT, Restrict, NoAction, SetNull
            βœ“ [update] parent id with existing id should throw (107 ms)
            βœ“ [updateMany] parent id with existing id should throw (113 ms)
            βœ“ [update] child id with existing id should throw (103 ms)
            βœ“ [update] nested child [disconnect] should throw (86 ms)
            βœ“ [update] parent id with existing id should throw (113 ms)
            βœ“ [updateMany] parent id with existing id should throw (123 ms)
            βœ“ [update] child id with existing id should throw (110 ms)
            βœ“ [update] nested child [disconnect] should throw (97 ms)
      [delete]
        βœ“ [delete] child should succeed (129 ms)
        βœ“ [delete] child and then [delete] parent should succeed (128 ms)
        βœ“ [delete] child should succeed (125 ms)
        βœ“ [delete] child and then [delete] parent should succeed (136 ms)
        onDelete: DEFAULT, Restrict, NoAction
          β—‹ skipped [delete] parent should throw
          β—‹ skipped [deleteMany] parents should throw
          β—‹ skipped [delete] parent should throw
          β—‹ skipped [deleteMany] parents should throw
        onDelete: SetNull
          βœ“ relationMode=prisma / SetNull: [delete] parent should throw (124 ms)
          βœ“ relationMode=prisma / SetNull: [deleteMany] parents should throw (115 ms)
          βœ“ relationMode=prisma / SetNull: [delete] parent should throw (114 ms)
          βœ“ relationMode=prisma / SetNull: [deleteMany] parents should throw (108 ms)
          β—‹ skipped [delete] parent should throw
          β—‹ skipped [deleteMany] parents should throw
          β—‹ skipped [delete] parent should throw
          β—‹ skipped [deleteMany] parents should throw
        onDelete: Cascade
          β—‹ skipped [delete] parent should succeed
          β—‹ skipped [delete] parent should succeed

Test Suites: 1 passed, 1 total
Tests:       94 skipped, 186 passed, 280 total
Snapshots:   0 total
Time:        599.355 s
Ran all test suites matching /relationMode\/tests_1-to-1.ts/i.

MySQL

❯ RELATION_MODE=prisma pnpm run test:functional:code --relation-mode-tests-only relationMode/tests_1-to-1.ts > mysql-1-to-1.txt
PASS tests/functional/relationMode/tests_1-to-1.ts (12.829 s)
  relationMode.tests_1-to-1 (relationMode=prisma,provider=mysql,providerFlavor=mysql,onUpdate=DEFAULT,onDelete=DEFAULT,id=String @id, previewFeatures=referentialIntegrity)
    1:1 mandatory (explicit)
      [create]
        βœ“ relationMode=prisma [create] child with non existing parent should succeed (50 ms)
        βœ“ [create] child with undefined parent should throw with type error (192 ms)
        βœ“ [create] nested child [create] should succeed (22 ms)
        βœ“ relationMode=prisma [create] child with non existing parent should succeed (35 ms)
        βœ“ [create] child with undefined parent should throw with type error (14 ms)
        βœ“ [create] nested child [create] should succeed (21 ms)
        β—‹ skipped relationMode=foreignKeys [create] child with non existing parent should throw
        β—‹ skipped relationMode=foreignKeys [create] child with non existing parent should throw
      [update]
        βœ“ [update] (user) optional boolean field should succeed (49 ms)
        βœ“ [update] (profile) optional boolean field should succeed (44 ms)
        βœ“ [update] (user) optional boolean field should succeed (46 ms)
        βœ“ [update] (profile) optional boolean field should succeed (40 ms)
        mutate id tests (skipped only for MongoDB)
          βœ“ [upsert] child id with non-existing id should succeed (44 ms)
          βœ“ [update] child id with non-existing id should succeed (49 ms)
          βœ“ [update] nested child [connect] child should succeed if the relationship didn't exist (50 ms)
          βœ“ [update] nested child [update] should succeed (47 ms)
          βœ“ [update] nested child [connect] should succeed if the relationship already existed (33 ms)
          βœ“ [upsert] child id with non-existing id should succeed (39 ms)
          βœ“ [update] child id with non-existing id should succeed (45 ms)
          βœ“ [update] nested child [connect] child should succeed if the relationship didn't exist (57 ms)
          βœ“ [update] nested child [update] should succeed (45 ms)
          βœ“ [update] nested child [connect] should succeed if the relationship already existed (38 ms)
          onUpdate: DEFAULT, Cascade
            βœ“ [update] parent id with non-existing id should succeed (58 ms)
            βœ“ [updateMany] parent id should succeed (65 ms)
            βœ“ [update] parent id with non-existing id should succeed (41 ms)
            βœ“ [updateMany] parent id should succeed (42 ms)
          onUpdate: Restrict, NoAction
            β—‹ skipped [update] parent id with non-existing id should throw
            β—‹ skipped [updateMany] parent id with non-existing id should throw
            β—‹ skipped [update] parent id with non-existing id should throw
            β—‹ skipped [updateMany] parent id with non-existing id should throw
          onUpdate: DEFAULT, Restrict, NoAction, SetNull
            βœ“ [update] parent id with existing id should throw (46 ms)
            βœ“ [updateMany] parent id with existing id should throw (49 ms)
            βœ“ [update] child id with existing id should throw (39 ms)
            βœ“ [update] nested child [disconnect] should throw (33 ms)
            βœ“ [update] parent id with existing id should throw (37 ms)
            βœ“ [updateMany] parent id with existing id should throw (34 ms)
            βœ“ [update] child id with existing id should throw (41 ms)
            βœ“ [update] nested child [disconnect] should throw (31 ms)
      [delete]
        βœ“ [delete] child should succeed (41 ms)
        βœ“ [delete] child and then [delete] parent should succeed (51 ms)
        βœ“ [delete] child should succeed (53 ms)
        βœ“ [delete] child and then [delete] parent should succeed (57 ms)
        onDelete: DEFAULT, Restrict, NoAction
          βœ“ [delete] parent should throw (48 ms)
          βœ“ [deleteMany] parents should throw (43 ms)
          βœ“ [delete] parent should throw (44 ms)
          βœ“ [deleteMany] parents should throw (36 ms)
        onDelete: SetNull
          β—‹ skipped [delete] parent should throw
          β—‹ skipped [deleteMany] parents should throw
          β—‹ skipped relationMode=prisma / SetNull: [delete] parent should throw
          β—‹ skipped relationMode=prisma / SetNull: [deleteMany] parents should throw
          β—‹ skipped [delete] parent should throw
          β—‹ skipped [deleteMany] parents should throw
          β—‹ skipped relationMode=prisma / SetNull: [delete] parent should throw
          β—‹ skipped relationMode=prisma / SetNull: [deleteMany] parents should throw
        onDelete: Cascade
          β—‹ skipped [delete] parent should succeed
          β—‹ skipped [delete] parent should succeed
  relationMode.tests_1-to-1 (relationMode=prisma,provider=mysql,providerFlavor=mysql,onUpdate=Cascade,onDelete=Cascade,id=String @id, previewFeatures=referentialIntegrity)
    1:1 mandatory (explicit)
      [create]
        βœ“ relationMode=prisma [create] child with non existing parent should succeed (41 ms)
        βœ“ [create] child with undefined parent should throw with type error (13 ms)
        βœ“ [create] nested child [create] should succeed (20 ms)
        βœ“ relationMode=prisma [create] child with non existing parent should succeed (35 ms)
        βœ“ [create] child with undefined parent should throw with type error (14 ms)
        βœ“ [create] nested child [create] should succeed (21 ms)
        β—‹ skipped relationMode=foreignKeys [create] child with non existing parent should throw
        β—‹ skipped relationMode=foreignKeys [create] child with non existing parent should throw
      [update]
        βœ“ [update] (user) optional boolean field should succeed (50 ms)
        βœ“ [update] (profile) optional boolean field should succeed (40 ms)
        βœ“ [update] (user) optional boolean field should succeed (46 ms)
        βœ“ [update] (profile) optional boolean field should succeed (49 ms)
        mutate id tests (skipped only for MongoDB)
          βœ“ [upsert] child id with non-existing id should succeed (41 ms)
          βœ“ [update] child id with non-existing id should succeed (38 ms)
          βœ“ [update] nested child [connect] child should succeed if the relationship didn't exist (48 ms)
          βœ“ [update] nested child [update] should succeed (46 ms)
          βœ“ [update] nested child [connect] should succeed if the relationship already existed (35 ms)
          βœ“ [upsert] child id with non-existing id should succeed (42 ms)
          βœ“ [update] child id with non-existing id should succeed (41 ms)
          βœ“ [update] nested child [connect] child should succeed if the relationship didn't exist (53 ms)
          βœ“ [update] nested child [update] should succeed (40 ms)
          βœ“ [update] nested child [connect] should succeed if the relationship already existed (33 ms)
          onUpdate: DEFAULT, Cascade
            βœ“ [update] parent id with non-existing id should succeed (41 ms)
            βœ“ [updateMany] parent id should succeed (43 ms)
            βœ“ [update] parent id with non-existing id should succeed (42 ms)
            βœ“ [updateMany] parent id should succeed (45 ms)
          onUpdate: Restrict, NoAction
            β—‹ skipped [update] parent id with non-existing id should throw
            β—‹ skipped [updateMany] parent id with non-existing id should throw
            β—‹ skipped [update] parent id with non-existing id should throw
            β—‹ skipped [updateMany] parent id with non-existing id should throw
          onUpdate: DEFAULT, Restrict, NoAction, SetNull
            β—‹ skipped [update] parent id with existing id should throw
            β—‹ skipped [updateMany] parent id with existing id should throw
            β—‹ skipped [update] child id with existing id should throw
            β—‹ skipped [update] nested child [disconnect] should throw
            β—‹ skipped [update] parent id with existing id should throw
            β—‹ skipped [updateMany] parent id with existing id should throw
            β—‹ skipped [update] child id with existing id should throw
            β—‹ skipped [update] nested child [disconnect] should throw
      [delete]
        βœ“ [delete] child should succeed (39 ms)
        βœ“ [delete] child and then [delete] parent should succeed (50 ms)
        βœ“ [delete] child should succeed (43 ms)
        βœ“ [delete] child and then [delete] parent should succeed (47 ms)
        onDelete: DEFAULT, Restrict, NoAction
          β—‹ skipped [delete] parent should throw
          β—‹ skipped [deleteMany] parents should throw
          β—‹ skipped [delete] parent should throw
          β—‹ skipped [deleteMany] parents should throw
        onDelete: SetNull
          β—‹ skipped [delete] parent should throw
          β—‹ skipped [deleteMany] parents should throw
          β—‹ skipped relationMode=prisma / SetNull: [delete] parent should throw
          β—‹ skipped relationMode=prisma / SetNull: [deleteMany] parents should throw
          β—‹ skipped [delete] parent should throw
          β—‹ skipped [deleteMany] parents should throw
          β—‹ skipped relationMode=prisma / SetNull: [delete] parent should throw
          β—‹ skipped relationMode=prisma / SetNull: [deleteMany] parents should throw
        onDelete: Cascade
          βœ“ [delete] parent should succeed (41 ms)
          βœ“ [delete] parent should succeed (40 ms)
  relationMode.tests_1-to-1 (relationMode=prisma,provider=mysql,providerFlavor=mysql,onUpdate=NoAction,onDelete=NoAction,id=String @id, previewFeatures=referentialIntegrity)
    1:1 mandatory (explicit)
      [create]
        βœ“ relationMode=prisma [create] child with non existing parent should succeed (34 ms)
        βœ“ [create] child with undefined parent should throw with type error (15 ms)
        βœ“ [create] nested child [create] should succeed (22 ms)
        βœ“ relationMode=prisma [create] child with non existing parent should succeed (35 ms)
        βœ“ [create] child with undefined parent should throw with type error (15 ms)
        βœ“ [create] nested child [create] should succeed (20 ms)
        β—‹ skipped relationMode=foreignKeys [create] child with non existing parent should throw
        β—‹ skipped relationMode=foreignKeys [create] child with non existing parent should throw
      [update]
        βœ“ [update] (user) optional boolean field should succeed (46 ms)
        βœ“ [update] (profile) optional boolean field should succeed (44 ms)
        βœ“ [update] (user) optional boolean field should succeed (49 ms)
        βœ“ [update] (profile) optional boolean field should succeed (47 ms)
        mutate id tests (skipped only for MongoDB)
          βœ“ [upsert] child id with non-existing id should succeed (38 ms)
          βœ“ [update] child id with non-existing id should succeed (37 ms)
          βœ“ [update] nested child [connect] child should succeed if the relationship didn't exist (55 ms)
          βœ“ [update] nested child [update] should succeed (48 ms)
          βœ“ [update] nested child [connect] should succeed if the relationship already existed (41 ms)
          βœ“ [upsert] child id with non-existing id should succeed (48 ms)
          βœ“ [update] child id with non-existing id should succeed (45 ms)
          βœ“ [update] nested child [connect] child should succeed if the relationship didn't exist (51 ms)
          βœ“ [update] nested child [update] should succeed (43 ms)
          βœ“ [update] nested child [connect] should succeed if the relationship already existed (35 ms)
          onUpdate: DEFAULT, Cascade
            β—‹ skipped [update] parent id with non-existing id should succeed
            β—‹ skipped [updateMany] parent id should succeed
            β—‹ skipped [update] parent id with non-existing id should succeed
            β—‹ skipped [updateMany] parent id should succeed
          onUpdate: Restrict, NoAction
            βœ“ [update] parent id with non-existing id should throw (35 ms)
            βœ“ [updateMany] parent id with non-existing id should throw (36 ms)
            βœ“ [update] parent id with non-existing id should throw (36 ms)
            βœ“ [updateMany] parent id with non-existing id should throw (34 ms)
          onUpdate: DEFAULT, Restrict, NoAction, SetNull
            βœ“ [update] parent id with existing id should throw (33 ms)
            βœ“ [updateMany] parent id with existing id should throw (68 ms)
            βœ“ [update] child id with existing id should throw (40 ms)
            βœ“ [update] nested child [disconnect] should throw (41 ms)
            βœ“ [update] parent id with existing id should throw (38 ms)
            βœ“ [updateMany] parent id with existing id should throw (35 ms)
            βœ“ [update] child id with existing id should throw (39 ms)
            βœ“ [update] nested child [disconnect] should throw (33 ms)
      [delete]
        βœ“ [delete] child should succeed (39 ms)
        βœ“ [delete] child and then [delete] parent should succeed (50 ms)
        βœ“ [delete] child should succeed (40 ms)
        βœ“ [delete] child and then [delete] parent should succeed (51 ms)
        onDelete: DEFAULT, Restrict, NoAction
          βœ“ [delete] parent should throw (41 ms)
          βœ“ [deleteMany] parents should throw (42 ms)
          βœ“ [delete] parent should throw (36 ms)
          βœ“ [deleteMany] parents should throw (38 ms)
        onDelete: SetNull
          β—‹ skipped [delete] parent should throw
          β—‹ skipped [deleteMany] parents should throw
          β—‹ skipped relationMode=prisma / SetNull: [delete] parent should throw
          β—‹ skipped relationMode=prisma / SetNull: [deleteMany] parents should throw
          β—‹ skipped [delete] parent should throw
          β—‹ skipped [deleteMany] parents should throw
          β—‹ skipped relationMode=prisma / SetNull: [delete] parent should throw
          β—‹ skipped relationMode=prisma / SetNull: [deleteMany] parents should throw
        onDelete: Cascade
          β—‹ skipped [delete] parent should succeed
          β—‹ skipped [delete] parent should succeed
  relationMode.tests_1-to-1 (relationMode=prisma,provider=mysql,providerFlavor=mysql,onUpdate=Restrict,onDelete=Restrict,id=String @id, previewFeatures=referentialIntegrity)
    1:1 mandatory (explicit)
      [create]
        βœ“ relationMode=prisma [create] child with non existing parent should succeed (36 ms)
        βœ“ [create] child with undefined parent should throw with type error (15 ms)
        βœ“ [create] nested child [create] should succeed (20 ms)
        βœ“ relationMode=prisma [create] child with non existing parent should succeed (37 ms)
        βœ“ [create] child with undefined parent should throw with type error (15 ms)
        βœ“ [create] nested child [create] should succeed (21 ms)
        β—‹ skipped relationMode=foreignKeys [create] child with non existing parent should throw
        β—‹ skipped relationMode=foreignKeys [create] child with non existing parent should throw
      [update]
        βœ“ [update] (user) optional boolean field should succeed (49 ms)
        βœ“ [update] (profile) optional boolean field should succeed (48 ms)
        βœ“ [update] (user) optional boolean field should succeed (55 ms)
        βœ“ [update] (profile) optional boolean field should succeed (46 ms)
        mutate id tests (skipped only for MongoDB)
          βœ“ [upsert] child id with non-existing id should succeed (41 ms)
          βœ“ [update] child id with non-existing id should succeed (39 ms)
          βœ“ [update] nested child [connect] child should succeed if the relationship didn't exist (52 ms)
          βœ“ [update] nested child [update] should succeed (48 ms)
          βœ“ [update] nested child [connect] should succeed if the relationship already existed (40 ms)
          βœ“ [upsert] child id with non-existing id should succeed (39 ms)
          βœ“ [update] child id with non-existing id should succeed (59 ms)
          βœ“ [update] nested child [connect] child should succeed if the relationship didn't exist (52 ms)
          βœ“ [update] nested child [update] should succeed (41 ms)
          βœ“ [update] nested child [connect] should succeed if the relationship already existed (35 ms)
          onUpdate: DEFAULT, Cascade
            β—‹ skipped [update] parent id with non-existing id should succeed
            β—‹ skipped [updateMany] parent id should succeed
            β—‹ skipped [update] parent id with non-existing id should succeed
            β—‹ skipped [updateMany] parent id should succeed
          onUpdate: Restrict, NoAction
            βœ“ [update] parent id with non-existing id should throw (36 ms)
            βœ“ [updateMany] parent id with non-existing id should throw (34 ms)
            βœ“ [update] parent id with non-existing id should throw (36 ms)
            βœ“ [updateMany] parent id with non-existing id should throw (36 ms)
          onUpdate: DEFAULT, Restrict, NoAction, SetNull
            βœ“ [update] parent id with existing id should throw (36 ms)
            βœ“ [updateMany] parent id with existing id should throw (38 ms)
            βœ“ [update] child id with existing id should throw (36 ms)
            βœ“ [update] nested child [disconnect] should throw (30 ms)
            βœ“ [update] parent id with existing id should throw (33 ms)
            βœ“ [updateMany] parent id with existing id should throw (34 ms)
            βœ“ [update] child id with existing id should throw (38 ms)
            βœ“ [update] nested child [disconnect] should throw (32 ms)
      [delete]
        βœ“ [delete] child should succeed (42 ms)
        βœ“ [delete] child and then [delete] parent should succeed (49 ms)
        βœ“ [delete] child should succeed (48 ms)
        βœ“ [delete] child and then [delete] parent should succeed (58 ms)
        onDelete: DEFAULT, Restrict, NoAction
          βœ“ [delete] parent should throw (46 ms)
          βœ“ [deleteMany] parents should throw (43 ms)
          βœ“ [delete] parent should throw (41 ms)
          βœ“ [deleteMany] parents should throw (43 ms)
        onDelete: SetNull
          β—‹ skipped [delete] parent should throw
          β—‹ skipped [deleteMany] parents should throw
          β—‹ skipped relationMode=prisma / SetNull: [delete] parent should throw
          β—‹ skipped relationMode=prisma / SetNull: [deleteMany] parents should throw
          β—‹ skipped [delete] parent should throw
          β—‹ skipped [deleteMany] parents should throw
          β—‹ skipped relationMode=prisma / SetNull: [delete] parent should throw
          β—‹ skipped relationMode=prisma / SetNull: [deleteMany] parents should throw
        onDelete: Cascade
          β—‹ skipped [delete] parent should succeed
          β—‹ skipped [delete] parent should succeed
  relationMode.tests_1-to-1 (relationMode=prisma,provider=mysql,providerFlavor=mysql,onUpdate=SetNull,onDelete=SetNull,id=String @id, previewFeatures=referentialIntegrity)
    1:1 mandatory (explicit)
      [create]
        βœ“ relationMode=prisma [create] child with non existing parent should succeed (38 ms)
        βœ“ [create] child with undefined parent should throw with type error (14 ms)
        βœ“ [create] nested child [create] should succeed (21 ms)
        βœ“ relationMode=prisma [create] child with non existing parent should succeed (41 ms)
        βœ“ [create] child with undefined parent should throw with type error (17 ms)
        βœ“ [create] nested child [create] should succeed (21 ms)
        β—‹ skipped relationMode=foreignKeys [create] child with non existing parent should throw
        β—‹ skipped relationMode=foreignKeys [create] child with non existing parent should throw
      [update]
        βœ“ [update] (user) optional boolean field should succeed (42 ms)
        βœ“ [update] (profile) optional boolean field should succeed (40 ms)
        βœ“ [update] (user) optional boolean field should succeed (45 ms)
        βœ“ [update] (profile) optional boolean field should succeed (45 ms)
        mutate id tests (skipped only for MongoDB)
          βœ“ [upsert] child id with non-existing id should succeed (43 ms)
          βœ“ [update] child id with non-existing id should succeed (39 ms)
          βœ“ [update] nested child [connect] child should succeed if the relationship didn't exist (48 ms)
          βœ“ [update] nested child [update] should succeed (45 ms)
          βœ“ [update] nested child [connect] should succeed if the relationship already existed (40 ms)
          βœ“ [upsert] child id with non-existing id should succeed (48 ms)
          βœ“ [update] child id with non-existing id should succeed (45 ms)
          βœ“ [update] nested child [connect] child should succeed if the relationship didn't exist (56 ms)
          βœ“ [update] nested child [update] should succeed (47 ms)
          βœ“ [update] nested child [connect] should succeed if the relationship already existed (37 ms)
          onUpdate: DEFAULT, Cascade
            β—‹ skipped [update] parent id with non-existing id should succeed
            β—‹ skipped [updateMany] parent id should succeed
            β—‹ skipped [update] parent id with non-existing id should succeed
            β—‹ skipped [updateMany] parent id should succeed
          onUpdate: Restrict, NoAction
            β—‹ skipped [update] parent id with non-existing id should throw
            β—‹ skipped [updateMany] parent id with non-existing id should throw
            β—‹ skipped [update] parent id with non-existing id should throw
            β—‹ skipped [updateMany] parent id with non-existing id should throw
          onUpdate: DEFAULT, Restrict, NoAction, SetNull
            βœ“ [update] parent id with existing id should throw (53 ms)
            βœ“ [updateMany] parent id with existing id should throw (49 ms)
            βœ“ [update] child id with existing id should throw (37 ms)
            βœ“ [update] nested child [disconnect] should throw (32 ms)
            βœ“ [update] parent id with existing id should throw (44 ms)
            βœ“ [updateMany] parent id with existing id should throw (46 ms)
            βœ“ [update] child id with existing id should throw (38 ms)
            βœ“ [update] nested child [disconnect] should throw (33 ms)
      [delete]
        βœ“ [delete] child should succeed (45 ms)
        βœ“ [delete] child and then [delete] parent should succeed (52 ms)
        βœ“ [delete] child should succeed (42 ms)
        βœ“ [delete] child and then [delete] parent should succeed (51 ms)
        onDelete: DEFAULT, Restrict, NoAction
          β—‹ skipped [delete] parent should throw
          β—‹ skipped [deleteMany] parents should throw
          β—‹ skipped [delete] parent should throw
          β—‹ skipped [deleteMany] parents should throw
        onDelete: SetNull
          βœ“ relationMode=prisma / SetNull: [delete] parent should throw (51 ms)
          βœ“ relationMode=prisma / SetNull: [deleteMany] parents should throw (45 ms)
          βœ“ relationMode=prisma / SetNull: [delete] parent should throw (52 ms)
          βœ“ relationMode=prisma / SetNull: [deleteMany] parents should throw (48 ms)
          β—‹ skipped [delete] parent should throw
          β—‹ skipped [deleteMany] parents should throw
          β—‹ skipped [delete] parent should throw
          β—‹ skipped [deleteMany] parents should throw
        onDelete: Cascade
          β—‹ skipped [delete] parent should succeed
          β—‹ skipped [delete] parent should succeed

Test Suites: 1 passed, 1 total
Tests:       94 skipped, 186 passed, 280 total
Snapshots:   0 total
Time:        12.857 s, estimated 600 s
Ran all test suites matching /relationMode\/tests_1-to-1.ts/i.
Read more comments on GitHub >

github_iconTop Results From Across the Web

Using Prisma with PlanetScale
This document discusses the concepts behind using Prisma and PlanetScale, explains the commonalities and differences between PlanetScale and other databaseΒ ...
Read more >
Unit testing with Prisma
Unit testing aims to isolate a small portion (unit) of code and test it for logically predictable behaviors. It generally involves mocking objects...
Read more >
The Ultimate Guide to Testing with Prisma
In this series, you will learn how to perform different types of tests against various applications that interact with a database. This articleΒ ......
Read more >
MySQL database connector (Reference) - Prisma
This page explains how Prisma can connect to a MySQL database using the MySQL ... of seconds to wait for a new connection...
Read more >
Integration testing with Prisma
Integration tests focus on testing how separate parts of the program work together. In the context of applications using a database, integration tests...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found