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(storage): fix emulated tests for metadata on read #11387

Merged
merged 3 commits into from
Jan 7, 2025

Conversation

cojenco
Copy link
Contributor

@cojenco cojenco commented Jan 7, 2025

No description provided.

@cojenco cojenco requested review from a team as code owners January 7, 2025 21:23
@product-auto-label product-auto-label bot added the api: storage Issues related to the Cloud Storage API. label Jan 7, 2025
@cojenco cojenco requested a review from BrennaEpp January 7, 2025 21:43
Comment on lines +854 to +857
for key, expectedValue := range expectedMetadata {
actualValue, ok := gotMetaData[key]
if !ok || actualValue != expectedValue {
t.Fatalf("Object Metadata: Expected key %q with value %q, but got %q", key, expectedValue, actualValue)
Copy link
Contributor

@BrennaEpp BrennaEpp Jan 7, 2025

Choose a reason for hiding this comment

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

I assume this fails if one of the expected keys is not in the metadata (!ok would return true?), but can you/did you double check?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tested against the testbench manually and good news it's running in kokoro now too. So this should fail if an expected key is not in gotMetadata or if there is a mismatch

Copy link
Contributor

Choose a reason for hiding this comment

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

Nice thanks

@BrennaEpp BrennaEpp enabled auto-merge (squash) January 7, 2025 23:21
@BrennaEpp BrennaEpp merged commit a6eeac7 into main Jan 7, 2025
9 checks passed
@BrennaEpp BrennaEpp deleted the storage-emulated-readwmeta branch January 7, 2025 23:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the Cloud Storage API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants