registry: Add tests for registry exporter #144

Merged
fyrchik merged 1 commit from elebedeva/xk6-frostfs:fix/registry-export-grpc-obj into master 2024-09-04 19:51:18 +00:00
Member

Signed-off-by: Ekaterina Lebedeva ekaterina.lebedeva@yadro.com

Signed-off-by: Ekaterina Lebedeva <ekaterina.lebedeva@yadro.com>
elebedeva force-pushed fix/registry-export-grpc-obj from 2d26a5c3b9 to 36ae1b6bdb 2024-06-10 16:35:06 +00:00 Compare
elebedeva requested review from storage-core-committers 2024-06-10 16:35:51 +00:00
elebedeva requested review from storage-core-developers 2024-06-10 16:37:11 +00:00
acid-ant reviewed 2024-06-11 06:58:39 +00:00
@ -0,0 +25,4 @@
require.NotEqual(t, "", mode, "test mode should be either \"s3\" or\"grpc\"")
dbName := "registry" + mode + ".db"
jsonName := "registry" + mode + ".json"
Member

How about to use temp dir for db and json?

dir := t.TempDir()
dbName := filepath.Join(dir, "registry-" + mode + ".db")
How about to use temp dir for db and json? ``` dir := t.TempDir() dbName := filepath.Join(dir, "registry-" + mode + ".db") ```
Author
Member

fixed

fixed
elebedeva changed title from Add tests for registry exporter to WIP: Add tests for registry exporter 2024-06-11 13:14:45 +00:00
elebedeva force-pushed fix/registry-export-grpc-obj from 36ae1b6bdb to c7425dcfc9 2024-06-11 14:23:34 +00:00 Compare
elebedeva changed title from WIP: Add tests for registry exporter to Add tests for registry exporter 2024-06-11 14:23:46 +00:00
fyrchik approved these changes 2024-06-11 14:33:44 +00:00
fyrchik approved these changes 2024-06-11 14:34:17 +00:00
fyrchik left a comment
Owner

Could you also add registry: prefix to both commits?

The commit message for 23e02c2448 is exquisite!

Could you also add `registry: ` prefix to both commits? The commit message for https://git.frostfs.info/TrueCloudLab/xk6-frostfs/commit/23e02c2448ccd16f7152552301f31c6d47c8f4e2 is exquisite!
elebedeva force-pushed fix/registry-export-grpc-obj from c7425dcfc9 to b2c94fb80a 2024-06-11 14:40:32 +00:00 Compare
achuprov approved these changes 2024-06-11 14:45:12 +00:00
@ -0,0 +91,4 @@
if div <= 0 {
return 0, fmt.Errorf("invalid divider %v", div)
}
for {
Member

Is this equivalent?

return 1 + rand.Intn(div - 1), nil

Is this equivalent? ` return 1 + rand.Intn(div - 1), nil `
Author
Member

Good point, thanks.

Also found a problem in runExportChangedTest(): if an original len(expected.objects) == 1 there is a panic. So made the length-by-default for every expected.objects[] to be not less than 2.

Good point, thanks. Also found a problem in `runExportChangedTest()`: if an original `len(expected.objects) == 1` there is a panic. So made the length-by-default for every `expected.objects[]` to be not less than `2`.
elebedeva force-pushed fix/registry-export-grpc-obj from b2c94fb80a to 58c6e8965e 2024-06-11 14:45:22 +00:00 Compare
elebedeva force-pushed fix/registry-export-grpc-obj from 58c6e8965e to f90a645594 2024-06-11 15:09:38 +00:00 Compare
elebedeva changed title from Add tests for registry exporter to registry: Add tests for registry exporter 2024-06-11 15:27:07 +00:00
fyrchik approved these changes 2024-06-12 08:08:29 +00:00
fyrchik merged commit f90a645594 into master 2024-06-12 08:08:42 +00:00
Sign in to join this conversation.
No description provided.