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

HDDS-5778. Client side unit tests #2810

Merged
merged 11 commits into from Dec 1, 2021

Conversation

GeorgeJahad
Copy link
Contributor

What changes were proposed in this pull request?

Adding a test for new ugi filter. This code was written entirely by Neil Joshi

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-5778

How was this patch tested?

cd hadoop-ozone/s3gateway
mvn -Dtest=TestUgiFilter test

Comment on lines 134 to 137
filter.init(filterConfig);
filter.doFilter(request, response, filterChain);
filter.destroy();
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you please help me understand what is being asserted here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@adoroszlai I reviewed with @neils-dev and confirmed that there was an assert missing which I've added. Thanks for noticing!

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks. Would it make sense to add one or more other test cases where the filter is expected to reject the request(s)? I guess the current test would pass even with a no-op filter.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

More tests added @adoroszlai Sorry it took so long.

Copy link
Contributor

@adoroszlai adoroszlai left a comment

Choose a reason for hiding this comment

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

Thanks @GeorgeJahad for updating the patch.

get(AUTHORIZATION_HEADER).replace("20210616", curDate));


// Should not generate exception because of corrected date
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: adding each test case in a separate method would be cleaner.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, @adoroszlai I split them up.

Copy link
Contributor

@adoroszlai adoroszlai left a comment

Choose a reason for hiding this comment

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

Thanks @GeorgeJahad for updating the patch. I think the test cases are much easier to read now. 👍

@GeorgeJahad
Copy link
Contributor Author

@adoroszlai since you've approved this pr and the ci tests succeeded, would you be able to merge this into the feature branch? or is there something else that should be done?

@adoroszlai adoroszlai merged commit c9442d2 into apache:HDDS-4440-s3-performance Dec 1, 2021
@adoroszlai
Copy link
Contributor

Thanks @GeorgeJahad and @neils-dev for the patch.

ci tests succeeded

Thanks for the reminder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants