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 rest_handlers and authorization package in GraphQL server #3980

Merged

Conversation

namkyu1999
Copy link
Member

@namkyu1999 namkyu1999 commented May 19, 2023

Proposed changes

Add unit tests to rest_handlers and authorization package

  • rest_handlers package : 90.3%
    rest_handlers
  • authorization package : 71.7%
    authorization

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

Special notes for your reviewer:

@namkyu1999 namkyu1999 self-assigned this May 19, 2023
@namkyu1999 namkyu1999 added kind/unit-test LFX-MENTORSHIP Linux Foundation Mentor ship Issue go Pull requests that update Go code labels May 19, 2023
Copy link
Contributor

@amityt amityt left a comment

Choose a reason for hiding this comment

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

Minor comment. Rest LGTM

Comment on lines 21 to 26
if err != nil {
log.Error(err)
utils.WriteHeaders(&c.Writer, http.StatusBadRequest)
return
} else {
utils.WriteHeaders(&c.Writer, http.StatusOK)
c.Writer.Write(versionByte)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

In case of err condition we will need to return with the badRequest status code. Might need to add the return statement in err case

Signed-off-by: namkyu1999 <[email protected]>
@imrajdas imrajdas merged commit 27d372b into litmuschaos:master May 22, 2023
SohamRatnaparkhi pushed a commit to SohamRatnaparkhi/litmus that referenced this pull request Jun 30, 2023
…age in GraphQL server (litmuschaos#3980)

* feat: add unit tests to rest_handlers

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

* feat: add unit tests to authorization package

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

* fix: chore

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
go Pull requests that update Go code kind/unit-test LFX-MENTORSHIP Linux Foundation Mentor ship Issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants