test: Generate correct IDs for tests #106

Merged
fyrchik merged 1 commit from a-savchuk/frostfs-api-go:test/generate-ids into master 2024-08-30 10:55:06 +00:00
Member

Some tests are using invalid IDs, such as this one, which isn't 32 bytes long as required by the FrostFS protocol. While this may not be the direct responsibility of the API repository, I believe we should avoid using test IDs that don't reflect real-world scenarios.

This issue was originally highlighted here.

Signed-off-by: Aleksey Savchuk a.savchuk@yadro.com

Some tests are using invalid IDs, such as this [one](https://git.frostfs.info/TrueCloudLab/frostfs-api-go/src/commit/5e1c6a908f61d357acd71c1b0a1320f962ea5827/refs/test/generate.go#L41-L49), which isn't 32 bytes long as required by the FrostFS protocol. While this may not be the direct responsibility of the API repository, I believe we should avoid using test IDs that don't reflect real-world scenarios. This issue was originally highlighted [here](https://github.com/nspcc-dev/neofs-api-go/issues/394). Signed-off-by: Aleksey Savchuk <a.savchuk@yadro.com>
a-savchuk added 1 commit 2024-08-26 11:16:04 +00:00
[#xx] test: Generate correct IDs for tests
Some checks failed
DCO action / DCO (pull_request) Failing after 1m8s
Tests and linters / Tests (1.23) (pull_request) Successful in 1m15s
Tests and linters / Tests (1.22) (pull_request) Successful in 1m18s
Tests and linters / Tests with -race (pull_request) Successful in 1m58s
Tests and linters / Lint (pull_request) Successful in 3m24s
f9ad60d418
Signed-off-by: Aleksey Savchuk <a.savchuk@yadro.com>
a-savchuk force-pushed test/generate-ids from f9ad60d418 to 3f35301340 2024-08-26 11:16:39 +00:00 Compare
a-savchuk requested review from storage-core-committers 2024-08-26 11:20:46 +00:00
a-savchuk requested review from storage-core-developers 2024-08-26 11:20:46 +00:00
Owner

Signature could also be changed -- see how we marshal the key and signature (33 and 64 bytes)
Also, the scheme could be constant (exactly not to deal with non-constant lengths)

`Signature` could also be changed -- see how we marshal the key and signature (33 and 64 bytes) Also, the scheme could be constant (exactly not to deal with non-constant lengths)
dstepanov-yadro approved these changes 2024-08-26 11:58:15 +00:00
aarifullin approved these changes 2024-08-26 12:13:12 +00:00
fyrchik added the
internal
label 2024-08-27 08:15:00 +00:00
a-savchuk force-pushed test/generate-ids from 3f35301340 to 7fd808b317 2024-08-30 08:08:10 +00:00 Compare
Author
Member

Signature could also be changed -- see how we marshal the key and signature (33 and 64 bytes)
Also, the scheme could be constant (exactly not to deal with non-constant lengths)

Tbh, I couldn't find an information about key and signature sizes there but found it in frostfs-crypto repository.

I've also updated the test data generation in some other places.

> `Signature` could also be changed -- see how we marshal the key and signature (33 and 64 bytes) > Also, the scheme could be constant (exactly not to deal with non-constant lengths) Tbh, I couldn't find an information about key and signature sizes there but found it in [`frostfs-crypto`](https://git.frostfs.info/TrueCloudLab/frostfs-crypto/src/commit/0630205f673c207282151ca9aae659f929130176/ecdsa.go#L30-L36) repository. I've also updated the test data generation in some other places.
a-savchuk requested review from storage-core-developers 2024-08-30 08:19:45 +00:00
a-savchuk requested review from storage-core-committers 2024-08-30 08:19:45 +00:00
a-savchuk force-pushed test/generate-ids from 7fd808b317 to 5e7a15f3f1 2024-08-30 08:23:37 +00:00 Compare
Member

Could you please elaborate in the commit message what was wrong with IDs in tests before?

Could you please elaborate in the commit message what was wrong with `ID`s in tests before?
fyrchik requested changes 2024-08-30 08:46:38 +00:00
@ -4,6 +4,8 @@ import (
"math/rand"
"time"
crand "crypto/rand"
Owner

Please make no empty lines between stdlib imports

Please make no empty lines between stdlib imports
Author
Member

Fixed

Fixed
a-savchuk force-pushed test/generate-ids from 5e7a15f3f1 to 6052aecd0f 2024-08-30 09:21:31 +00:00 Compare
a-savchuk force-pushed test/generate-ids from 6052aecd0f to 9c5e32a183 2024-08-30 10:37:47 +00:00 Compare
fyrchik approved these changes 2024-08-30 10:38:08 +00:00
elebedeva approved these changes 2024-08-30 10:41:59 +00:00
fyrchik merged commit 9c5e32a183 into master 2024-08-30 10:55:06 +00:00
a-savchuk deleted branch test/generate-ids 2024-08-30 12:22:25 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
5 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/frostfs-api-go#106
No description provided.