Skip to content

Conversation

@agrawroh
Copy link
Member

Description

This PR adds some more tests to improve the overall coverage of H2.


Commit Message: coverage: add some more tests to improve http2 code coverage
Additional Description: Additional tests for improving the overall coverage of H2
Risk Level: N/A
Testing: Adding Unit Tests
Docs Changes: N/A
Release Notes: N/A

Signed-off-by: Rohit Agrawal <rohit.agrawal@databricks.com>
@repokitteh-read-only
Copy link

Coverage for this Pull Request will be rendered here:

https://storage.googleapis.com/envoy-pr/39149/coverage/index.html

The coverage results are (re-)rendered each time the CI envoy-presubmit (check linux_x64 coverage) job completes.

🐱

Caused by: #39149 was opened by agrawroh.

see: more, trace.

@repokitteh-read-only
Copy link

As a reminder, PRs marked as draft will not be automatically assigned reviewers,
or be handled by maintainer-oncall triage.

Please mark your PR as ready when you want it to be reviewed!

🐱

Caused by: #39149 was opened by agrawroh.

see: more, trace.

@agrawroh
Copy link
Member Author

/retest

@agrawroh agrawroh marked this pull request as ready for review April 17, 2025 18:18
#pragma once

#include <cstdint>
#include <deque>
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you move this to frame_replay.h (in the other PR if splitting as suggested)? It's not used in this file.

Copy link
Contributor

Choose a reason for hiding this comment

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

The changes in BUILD, frame_replay.h and frame_replay_test.h don't seem to be connected at all to the changes in http2_frame.h and http2_frame_test.h (other than the one misplaced #include). Could you split this into two PRs, and/or make FrameReplay in a PR that uses it? Seems like in this PR it just appears and tests itself but has no use-case.

Comment on lines +418 to +420
ASSERT_EQ(replay.frameCount(), 2);
ASSERT_EQ(replay.nextFrame().type(), Http2Frame::Type::Ping);
ASSERT_EQ(replay.nextFrame().type(), Http2Frame::Type::Ping);
Copy link
Contributor

Choose a reason for hiding this comment

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

Most of the ASSERTs in this PR should be EXPECTs. The exception being the frameCount ones, which should abort the test if not met because an underflow there would lead to a test-crash.

Ideally you'd use matchers for this sort of thing - i.e. instead of

ASSERT(count);
EXPECT(element_0, properties);
EXPECT(element_1, properties);

if you use some custom matchers and write the same thing something like

EXPECT_THAT(replay.allFrames(), HasElements(
   FrameTypeIs(Http2Frame::Type::Ping),
   FrameTypeIs(Http2Frame::Type::Ping),
));

then the output on failure is much more helpful - an ASSERT failure on the count would tell you it's the wrong number and then abort the test, so all you'd get is "expected 2 but got 3", while ElementsAre will validate the count, the contents, and the order, and will explain the expectations and content (and maybe the difference depending on how you implement the matcher).

@ravenblackx ravenblackx self-assigned this Apr 21, 2025
@github-actions
Copy link

This pull request has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!

@github-actions github-actions bot added the stale stalebot believes this issue/PR has not been touched recently label May 22, 2025
@github-actions
Copy link

This pull request has been automatically closed because it has not had activity in the last 37 days. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!

@github-actions github-actions bot closed this May 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale stalebot believes this issue/PR has not been touched recently waiting

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants