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 unit test #5985

Merged
merged 1 commit into from
May 15, 2023
Merged

Chore: add unit test #5985

merged 1 commit into from
May 15, 2023

Conversation

yyzxw
Copy link
Contributor

@yyzxw yyzxw commented May 14, 2023

Description of your changes

Hi, I am very honored to participate in Kubevela. This is my first contribution. This PR has added some unit tests.

πŸ€– Generated by Copilot at 889a6e9

Summary

πŸ§ͺπŸ› οΈπŸ“

This pull request fixes some compile errors and adds new test functions for various utility packages. It improves the test coverage and quality of the pkg/utils/schema, pkg/utils/system, pkg/utils/url, pkg/utils/file, and pkg/utils/strings packages. It also tests the validation of UI schemas for the pkg/utils/schema package.

Some changes were made to the code
To test some functions and modes
They imported fmt and assert
And checked some files and some words
And fixed some errors that showed

Walkthrough

  • Add new test functions to improve test coverage and quality of the utils package (link, link, link)
  • Test the IsJSONYAMLorCUEFile function, which checks file extensions (link)
  • Test the StringsContain function, which checks string slices (link)
  • Test the IsValidURL function, which checks URL validity (link)
  • Add new test functions to improve test coverage and quality of the schema package (link)
    • Test the Validate method of the UISchema type, which validates UI schema conditions and actions (link)
  • Add new test functions to improve test coverage and quality of the system package (link)
    • Test the GetVelaHomeDir function, which returns the vela home directory (link)
  • Add missing import statements to fix compile errors and enable testing of the utils, schema, and system packages (link, link, link)

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 test: add ut Chore: add unit test May 14, 2023
@codecov
Copy link

codecov bot commented May 14, 2023

Codecov Report

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

Comparison is base (d19bb89) 60.58% compared to head (30d366a) 60.68%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5985      +/-   ##
==========================================
+ Coverage   60.58%   60.68%   +0.10%     
==========================================
  Files         224      224              
  Lines       31202    31202              
==========================================
+ Hits        18903    18935      +32     
+ Misses      10525    10492      -33     
- Partials     1774     1775       +1     
Flag Coverage Ξ”
core-unittests 56.00% <ΓΈ> (+0.13%) ⬆️
e2e-multicluster-test 24.71% <ΓΈ> (ΓΈ)
e2etests 25.09% <ΓΈ> (-0.01%) ⬇️

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

see 8 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.

Signed-off-by: yyzxw <1020938856@qq.com>
Copy link
Collaborator

@Somefive Somefive left a comment

Choose a reason for hiding this comment

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

LGTM

@Somefive Somefive merged commit f6a9d66 into kubevela:master May 15, 2023
24 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