Skip to content

Commit

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

info1, err := db.FindProjectInfoByID(ctx, database.DefaultProjectID)
username := "[email protected]"
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 f637f44

@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: f637f44 Previous: d391669 Ratio
BenchmarkDocument/constructor_test - ns/op 1324 ns/op 1348 ns/op 0.98
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 776.9 ns/op 774.9 ns/op 1.00
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 8157 ns/op 7095 ns/op 1.15
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 16185 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 22023 ns/op 21860 ns/op 1.01
BenchmarkDocument/delete_test - B/op 15187 B/op 15188 B/op 1.00
BenchmarkDocument/delete_test - allocs/op 333 allocs/op 333 allocs/op 1
BenchmarkDocument/object_test - ns/op 8392 ns/op 8299 ns/op 1.01
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 28720 ns/op 28416 ns/op 1.01
BenchmarkDocument/array_test - B/op 11819 B/op 11819 B/op 1
BenchmarkDocument/array_test - allocs/op 270 allocs/op 270 allocs/op 1
BenchmarkDocument/text_test - ns/op 30622 ns/op 30734 ns/op 1.00
BenchmarkDocument/text_test - B/op 14884 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 28789 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 79441 ns/op 79377 ns/op 1.00
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 16581 ns/op 16429 ns/op 1.01
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 2904497 ns/op 2870698 ns/op 1.01
BenchmarkDocument/text_edit_gc_100 - B/op 1658706 B/op 1655216 B/op 1.00
BenchmarkDocument/text_edit_gc_100 - allocs/op 17094 allocs/op 17091 allocs/op 1.00
BenchmarkDocument/text_edit_gc_1000 - ns/op 230989704 ns/op 227911236 ns/op 1.01
BenchmarkDocument/text_edit_gc_1000 - B/op 144381852 B/op 144348859 B/op 1.00
BenchmarkDocument/text_edit_gc_1000 - allocs/op 200939 allocs/op 200920 allocs/op 1.00
BenchmarkDocument/text_split_gc_100 - ns/op 3374418 ns/op 3341420 ns/op 1.01
BenchmarkDocument/text_split_gc_100 - B/op 2316837 B/op 2313404 B/op 1.00
BenchmarkDocument/text_split_gc_100 - allocs/op 16194 allocs/op 16193 allocs/op 1.00
BenchmarkDocument/text_split_gc_1000 - ns/op 287213246 ns/op 284979132 ns/op 1.01
BenchmarkDocument/text_split_gc_1000 - B/op 228946088 B/op 228892912 B/op 1.00
BenchmarkDocument/text_split_gc_1000 - allocs/op 204050 allocs/op 203950 allocs/op 1.00
BenchmarkDocument/text_delete_all_10000 - ns/op 11248896 ns/op 10649517 ns/op 1.06
BenchmarkDocument/text_delete_all_10000 - B/op 5810382 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 187540500 ns/op 186393795 ns/op 1.01
BenchmarkDocument/text_delete_all_100000 - B/op 81899429 B/op 81904469 B/op 1.00
BenchmarkDocument/text_delete_all_100000 - allocs/op 411620 allocs/op 411644 allocs/op 1.00
BenchmarkDocument/text_100 - ns/op 222977 ns/op 216510 ns/op 1.03
BenchmarkDocument/text_100 - B/op 120105 B/op 118483 B/op 1.01
BenchmarkDocument/text_100 - allocs/op 5080 allocs/op 5080 allocs/op 1
BenchmarkDocument/text_1000 - ns/op 2435371 ns/op 2354446 ns/op 1.03
BenchmarkDocument/text_1000 - B/op 1169094 B/op 1153053 B/op 1.01
BenchmarkDocument/text_1000 - allocs/op 50084 allocs/op 50084 allocs/op 1
BenchmarkDocument/array_1000 - ns/op 1217112 ns/op 1167715 ns/op 1.04
BenchmarkDocument/array_1000 - B/op 1091332 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 12935459 ns/op 12925120 ns/op 1.00
BenchmarkDocument/array_10000 - B/op 9799391 B/op 9799997 B/op 1.00
BenchmarkDocument/array_10000 - allocs/op 120288 allocs/op 120290 allocs/op 1.00
BenchmarkDocument/array_gc_100 - ns/op 151477 ns/op 143218 ns/op 1.06
BenchmarkDocument/array_gc_100 - B/op 132486 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 1404241 ns/op 1362603 ns/op 1.03
BenchmarkDocument/array_gc_1000 - B/op 1158800 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 208605 ns/op 192998 ns/op 1.08
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 2180998 ns/op 2121356 ns/op 1.03
BenchmarkDocument/counter_10000 - B/op 2087768 B/op 2087765 B/op 1.00
BenchmarkDocument/counter_10000 - allocs/op 59772 allocs/op 59772 allocs/op 1
BenchmarkDocument/object_1000 - ns/op 1372586 ns/op 1323428 ns/op 1.04
BenchmarkDocument/object_1000 - B/op 1427837 B/op 1427932 B/op 1.00
BenchmarkDocument/object_1000 - allocs/op 9844 allocs/op 9844 allocs/op 1
BenchmarkDocument/object_10000 - ns/op 14722210 ns/op 14952592 ns/op 0.98
BenchmarkDocument/object_10000 - B/op 12168024 B/op 12166471 B/op 1.00
BenchmarkDocument/object_10000 - allocs/op 100564 allocs/op 100558 allocs/op 1.00
BenchmarkDocument/tree_100 - ns/op 1060730 ns/op 998783 ns/op 1.06
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 77105922 ns/op 74036459 ns/op 1.04
BenchmarkDocument/tree_1000 - B/op 86459768 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 9563661790 ns/op 9238843028 ns/op 1.04
BenchmarkDocument/tree_10000 - B/op 8580992952 B/op 8580993112 B/op 1.00
BenchmarkDocument/tree_10000 - allocs/op 600252 allocs/op 600251 allocs/op 1.00
BenchmarkDocument/tree_delete_all_1000 - ns/op 76461998 ns/op 71588951 ns/op 1.07
BenchmarkDocument/tree_delete_all_1000 - B/op 86990845 B/op 86990417 B/op 1.00
BenchmarkDocument/tree_delete_all_1000 - allocs/op 67751 allocs/op 67750 allocs/op 1.00
BenchmarkDocument/tree_edit_gc_100 - ns/op 3763872 ns/op 3588143 ns/op 1.05
BenchmarkDocument/tree_edit_gc_100 - B/op 4121005 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 311693286 ns/op 292095970 ns/op 1.07
BenchmarkDocument/tree_edit_gc_1000 - B/op 383465548 B/op 383466214 B/op 1.00
BenchmarkDocument/tree_edit_gc_1000 - allocs/op 145406 allocs/op 145408 allocs/op 1.00
BenchmarkDocument/tree_split_gc_100 - ns/op 2532606 ns/op 2419488 ns/op 1.05
BenchmarkDocument/tree_split_gc_100 - B/op 2386865 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 188908079 ns/op 175905530 ns/op 1.07
BenchmarkDocument/tree_split_gc_1000 - B/op 221992006 B/op 221990052 B/op 1.00
BenchmarkDocument/tree_split_gc_1000 - allocs/op 112261 allocs/op 112245 allocs/op 1.00
BenchmarkRPC/client_to_server - ns/op 355195892 ns/op 345650310 ns/op 1.03
BenchmarkRPC/client_to_server - B/op 17508397 B/op 16395133 B/op 1.07
BenchmarkRPC/client_to_server - allocs/op 166873 allocs/op 166812 allocs/op 1.00
BenchmarkRPC/client_to_client_via_server - ns/op 604340796 ns/op 599230474 ns/op 1.01
BenchmarkRPC/client_to_client_via_server - B/op 35011136 B/op 31200524 B/op 1.12
BenchmarkRPC/client_to_client_via_server - allocs/op 312074 allocs/op 312356 allocs/op 1.00
BenchmarkRPC/attach_large_document - ns/op 1372092119 ns/op 1320790007 ns/op 1.04
BenchmarkRPC/attach_large_document - B/op 1890027928 B/op 1889214992 B/op 1.00
BenchmarkRPC/attach_large_document - allocs/op 7570 allocs/op 7549 allocs/op 1.00
BenchmarkRPC/adminCli_to_server - ns/op 534424826 ns/op 524792658 ns/op 1.02
BenchmarkRPC/adminCli_to_server - B/op 36782728 B/op 35979672 B/op 1.02
BenchmarkRPC/adminCli_to_server - allocs/op 289667 allocs/op 289662 allocs/op 1.00
BenchmarkLocker - ns/op 66.86 ns/op 64.08 ns/op 1.04
BenchmarkLocker - B/op 16 B/op 16 B/op 1
BenchmarkLocker - allocs/op 1 allocs/op 1 allocs/op 1
BenchmarkLockerParallel - ns/op 38.69 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 144 ns/op 138.8 ns/op 1.04
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 3787943 ns/op 3738509 ns/op 1.01
BenchmarkChange/Push_10_Changes - B/op 126247 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 14064169 ns/op 13951923 ns/op 1.01
BenchmarkChange/Push_100_Changes - B/op 655979 B/op 646730 B/op 1.01
BenchmarkChange/Push_100_Changes - allocs/op 6539 allocs/op 6540 allocs/op 1.00
BenchmarkChange/Push_1000_Changes - ns/op 113208392 ns/op 111633212 ns/op 1.01
BenchmarkChange/Push_1000_Changes - B/op 6085603 B/op 6052291 B/op 1.01
BenchmarkChange/Push_1000_Changes - allocs/op 62159 allocs/op 62156 allocs/op 1.00
BenchmarkChange/Pull_10_Changes - ns/op 2860189 ns/op 2807725 ns/op 1.02
BenchmarkChange/Pull_10_Changes - B/op 100709 B/op 101299 B/op 0.99
BenchmarkChange/Pull_10_Changes - allocs/op 952 allocs/op 951 allocs/op 1.00
BenchmarkChange/Pull_100_Changes - ns/op 4306482 ns/op 4259998 ns/op 1.01
BenchmarkChange/Pull_100_Changes - B/op 258017 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 8358381 ns/op 8186496 ns/op 1.02
BenchmarkChange/Pull_1000_Changes - B/op 1393690 B/op 1399630 B/op 1.00
BenchmarkChange/Pull_1000_Changes - allocs/op 26870 allocs/op 26877 allocs/op 1.00
BenchmarkSnapshot/Push_3KB_snapshot - ns/op 16888275 ns/op 16788712 ns/op 1.01
BenchmarkSnapshot/Push_3KB_snapshot - B/op 796774 B/op 814611 B/op 0.98
BenchmarkSnapshot/Push_3KB_snapshot - allocs/op 6541 allocs/op 6542 allocs/op 1.00
BenchmarkSnapshot/Push_30KB_snapshot - ns/op 120606426 ns/op 116153491 ns/op 1.04
BenchmarkSnapshot/Push_30KB_snapshot - B/op 6260720 B/op 6295727 B/op 0.99
BenchmarkSnapshot/Push_30KB_snapshot - allocs/op 62158 allocs/op 62346 allocs/op 1.00
BenchmarkSnapshot/Pull_3KB_snapshot - ns/op 6606507 ns/op 6588486 ns/op 1.00
BenchmarkSnapshot/Pull_3KB_snapshot - B/op 904743 B/op 908101 B/op 1.00
BenchmarkSnapshot/Pull_3KB_snapshot - allocs/op 14877 allocs/op 14882 allocs/op 1.00
BenchmarkSnapshot/Pull_30KB_snapshot - ns/op 15225701 ns/op 14361476 ns/op 1.06
BenchmarkSnapshot/Pull_30KB_snapshot - B/op 6981760 B/op 6995643 B/op 1.00
BenchmarkSnapshot/Pull_30KB_snapshot - allocs/op 144137 allocs/op 144141 allocs/op 1.00
BenchmarkSync/memory_sync_10_test - ns/op 6968 ns/op 6687 ns/op 1.04
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 52095 ns/op 52081 ns/op 1.00
BenchmarkSync/memory_sync_100_test - B/op 8645 B/op 8642 B/op 1.00
BenchmarkSync/memory_sync_100_test - allocs/op 273 allocs/op 273 allocs/op 1
BenchmarkSync/memory_sync_1000_test - ns/op 592853 ns/op 587862 ns/op 1.01
BenchmarkSync/memory_sync_1000_test - B/op 74479 B/op 74357 B/op 1.00
BenchmarkSync/memory_sync_1000_test - allocs/op 2118 allocs/op 2110 allocs/op 1.00
BenchmarkSync/memory_sync_10000_test - ns/op 7226373 ns/op 6961544 ns/op 1.04
BenchmarkSync/memory_sync_10000_test - B/op 754724 B/op 764082 B/op 0.99
BenchmarkSync/memory_sync_10000_test - allocs/op 20534 allocs/op 20603 allocs/op 1.00
BenchmarkTextEditing - ns/op 19030115012 ns/op 18032931695 ns/op 1.06
BenchmarkTextEditing - B/op 9041828144 B/op 9038055344 B/op 1.00
BenchmarkTextEditing - allocs/op 19921844 allocs/op 19923783 allocs/op 1.00

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

Please sign in to comment.