Skip to content

Conversation

@GautamBytes
Copy link
Contributor

This pull request introduces comprehensive unit tests for the configuration utility functions in pkg/util/configuration/configuration.go.

Changes:

  • Adds test cases for the GetTrafficRoutingIngressLuaScript and getRolloutConfiguration functions.
  • Uses the fake client from controller-runtime to mock Kubernetes API interactions, ensuring tests are isolated and reliable.
  • Covers the following scenarios:
    • Successful retrieval of configuration data and Lua scripts.
    • Graceful handling of non-existent ConfigMap.
    • Correct behavior when a specific key is not found in the ConfigMap.

@kruise-bot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign furykerry for approval by writing /assign @furykerry in a comment. For more information see:The Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kruise-bot kruise-bot requested review from FillZpp and veophi July 13, 2025 18:27
@GautamBytes
Copy link
Contributor Author

@hantmac please review it whenever feasible!

@GautamBytes GautamBytes force-pushed the add-configuration-unit-tests branch from c0d75d0 to d44d5c0 Compare August 13, 2025 18:01
@codecov
Copy link

codecov bot commented Aug 13, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 47.59%. Comparing base (00aae12) to head (d44d5c0).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #288      +/-   ##
==========================================
+ Coverage   47.52%   47.59%   +0.07%     
==========================================
  Files          63       64       +1     
  Lines        9799     9820      +21     
==========================================
+ Hits         4657     4674      +17     
- Misses       4585     4587       +2     
- Partials      557      559       +2     
Flag Coverage Δ
unittests 47.59% <ø> (+0.07%) ⬆️

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.

@GautamBytes
Copy link
Contributor Author

@furykerry can u rerun the workflow once , it will pass then I just updated branch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants