Skip to content

test: add ut#900

Merged
l1b0k merged 3 commits intoAliyunContainerService:mainfrom
l1b0k:main
Sep 15, 2025
Merged

test: add ut#900
l1b0k merged 3 commits intoAliyunContainerService:mainfrom
l1b0k:main

Conversation

@l1b0k
Copy link
Collaborator

@l1b0k l1b0k commented Sep 15, 2025

No description provided.

- Implement comprehensive unit tests for the AllocIP function in the daemon package
- Cover various scenarios including successful allocation, errors, and edge cases
- Use mocking to isolate dependencies and focus on function logic
- Improve test coverage and ensure function reliability

Signed-off-by: l1b0k <libokang.lbk@alibaba-inc.com>
- Implement comprehensive unit tests for the ReleaseIP function- Cover various scenarios including successful releases, pod not found, errors in resource retrieval and deletion
- Test both ENIMultiIP and VPCENI pod network types
- Validate behavior for different IP stick times and IPAM types

Signed-off-by: l1b0k <libokang.lbk@alibaba-inc.com>
- Implement comprehensive tests for GetIPInfo function in server_test.go
- Cover various scenarios including successful cases, errors, and edge cases
- Use mocking to simulate different conditions and dependencies
- Add tests for both ENIMultiIP and VPCENI pod network types
- Include error cases such as pod not found, resource retrieval failure, and unknown network types
- Test container ID mismatch and invalid JSON netconf handling

Signed-off-by: l1b0k <libokang.lbk@alibaba-inc.com>
@l1b0k l1b0k requested a review from BSWANG September 15, 2025 09:31
@codecov
Copy link

codecov bot commented Sep 15, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 58.53%. Comparing base (00cbbe7) to head (204b60d).
⚠️ Report is 10 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #900      +/-   ##
==========================================
+ Coverage   55.81%   58.53%   +2.72%     
==========================================
  Files         131      131              
  Lines       19517    19517              
==========================================
+ Hits        10893    11425     +532     
+ Misses       7537     6960     -577     
- Partials     1087     1132      +45     
Flag Coverage Δ
unittests 58.53% <ø> (+2.72%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@l1b0k l1b0k merged commit eec62bf into AliyunContainerService:main Sep 15, 2025
9 checks passed
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.

1 participant