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

Add S3 encode tests #340

Merged
merged 5 commits into from
Dec 7, 2022
Merged

Add S3 encode tests #340

merged 5 commits into from
Dec 7, 2022

Conversation

KalmanMeth
Copy link
Collaborator

No description provided.

Comment on lines -125 to -127
if now.After(s.expiryTime) {
_ = s.writeObject()
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

IIUC, this is the only place where expiryTime is read. If it is removed from here, maybe the variable can be removed altogether.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is exactly for what the parameter is needed, to define the user's desired timeout period when to create a new object. So I don't think we can remove this.

Comment on lines 127 to 144
expectedSubstring := "account1"
require.True(t, strings.Contains(objectName0, expectedSubstring))
expectedSubstring = "year"
require.True(t, strings.Contains(objectName0, expectedSubstring))
expectedSubstring = "month="
require.True(t, strings.Contains(objectName0, expectedSubstring))
expectedSubstring = "day="
require.True(t, strings.Contains(objectName0, expectedSubstring))
expectedSubstring = "hour="
require.True(t, strings.Contains(objectName0, expectedSubstring))
expectedSubstring = "stream-id="
require.True(t, strings.Contains(objectName0, expectedSubstring))
expectedSubstring = "00000000"
require.True(t, strings.Contains(objectName0, expectedSubstring))
expectedSubstring = "00000001"
require.True(t, strings.Contains(fakeWriter.objectNames[1], expectedSubstring))
expectedSubstring = "00000002"
require.True(t, strings.Contains(fakeWriter.objectNames[2], expectedSubstring))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Using require.Contains() is preferred over require.True().
The advantage of require.Contains() is that when the condition is not met, the error message is more verbose.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

updated accordingly

@KalmanMeth KalmanMeth merged commit c092adc into netobserv:main Dec 7, 2022
@KalmanMeth KalmanMeth deleted the s3-encode-test branch January 29, 2023 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants