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 chaos-workflow package in GraphQL server #3964

Conversation

namkyu1999
Copy link
Member

@namkyu1999 namkyu1999 commented May 2, 2023

Proposed changes

Add unit test code to chaos-workflow package.

The result code coverage of the entire backend server is 3.2%.
(I achieved 3.1% of code coverage at the chaosHub package before, So total coverage is 6.3%)
You can check the test coverage below.

# project root
cd ./litmus-portal/graphql-server
go test --coverpkg ./... -coverprofile cover.out ./... ; \
 echo -n "total: " ; \
 go tool cover -func=cover.out | tail -1 | awk '{print $NF}'

스크린샷 2023-05-03 오전 2 52 34

If you want to see the result of each code coverage with UI, you need to type shell scripts below

# project root
cd ./litmus-portal/graphql-server/pkg/chaos-workflow
go test -v -coverpkg=./... -coverprofile=coverage.out ./...

스크린샷 2023-05-03 오전 2 53 47

Issue No. #3892

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

#3946

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

@S-ayanide S-ayanide added the LFX-MENTORSHIP Linux Foundation Mentor ship Issue label May 3, 2023
Signed-off-by: namkyu1999 <[email protected]>
…d-unit-tests-to-chaos-workflow-package

Signed-off-by: namkyu1999 <[email protected]>
@imrajdas imrajdas merged commit cf86f7e into litmuschaos:master May 20, 2023
SohamRatnaparkhi pushed a commit to SohamRatnaparkhi/litmus that referenced this pull request Jun 30, 2023
…rver (litmuschaos#3964)

* feat: add unit tests to chaos-workflow package

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

* feat: add unit tests to chaosWorkflowService

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

* fix: change package name

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