-
Notifications
You must be signed in to change notification settings - Fork 851
Convert HPACK regression test into unit test using Catch #5687
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
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any name suggestion?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not add it to test_HPACK?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test_HPACK looks a command line tool to generate data for measuring compression rate using hpack-test-case rather than unit tests.
I'm not sure merging these make sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use the output as an input for the tools provided from hpack-test-case, but it's not the main goal. We rarely measure compression rate, but test if encoder and decoder works. If you look into the code, you can find that it compares the encode output with pre-encoded data and the decode output with the original plain text headers as well. I'd say the output is just compatible with other tools.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, the measuring compression rate is NOT main purpose.
But I'm still not sure because
scope looks different
test_HPACK tests only high level functions like
hpack_encode_header_block/hpack_decode_header_block. OTOH, RegressionHPACK.cc tests more basic functions likeencode_integer/decode_integer.test_HPACK is enough complicated because it needs to handle arguments and hpack-test-case json.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How can we compare encoded output with pre-encoded data? IIUC, encoded output could be different for each implementations. (If not, compression rate is same across all implementations. )
What I could found is comparing encoded and decoded header with original header.
https://github.com/apache/trafficserver/blob/master/proxy/http2/test_HPACK.cc#L262
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see what your concern is. How can it be a reason to have another executable? Those all are still HPACK. Also, as you may know, I moved functions for primitive type representation to XPACK on quit-latest branch and proposing it on master as #5465. To be honest, making this change at this time doesn't make much sense to me because this will make conflicts and it will delay QUIC merge and 9.0.
There are many functions just for the current test cases but you don't have to read them when you add tests. How does it bother test writers? Things they have to do is the same (just add another TEST_CASE {}).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, for XPACK stuff, it looks like related tests should go to the
hdrs/unit_tests/test_XPACK.cc. Let's merge #5465 first.@bryancall @SolidWallOfCode would you review #5465 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@masaori335 I approved #5465