Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test non-empty StorageIDs #8698

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

itaigilo
Copy link
Contributor

Closes #8697.

Change Description

In order to provide better coverage:

  1. Changing some of the unit-tests to run with a non-empty StorageID.
  2. Replace empty StorageIDs with config.SingleBlockstoreID.

@itaigilo itaigilo added the exclude-changelog PR description should not be included in next release changelog label Feb 21, 2025
Copy link

E2E Test Results - DynamoDB Local - Local Block Adapter

14 passed

Copy link

E2E Test Results - Quickstart

11 passed

Copy link
Contributor

@nadavsteindler nadavsteindler left a comment

Choose a reason for hiding this comment

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

Looks good

Copy link
Contributor

@arielshaqed arielshaqed left a comment

Choose a reason for hiding this comment

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

THANKS! Much needed unit tests. But we might need more; these might be in a future PR, but then this PR has to say that and we need a more specific issue.

  • Not sure how this tests CreateRepository.
  • Don't we need to update other tests? E.g. graveler_v2_test.go appears to pass empty storage IDs; there may be others.

Blocking on these 3 issues (including the one on catalog_test.go). Entirely possible I misunderstood, and will happily unblock.

@@ -35,16 +36,16 @@ func TestManager_WriteRange(t *testing.T) {
}{
{
name: "iterator_exhausted",
initStorageID: "",
writeStorageID: "",
initStorageID: config.SingleBlockstoreID,
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't understand what we did in this test, but also what we did in the other test files. I would have expected to have twice as many test cases: once for "" aka SIngleBlockstoreID, one for "sid1". (This could have happened with nested test.Run()s, of course.) But instead some test cases switch to testing "", others to "sid1". And I don't understand why.

Obviously I don't understand this for all changes in this file, not only for this one.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As far as I can understand, we're trying to make sure StorageID flows properly from start to finish. By starting with either "" or "sid*" on one side, and making sure we're getting the same result in the other end, we have some confidence it's being passed properly, no?

@@ -37,3 +39,9 @@ func InitGravelerTest(t *testing.T) *GravelerTest {

return test
}

// ShortenBranchUpdateBackOff upgrade graveler branch update back-off to shorten test duration
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Found out the graveler tests were way too slow -
Ended up adding this function to this PR.
Probably belongs to a separate one, but I think we can handle this.

(Anyway, this cuts running time from 90 seconds to only 8.)

@itaigilo
Copy link
Contributor Author

  • CreateRepository

Thanks @arielshaqed fro your review!

  1. graveler.CreateRepository - Is this tested anywhere? If so, I couldn't find any reference for it...
  2. v2 - Right! I've missed that. Added non-empty StorageIDs there. Not sure it's enough, but the price of adding a new repo to these tests might be high (in terms of dev time, I guess).

@itaigilo itaigilo requested a review from arielshaqed February 24, 2025 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exclude-changelog PR description should not be included in next release changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handle non-empty StorageID in unit-tests
3 participants