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

test: add some tests #118

Closed
wants to merge 4 commits into from
Closed

test: add some tests #118

wants to merge 4 commits into from

Conversation

wu8685
Copy link
Collaborator

@wu8685 wu8685 commented Nov 13, 2023

1. Does this PR affect any open issues?(Y/N) and add issue references (e.g. "fix #123", "re #123".):

  • N
  • Y

2. What is the scope of this PR (e.g. component or file name):

3. Provide a description of the PR(e.g. more details, effects, motivations or doc link):

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Other

4. Are there any breaking changes?(Y/N) and describe the breaking changes(e.g. more details, motivations or doc link):

  • N
  • Y

5. Are there test cases for these changes?(Y/N) select and add more details, references or doc links:

  • Unit test
  • Integration test
  • Benchmark (add benchmark stats below)
  • Manual test (add detailed scripts or steps below)
  • Other

6. Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

None

Copy link

codecov bot commented Nov 13, 2023

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (f01c67d) 47.02% compared to head (2b0e173) 60.70%.

Files Patch % Lines
pkg/controllers/collaset/collaset_controller.go 50.00% 0 Missing and 1 partial ⚠️
...lers/podopslifecycle/podopslifecycle_controller.go 50.00% 1 Missing ⚠️
...rver/generic/collaset/collaset_mutating_handler.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main     #118       +/-   ##
===========================================
+ Coverage   47.02%   60.70%   +13.68%     
===========================================
  Files          45       46        +1     
  Lines        3492     3423       -69     
===========================================
+ Hits         1642     2078      +436     
+ Misses       1636     1126      -510     
- Partials      214      219        +5     
Flag Coverage Δ
unittests 60.70% <81.25%> (+13.68%) ⬆️

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.

@wu8685 wu8685 force-pushed the add-ut branch 3 times, most recently from ded4809 to 0faadb8 Compare November 15, 2023 09:21
g.Expect(exp.IsSatisfied(pod)).Should(gomega.BeFalse())
g.Expect(exp.DeleteItem(pod, Pod, podA.Name)).Should(gomega.BeNil())
g.Expect(exp.IsSatisfied(pod)).Should(gomega.BeTrue())
// delete no existing item should not get error
Copy link
Collaborator

@shaofan-hs shaofan-hs Nov 17, 2023

Choose a reason for hiding this comment

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

deleting a non-existent item should not return an error

@wu8685 wu8685 closed this Nov 19, 2023
@wu8685 wu8685 deleted the add-ut branch November 19, 2023 14:21
@github-actions github-actions bot locked and limited conversation to collaborators Nov 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants