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

fix: handle panic in case of empty test case file #1840

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kidminks
Copy link

Related Issue

  • Test mode panics in case of empty test case

Closes: #1755

Describe the changes you've made

I have added a check in testDb/utils.go > Decode() to handle nil yamlTestCase due to which panic was occurring. Decode function will return error with message test case not present incase test is empty

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

Signed-off-by: Mayank Kumar <[email protected]>
Signed-off-by: infinity <[email protected]>
Copy link

github-actions bot commented Apr 20, 2024

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Thank you and congratulations 🎉 for opening your very first pull request in keploy

@kidminks
Copy link
Author

I have read the CLA Document and I hereby sign the CLA

@kidminks
Copy link
Author

recheck

Comment on lines +228 to +230
if yamlTestcase == nil {
return nil, errors.New("test case not present")
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Hey @kidminks the logic seems to be correct but the message can be updated with

Skipped incomplete test case: Please verify that the test case is fully specified.

@shivamsouravjha
Copy link
Contributor

hey @kidminks any update on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[bug]: test mode panics in case of empty test case
2 participants