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

feat: option to name test cases #903

Merged
merged 4 commits into from
Oct 6, 2023

Conversation

AkashKumar7902
Copy link
Member

@AkashKumar7902 AkashKumar7902 commented Sep 27, 2023

Related Issue

  • Info about Issue or bug

Closes: #880

Describe the changes you've made

Added the code to fetch the value from key: Keploy_Test_Name passed in the header of the request, and changed the value of tcsName with the value of our key since the variable is passed to the write .

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, local variables)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Please let us know if any test cases are added

Please describe the tests(if any). Provide instructions how its affecting the coverage.

Describe if there is any unusual behaviour of your code(Write NA if there isn't)

N/A

Checklist:

  • My code follows the style guidelines of this project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.

Screenshots (if any)

image

Original Updated
image image

Signed-off-by: Akash Kumar <meakash7902@gmail.com>
@charankamarapu
Copy link
Member

charankamarapu commented Sep 27, 2023

Give your best to resolve the code scanning errors and as this feature is new we must mention this in some section in readme.

Signed-off-by: Akash Kumar <meakash7902@gmail.com>
@AkashKumar7902
Copy link
Member Author

@charankamarapu Hey how do you run codeql workflow locally ?

@charankamarapu
Copy link
Member

you can run the github action https://github.com/keploy/keploy/blob/main/.github/workflows/codeql.yml locally . Use tools like act .

@nehagup
Copy link
Member

nehagup commented Sep 28, 2023

Give your best to resolve the code scanning errors and as this feature is new we must mention this in some section in readme.

@AkashKumar7902 you can add the documentation for this feature by making a PR to docs repo.

@AkashKumar7902
Copy link
Member Author

@nehagup sure will do that !

@charankamarapu
Copy link
Member

Hey @AkashKumar7902 can you comment on the issue of this PR so that I can assign the issue to you?

Signed-off-by: Akash Kumar <meakash7902@gmail.com>
pkg/platform/yaml/yaml.go Dismissed Show dismissed Hide dismissed
pkg/platform/yaml/yaml.go Dismissed Show dismissed Hide dismissed
pkg/platform/yaml/yaml.go Dismissed Show dismissed Hide dismissed
pkg/platform/yaml/yaml.go Dismissed Show dismissed Hide dismissed
if err != nil {
ys.Logger.Error("failed to open the created yaml file", zap.Error(err), zap.Any("yaml file name", fileName))
ys.Logger.Error("failed to open the created yaml file", zap.Error(err), zap.Any("yaml file name", fileName)) // lgtm [go/clear-text-logging]

Check failure

Code scanning / CodeQL

Clear-text logging of sensitive information High

Sensitive data returned by HTTP request headers
flows to a logging call.
return err
}
data = append(data, d...)

_, err = file.Write(data)
if err != nil {
ys.Logger.Error("failed to write the yaml document", zap.Error(err), zap.Any("yaml file name", fileName))
ys.Logger.Error("failed to write the yaml document", zap.Error(err), zap.Any("yaml file name", fileName)) // lgtm [go/clear-text-logging]

Check failure

Code scanning / CodeQL

Clear-text logging of sensitive information High

Sensitive data returned by HTTP request headers
flows to a logging call.
Copy link
Member

@charankamarapu charankamarapu left a comment

Choose a reason for hiding this comment

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

remove the comments

pkg/platform/yaml/yaml.go Outdated Show resolved Hide resolved
pkg/platform/yaml/yaml.go Outdated Show resolved Hide resolved
pkg/platform/yaml/yaml.go Outdated Show resolved Hide resolved
pkg/platform/yaml/yaml.go Outdated Show resolved Hide resolved
pkg/platform/yaml/yaml.go Outdated Show resolved Hide resolved
pkg/platform/yaml/yaml.go Outdated Show resolved Hide resolved
Signed-off-by: Akash Kumar <meakash7902@gmail.com>
@charankamarapu charankamarapu self-requested a review October 6, 2023 06:18
Copy link
Member

@charankamarapu charankamarapu left a comment

Choose a reason for hiding this comment

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

Ship it!

pkg/platform/yaml/yaml.go Fixed Show fixed Hide fixed
pkg/platform/yaml/yaml.go Fixed Show fixed Hide fixed
@charankamarapu
Copy link
Member

hey @AkashKumar7902 the github action is failing due to this issue #964 . I will merge this PR once that issue is resolved.

@charankamarapu charankamarapu mentioned this pull request Oct 6, 2023
12 tasks
@charankamarapu charankamarapu merged commit ba5248c into keploy:main Oct 6, 2023
7 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Oct 6, 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.

[feature]: Give an option to user to name testcases
3 participants