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

[ChaosCenter]: Add unit tests to k8s and cluster package in GraphQL server #3971

Merged
merged 7 commits into from
May 22, 2023

Conversation

namkyu1999
Copy link
Member

@namkyu1999 namkyu1999 commented May 12, 2023

Proposed changes

Add unit tests to k8s and cluster package.

I'm using client-go fake package so that we don't have to connect actual Kubernetes while unit testing.

Overall code coverage is like below

cd litmus-portal/graphql-server
go test -cover ./...
  • cluster package : 85.6%
  • k8s package : 83.1%
    스크린샷 2023-05-12 오후 12 00 01

Types of changes

What types of changes does your code introduce to Litmus? Put an x in the boxes that apply

  • New feature (non-breaking change which adds functionality)
  • Bugfix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices applies)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I have read the CONTRIBUTING doc
  • I have signed the commit for DCO to be passed.
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have added necessary documentation (if appropriate)

Dependency

Issue No. #3892

Special notes for your reviewer: @S-ayanide @amityt

@S-ayanide S-ayanide assigned S-ayanide and namkyu1999 and unassigned S-ayanide May 12, 2023
@S-ayanide S-ayanide added the LFX-MENTORSHIP Linux Foundation Mentor ship Issue label May 12, 2023
Signed-off-by: namkyu1999 <[email protected]>
Signed-off-by: namkyu1999 <[email protected]>
Copy link
Member

@S-ayanide S-ayanide left a comment

Choose a reason for hiding this comment

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

LGTM

Signed-off-by: namkyu1999 <[email protected]>
@namkyu1999 namkyu1999 requested a review from amityt May 19, 2023 11:14
@imrajdas imrajdas merged commit 2fd4614 into litmuschaos:master May 22, 2023
SohamRatnaparkhi pushed a commit to SohamRatnaparkhi/litmus that referenced this pull request Jun 30, 2023
…erver (litmuschaos#3971)

* feat: add unit tests to k8s package

Signed-off-by: namkyu1999 <[email protected]>

* feat: add unit tests to cluster package

Signed-off-by: namkyu1999 <[email protected]>

* fix: fix codacy analysis

Signed-off-by: namkyu1999 <[email protected]>

* fix: fix test cases

Signed-off-by: namkyu1999 <[email protected]>

* fix: chore

Signed-off-by: namkyu1999 <[email protected]>

* fix: rename function

Signed-off-by: namkyu1999 <[email protected]>

---------

Signed-off-by: namkyu1999 <[email protected]>
Signed-off-by: SohamRatnaparkhi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/unit-test LFX-MENTORSHIP Linux Foundation Mentor ship Issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants