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

Improve test coverage of v2, v3, and v4 container stats endpoints #3758

Merged
merged 1 commit into from
Jun 23, 2023

Conversation

amogh09
Copy link
Contributor

@amogh09 amogh09 commented Jun 21, 2023

Summary

Improve test coverage for v2, v3, and v4 container stats endpoints.

This change is in a series of test coverage improvements we are making for TMDS endpoints. Test coverage is being improved to gain more confidence in the ongoing TMDS refactoring work.

Some previous PRs in this series are #3729, #3722, and #3708. All happy and error cases are consolidated into one test function per endpoint.

Implementation

  • Updated the generic TMDSTestCase type and testTMDSRequest function to support setting expectations on mock Stats Engine.
  • Extended the TMDSResponse interface to support container stats endpoints' response types.
  • Replaced existing TestV2ContainerStats, TestV3ContainerStats, and TestV4ContainerStats functions that only test happy cases with new functions that test all error and happy cases.

Testing

New tests cover the changes: NA

Description for the changelog

Improve test coverage of v2, v3, and v4 container stats endpoints

Licensing

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@amogh09 amogh09 marked this pull request as ready for review June 21, 2023 23:14
@amogh09 amogh09 requested a review from a team as a code owner June 21, 2023 23:14
Copy link
Contributor

@chienhanlin chienhanlin left a comment

Choose a reason for hiding this comment

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

So neat! & thanks for adding new tests!

@amogh09 amogh09 merged commit 921a583 into aws:dev Jun 23, 2023
xxx0624 pushed a commit to xxx0624/amazon-ecs-agent that referenced this pull request Jun 26, 2023
xxx0624 pushed a commit to xxx0624/amazon-ecs-agent that referenced this pull request Jun 27, 2023
@mye956 mye956 mentioned this pull request Jul 5, 2023
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.

4 participants