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

Chore: add CoreOptions flags test #6007

Merged
merged 1 commit into from
May 18, 2023
Merged

Conversation

yyzxw
Copy link
Contributor

@yyzxw yyzxw commented May 18, 2023

Description of your changes

πŸ€– Generated by Copilot at 5e8b737

Summary

πŸ§ͺπŸš©πŸŽ›οΈ

Add unit test for CoreOptions struct in cmd/core/app/options/options_test.go. The test verifies that the struct can parse and store the core controller flags correctly. The test is part of a refactoring effort to improve the core controller configuration.

CoreOptions test
Parsing and storing flags well
Autumn of refactor

Walkthrough

  • Add a new test file for the CoreOptions struct and its Flags method (link). The test file options_test.go verifies that the CoreOptions struct can parse and store the command-line flags for the core controller, such as metrics-addr, enable-leader-election, and webhook-cert-dir. The test file is located in the same package as the CoreOptions struct and follows the naming convention of options_test.go. The test file also includes the license header and the necessary imports for the test.

add unit test for CoreOptions.Flags().

Fixes #

I have:

  • Read and followed KubeVela's contribution process.
  • Related Docs updated properly. In a new feature or configuration option, an update to the documentation is necessary.
  • Run make reviewable to ensure this PR is ready for review.
  • Added backport release-x.y labels to auto-backport this PR if necessary.

How has this code been tested

Special notes for your reviewer

@yyzxw yyzxw changed the title chore: add flags test Chore: add coreOptions flags test May 18, 2023
@yyzxw yyzxw changed the title Chore: add coreOptions flags test Chore: add CoreOptions flags test May 18, 2023
Signed-off-by: yyzxw <1020938856@qq.com>
Signed-off-by: xiaowu.zhu <xiaowu.zhu@daocloud.io>
@codecov
Copy link

codecov bot commented May 18, 2023

Codecov Report

Patch coverage has no change and project coverage change: +0.02 πŸŽ‰

Comparison is base (1b9bdff) 60.96% compared to head (767e269) 60.99%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6007      +/-   ##
==========================================
+ Coverage   60.96%   60.99%   +0.02%     
==========================================
  Files         225      225              
  Lines       31345    31345              
==========================================
+ Hits        19111    19119       +8     
+ Misses      10469    10456      -13     
- Partials     1765     1770       +5     
Flag Coverage Ξ”
core-unittests 56.00% <ΓΈ> (+0.01%) ⬆️
e2e-multicluster-test 25.05% <ΓΈ> (+0.01%) ⬆️
e2etests 25.30% <ΓΈ> (+0.03%) ⬆️

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

see 9 files with indirect coverage changes

β˜” View full report in Codecov by Sentry.
πŸ“’ Do you have feedback about the report comment? Let us know in this issue.

@yyzxw
Copy link
Contributor Author

yyzxw commented May 18, 2023

/retest

@Somefive Somefive merged commit 933d85c into kubevela:master May 18, 2023
22 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.

None yet

2 participants