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

[YUNIKORN-601] KubeClient mock does not allow failure tests #395

Closed
wants to merge 3 commits into from

Conversation

steinsgateted
Copy link
Contributor

What is this PR for?

change to NewKubeClientMock(showError bool) in order to show error.
chage to NewMockedAPIProvider(showError bool) in order to pass parameter to NewKubeClientMock(showError).
Then change each NewMockedAPIProvider() to NewMockedAPIProvider(false).

What type of PR is it?

  • - Bug Fix
  • - Improvement
  • - Feature
  • - Documentation
  • - Hot Fix
  • - Refactoring

Todos

  • - Task

What is the Jira issue?

https://issues.apache.org/jira/projects/YUNIKORN/issues/YUNIKORN-601

How should this be tested?

Screenshots (if appropriate)

Questions:

  • - The licenses files need update.
  • - There is breaking changes for older versions.
  • - It needs documentation.

@codecov
Copy link

codecov bot commented Mar 23, 2022

Codecov Report

Merging #395 (c179ced) into master (9aca5ce) will increase coverage by 0.06%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master     #395      +/-   ##
==========================================
+ Coverage   65.41%   65.47%   +0.06%     
==========================================
  Files          40       40              
  Lines        6314     6325      +11     
==========================================
+ Hits         4130     4141      +11     
  Misses       2023     2023              
  Partials      161      161              
Impacted Files Coverage Δ
pkg/cache/placeholder.go 100.00% <0.00%> (ø)
pkg/cache/context.go 45.60% <0.00%> (+0.07%) ⬆️
pkg/cache/application.go 72.21% <0.00%> (+0.46%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9aca5ce...c179ced. Read the comment docs.

Copy link
Contributor

@wilfred-s wilfred-s left a comment

Choose a reason for hiding this comment

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

LGTM

The change does not add new failure test, it just adds the possibility to create the client that can return a failure.
New tests should be added to also test failure cases.

@wilfred-s wilfred-s closed this in 8498188 Apr 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants