Skip to content

test: add ut#893

Merged
l1b0k merged 2 commits intoAliyunContainerService:mainfrom
l1b0k:feat/ut_
Sep 9, 2025
Merged

test: add ut#893
l1b0k merged 2 commits intoAliyunContainerService:mainfrom
l1b0k:feat/ut_

Conversation

@l1b0k
Copy link
Collaborator

@l1b0k l1b0k commented Sep 9, 2025

No description provided.

- Implement unit tests for the runCalico function in policy_test.go
- Use gomonkey to mock exec.LookPath and syscall.Exec for testing
- Verify error handling for missing calico-felix and execution failures
- Test setting of environment variables for calico-felix

Signed-off-by: l1b0k <libokang.lbk@alibaba-inc.com>
…it tests for runCilium function in policy_test.go

- Test various scenarios including successful execution, error cases, and argument/environment verification
- Use gomonkey for mocking os.ReadFile, exec.LookPath, and syscall.Exec
- Validate correct arguments and environment variables are set for cilium-agent

Signed-off-by: l1b0k <libokang.lbk@alibaba-inc.com>
@codecov
Copy link

codecov bot commented Sep 9, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 54.09%. Comparing base (c146cfb) to head (6aedfd5).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #893      +/-   ##
==========================================
+ Coverage   53.48%   54.09%   +0.60%     
==========================================
  Files         132      132              
  Lines       19523    19523              
==========================================
+ Hits        10441    10560     +119     
+ Misses       8024     7905     -119     
  Partials     1058     1058              
Flag Coverage Δ
unittests 54.09% <ø> (+0.60%) ⬆️

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 7182327 into AliyunContainerService:main Sep 9, 2025
9 checks passed
@l1b0k l1b0k deleted the feat/ut_ branch September 9, 2025 12:12
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