Skip to content

Commit

Permalink
Update FindProjectInfoBySecretKey test
Browse files Browse the repository at this point in the history
Update FindProjectInfoBySecretKey test
  • Loading branch information
raararaara committed Jan 9, 2024
1 parent d391669 commit cd8f9be
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions server/backend/database/testcases/testcases.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,16 @@ func RunFindProjectInfoBySecretKeyTest(
t.Run("FindProjectInfoBySecretKey test", func(t *testing.T) {
ctx := context.Background()

info1, err := db.CreateProjectInfo(ctx, t.Name(), dummyOwnerID, clientDeactivateThreshold)
assert.NoError(t, err)
_, err = db.CreateProjectInfo(ctx, t.Name(), otherOwnerID, clientDeactivateThreshold)
username := "admin@yorkie.dev"
password := "hashed-password"

_, project, err := db.EnsureDefaultUserAndProject(ctx, username, password, clientDeactivateThreshold)
assert.NoError(t, err)

info2, err := db.FindProjectInfoBySecretKey(ctx, info1.SecretKey)
info2, err := db.FindProjectInfoBySecretKey(ctx, project.SecretKey)
assert.NoError(t, err)
assert.Equal(t, info1.ID, info2.ID)

assert.Equal(t, project.ID, info2.ID)
})
}

Expand Down

1 comment on commit cd8f9be

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Go Benchmark

Benchmark suite Current: cd8f9be Previous: d391669 Ratio
BenchmarkDocument/constructor_test - ns/op 1387 ns/op 1348 ns/op 1.03
BenchmarkDocument/constructor_test - B/op 1208 B/op 1208 B/op 1
BenchmarkDocument/constructor_test - allocs/op 20 allocs/op 20 allocs/op 1
BenchmarkDocument/status_test - ns/op 789.1 ns/op 774.9 ns/op 1.02
BenchmarkDocument/status_test - B/op 1176 B/op 1176 B/op 1
BenchmarkDocument/status_test - allocs/op 18 allocs/op 18 allocs/op 1
BenchmarkDocument/equals_test - ns/op 7079 ns/op 7095 ns/op 1.00
BenchmarkDocument/equals_test - B/op 6913 B/op 6913 B/op 1
BenchmarkDocument/equals_test - allocs/op 120 allocs/op 120 allocs/op 1
BenchmarkDocument/nested_update_test - ns/op 16175 ns/op 18023 ns/op 0.90
BenchmarkDocument/nested_update_test - B/op 11963 B/op 11963 B/op 1
BenchmarkDocument/nested_update_test - allocs/op 254 allocs/op 254 allocs/op 1
BenchmarkDocument/delete_test - ns/op 25030 ns/op 21860 ns/op 1.15
BenchmarkDocument/delete_test - B/op 15188 B/op 15188 B/op 1
BenchmarkDocument/delete_test - allocs/op 333 allocs/op 333 allocs/op 1
BenchmarkDocument/object_test - ns/op 8311 ns/op 8299 ns/op 1.00
BenchmarkDocument/object_test - B/op 6721 B/op 6721 B/op 1
BenchmarkDocument/object_test - allocs/op 116 allocs/op 116 allocs/op 1
BenchmarkDocument/array_test - ns/op 28611 ns/op 28416 ns/op 1.01
BenchmarkDocument/array_test - B/op 11818 B/op 11819 B/op 1.00
BenchmarkDocument/array_test - allocs/op 270 allocs/op 270 allocs/op 1
BenchmarkDocument/text_test - ns/op 30424 ns/op 30734 ns/op 0.99
BenchmarkDocument/text_test - B/op 14883 B/op 14795 B/op 1.01
BenchmarkDocument/text_test - allocs/op 468 allocs/op 468 allocs/op 1
BenchmarkDocument/text_composition_test - ns/op 28837 ns/op 28436 ns/op 1.01
BenchmarkDocument/text_composition_test - B/op 18398 B/op 18278 B/op 1.01
BenchmarkDocument/text_composition_test - allocs/op 477 allocs/op 477 allocs/op 1
BenchmarkDocument/rich_text_test - ns/op 80835 ns/op 79377 ns/op 1.02
BenchmarkDocument/rich_text_test - B/op 38644 B/op 38540 B/op 1.00
BenchmarkDocument/rich_text_test - allocs/op 1147 allocs/op 1147 allocs/op 1
BenchmarkDocument/counter_test - ns/op 16788 ns/op 16429 ns/op 1.02
BenchmarkDocument/counter_test - B/op 10210 B/op 10210 B/op 1
BenchmarkDocument/counter_test - allocs/op 236 allocs/op 236 allocs/op 1
BenchmarkDocument/text_edit_gc_100 - ns/op 2875117 ns/op 2870698 ns/op 1.00
BenchmarkDocument/text_edit_gc_100 - B/op 1658551 B/op 1655216 B/op 1.00
BenchmarkDocument/text_edit_gc_100 - allocs/op 17093 allocs/op 17091 allocs/op 1.00
BenchmarkDocument/text_edit_gc_1000 - ns/op 229910589 ns/op 227911236 ns/op 1.01
BenchmarkDocument/text_edit_gc_1000 - B/op 144355123 B/op 144348859 B/op 1.00
BenchmarkDocument/text_edit_gc_1000 - allocs/op 200809 allocs/op 200920 allocs/op 1.00
BenchmarkDocument/text_split_gc_100 - ns/op 3384060 ns/op 3341420 ns/op 1.01
BenchmarkDocument/text_split_gc_100 - B/op 2316932 B/op 2313404 B/op 1.00
BenchmarkDocument/text_split_gc_100 - allocs/op 16196 allocs/op 16193 allocs/op 1.00
BenchmarkDocument/text_split_gc_1000 - ns/op 288473500 ns/op 284979132 ns/op 1.01
BenchmarkDocument/text_split_gc_1000 - B/op 228921512 B/op 228892912 B/op 1.00
BenchmarkDocument/text_split_gc_1000 - allocs/op 203949 allocs/op 203950 allocs/op 1.00
BenchmarkDocument/text_delete_all_10000 - ns/op 10508975 ns/op 10649517 ns/op 0.99
BenchmarkDocument/text_delete_all_10000 - B/op 5810524 B/op 5809883 B/op 1.00
BenchmarkDocument/text_delete_all_10000 - allocs/op 40674 allocs/op 40671 allocs/op 1.00
BenchmarkDocument/text_delete_all_100000 - ns/op 178351708 ns/op 186393795 ns/op 0.96
BenchmarkDocument/text_delete_all_100000 - B/op 81903045 B/op 81904469 B/op 1.00
BenchmarkDocument/text_delete_all_100000 - allocs/op 411631 allocs/op 411644 allocs/op 1.00
BenchmarkDocument/text_100 - ns/op 229888 ns/op 216510 ns/op 1.06
BenchmarkDocument/text_100 - B/op 120107 B/op 118483 B/op 1.01
BenchmarkDocument/text_100 - allocs/op 5080 allocs/op 5080 allocs/op 1
BenchmarkDocument/text_1000 - ns/op 2485903 ns/op 2354446 ns/op 1.06
BenchmarkDocument/text_1000 - B/op 1169095 B/op 1153053 B/op 1.01
BenchmarkDocument/text_1000 - allocs/op 50084 allocs/op 50084 allocs/op 1
BenchmarkDocument/array_1000 - ns/op 1244723 ns/op 1167715 ns/op 1.07
BenchmarkDocument/array_1000 - B/op 1091368 B/op 1091275 B/op 1.00
BenchmarkDocument/array_1000 - allocs/op 11826 allocs/op 11825 allocs/op 1.00
BenchmarkDocument/array_10000 - ns/op 13153739 ns/op 12925120 ns/op 1.02
BenchmarkDocument/array_10000 - B/op 9800137 B/op 9799997 B/op 1.00
BenchmarkDocument/array_10000 - allocs/op 120292 allocs/op 120290 allocs/op 1.00
BenchmarkDocument/array_gc_100 - ns/op 152382 ns/op 143218 ns/op 1.06
BenchmarkDocument/array_gc_100 - B/op 132492 B/op 132500 B/op 1.00
BenchmarkDocument/array_gc_100 - allocs/op 1248 allocs/op 1249 allocs/op 1.00
BenchmarkDocument/array_gc_1000 - ns/op 1416328 ns/op 1362603 ns/op 1.04
BenchmarkDocument/array_gc_1000 - B/op 1158876 B/op 1158952 B/op 1.00
BenchmarkDocument/array_gc_1000 - allocs/op 12864 allocs/op 12865 allocs/op 1.00
BenchmarkDocument/counter_1000 - ns/op 210759 ns/op 192998 ns/op 1.09
BenchmarkDocument/counter_1000 - B/op 192853 B/op 192852 B/op 1.00
BenchmarkDocument/counter_1000 - allocs/op 5765 allocs/op 5765 allocs/op 1
BenchmarkDocument/counter_10000 - ns/op 2217090 ns/op 2121356 ns/op 1.05
BenchmarkDocument/counter_10000 - B/op 2087767 B/op 2087765 B/op 1.00
BenchmarkDocument/counter_10000 - allocs/op 59772 allocs/op 59772 allocs/op 1
BenchmarkDocument/object_1000 - ns/op 1413773 ns/op 1323428 ns/op 1.07
BenchmarkDocument/object_1000 - B/op 1428142 B/op 1427932 B/op 1.00
BenchmarkDocument/object_1000 - allocs/op 9845 allocs/op 9844 allocs/op 1.00
BenchmarkDocument/object_10000 - ns/op 14958539 ns/op 14952592 ns/op 1.00
BenchmarkDocument/object_10000 - B/op 12168732 B/op 12166471 B/op 1.00
BenchmarkDocument/object_10000 - allocs/op 100566 allocs/op 100558 allocs/op 1.00
BenchmarkDocument/tree_100 - ns/op 1064505 ns/op 998783 ns/op 1.07
BenchmarkDocument/tree_100 - B/op 943677 B/op 943673 B/op 1.00
BenchmarkDocument/tree_100 - allocs/op 6099 allocs/op 6099 allocs/op 1
BenchmarkDocument/tree_1000 - ns/op 77110261 ns/op 74036459 ns/op 1.04
BenchmarkDocument/tree_1000 - B/op 86460461 B/op 86460238 B/op 1.00
BenchmarkDocument/tree_1000 - allocs/op 60113 allocs/op 60112 allocs/op 1.00
BenchmarkDocument/tree_10000 - ns/op 9603920461 ns/op 9238843028 ns/op 1.04
BenchmarkDocument/tree_10000 - B/op 8580992632 B/op 8580993112 B/op 1.00
BenchmarkDocument/tree_10000 - allocs/op 600255 allocs/op 600251 allocs/op 1.00
BenchmarkDocument/tree_delete_all_1000 - ns/op 77617925 ns/op 71588951 ns/op 1.08
BenchmarkDocument/tree_delete_all_1000 - B/op 86990470 B/op 86990417 B/op 1.00
BenchmarkDocument/tree_delete_all_1000 - allocs/op 67749 allocs/op 67750 allocs/op 1.00
BenchmarkDocument/tree_edit_gc_100 - ns/op 3876269 ns/op 3588143 ns/op 1.08
BenchmarkDocument/tree_edit_gc_100 - B/op 4120967 B/op 4120927 B/op 1.00
BenchmarkDocument/tree_edit_gc_100 - allocs/op 14356 allocs/op 14355 allocs/op 1.00
BenchmarkDocument/tree_edit_gc_1000 - ns/op 321969082 ns/op 292095970 ns/op 1.10
BenchmarkDocument/tree_edit_gc_1000 - B/op 383467520 B/op 383466214 B/op 1.00
BenchmarkDocument/tree_edit_gc_1000 - allocs/op 145419 allocs/op 145408 allocs/op 1.00
BenchmarkDocument/tree_split_gc_100 - ns/op 2608428 ns/op 2419488 ns/op 1.08
BenchmarkDocument/tree_split_gc_100 - B/op 2386860 B/op 2386838 B/op 1.00
BenchmarkDocument/tree_split_gc_100 - allocs/op 10341 allocs/op 10341 allocs/op 1
BenchmarkDocument/tree_split_gc_1000 - ns/op 195534589 ns/op 175905530 ns/op 1.11
BenchmarkDocument/tree_split_gc_1000 - B/op 221991910 B/op 221990052 B/op 1.00
BenchmarkDocument/tree_split_gc_1000 - allocs/op 112263 allocs/op 112245 allocs/op 1.00
BenchmarkRPC/client_to_server - ns/op 353834768 ns/op 345650310 ns/op 1.02
BenchmarkRPC/client_to_server - B/op 17807450 B/op 16395133 B/op 1.09
BenchmarkRPC/client_to_server - allocs/op 166898 allocs/op 166812 allocs/op 1.00
BenchmarkRPC/client_to_client_via_server - ns/op 603249050 ns/op 599230474 ns/op 1.01
BenchmarkRPC/client_to_client_via_server - B/op 31181532 B/op 31200524 B/op 1.00
BenchmarkRPC/client_to_client_via_server - allocs/op 311902 allocs/op 312356 allocs/op 1.00
BenchmarkRPC/attach_large_document - ns/op 1164924029 ns/op 1320790007 ns/op 0.88
BenchmarkRPC/attach_large_document - B/op 1878746528 B/op 1889214992 B/op 0.99
BenchmarkRPC/attach_large_document - allocs/op 7556 allocs/op 7549 allocs/op 1.00
BenchmarkRPC/adminCli_to_server - ns/op 537119900 ns/op 524792658 ns/op 1.02
BenchmarkRPC/adminCli_to_server - B/op 37620852 B/op 35979672 B/op 1.05
BenchmarkRPC/adminCli_to_server - allocs/op 289724 allocs/op 289662 allocs/op 1.00
BenchmarkLocker - ns/op 64.45 ns/op 64.08 ns/op 1.01
BenchmarkLocker - B/op 16 B/op 16 B/op 1
BenchmarkLocker - allocs/op 1 allocs/op 1 allocs/op 1
BenchmarkLockerParallel - ns/op 38.59 ns/op 37.88 ns/op 1.02
BenchmarkLockerParallel - B/op 0 B/op 0 B/op NaN
BenchmarkLockerParallel - allocs/op 0 allocs/op 0 allocs/op NaN
BenchmarkLockerMoreKeys - ns/op 179.8 ns/op 138.8 ns/op 1.30
BenchmarkLockerMoreKeys - B/op 15 B/op 15 B/op 1
BenchmarkLockerMoreKeys - allocs/op 0 allocs/op 0 allocs/op NaN
BenchmarkChange/Push_10_Changes - ns/op 3754055 ns/op 3738509 ns/op 1.00
BenchmarkChange/Push_10_Changes - B/op 126213 B/op 127083 B/op 0.99
BenchmarkChange/Push_10_Changes - allocs/op 1254 allocs/op 1254 allocs/op 1
BenchmarkChange/Push_100_Changes - ns/op 14239898 ns/op 13951923 ns/op 1.02
BenchmarkChange/Push_100_Changes - B/op 650066 B/op 646730 B/op 1.01
BenchmarkChange/Push_100_Changes - allocs/op 6538 allocs/op 6540 allocs/op 1.00
BenchmarkChange/Push_1000_Changes - ns/op 112097310 ns/op 111633212 ns/op 1.00
BenchmarkChange/Push_1000_Changes - B/op 5965180 B/op 6052291 B/op 0.99
BenchmarkChange/Push_1000_Changes - allocs/op 62158 allocs/op 62156 allocs/op 1.00
BenchmarkChange/Pull_10_Changes - ns/op 2816699 ns/op 2807725 ns/op 1.00
BenchmarkChange/Pull_10_Changes - B/op 100848 B/op 101299 B/op 1.00
BenchmarkChange/Pull_10_Changes - allocs/op 952 allocs/op 951 allocs/op 1.00
BenchmarkChange/Pull_100_Changes - ns/op 4246291 ns/op 4259998 ns/op 1.00
BenchmarkChange/Pull_100_Changes - B/op 258410 B/op 259044 B/op 1.00
BenchmarkChange/Pull_100_Changes - allocs/op 3154 allocs/op 3154 allocs/op 1
BenchmarkChange/Pull_1000_Changes - ns/op 8218747 ns/op 8186496 ns/op 1.00
BenchmarkChange/Pull_1000_Changes - B/op 1396394 B/op 1399630 B/op 1.00
BenchmarkChange/Pull_1000_Changes - allocs/op 26874 allocs/op 26877 allocs/op 1.00
BenchmarkSnapshot/Push_3KB_snapshot - ns/op 16454035 ns/op 16788712 ns/op 0.98
BenchmarkSnapshot/Push_3KB_snapshot - B/op 805018 B/op 814611 B/op 0.99
BenchmarkSnapshot/Push_3KB_snapshot - allocs/op 6541 allocs/op 6542 allocs/op 1.00
BenchmarkSnapshot/Push_30KB_snapshot - ns/op 115859415 ns/op 116153491 ns/op 1.00
BenchmarkSnapshot/Push_30KB_snapshot - B/op 6376813 B/op 6295727 B/op 1.01
BenchmarkSnapshot/Push_30KB_snapshot - allocs/op 62164 allocs/op 62346 allocs/op 1.00
BenchmarkSnapshot/Pull_3KB_snapshot - ns/op 6531175 ns/op 6588486 ns/op 0.99
BenchmarkSnapshot/Pull_3KB_snapshot - B/op 906289 B/op 908101 B/op 1.00
BenchmarkSnapshot/Pull_3KB_snapshot - allocs/op 14878 allocs/op 14882 allocs/op 1.00
BenchmarkSnapshot/Pull_30KB_snapshot - ns/op 14950509 ns/op 14361476 ns/op 1.04
BenchmarkSnapshot/Pull_30KB_snapshot - B/op 6983302 B/op 6995643 B/op 1.00
BenchmarkSnapshot/Pull_30KB_snapshot - allocs/op 144141 allocs/op 144141 allocs/op 1
BenchmarkSync/memory_sync_10_test - ns/op 6657 ns/op 6687 ns/op 1.00
BenchmarkSync/memory_sync_10_test - B/op 1286 B/op 1286 B/op 1
BenchmarkSync/memory_sync_10_test - allocs/op 38 allocs/op 38 allocs/op 1
BenchmarkSync/memory_sync_100_test - ns/op 50862 ns/op 52081 ns/op 0.98
BenchmarkSync/memory_sync_100_test - B/op 8659 B/op 8642 B/op 1.00
BenchmarkSync/memory_sync_100_test - allocs/op 274 allocs/op 273 allocs/op 1.00
BenchmarkSync/memory_sync_1000_test - ns/op 578851 ns/op 587862 ns/op 0.98
BenchmarkSync/memory_sync_1000_test - B/op 74807 B/op 74357 B/op 1.01
BenchmarkSync/memory_sync_1000_test - allocs/op 2135 allocs/op 2110 allocs/op 1.01
BenchmarkSync/memory_sync_10000_test - ns/op 6880172 ns/op 6961544 ns/op 0.99
BenchmarkSync/memory_sync_10000_test - B/op 760971 B/op 764082 B/op 1.00
BenchmarkSync/memory_sync_10000_test - allocs/op 20619 allocs/op 20603 allocs/op 1.00
BenchmarkTextEditing - ns/op 18572722247 ns/op 18032931695 ns/op 1.03
BenchmarkTextEditing - B/op 9041947128 B/op 9038055344 B/op 1.00
BenchmarkTextEditing - allocs/op 19922501 allocs/op 19923783 allocs/op 1.00

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.