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

test(besu): refactor jest test negative test cases #3468

Merged

Conversation

ashnashahgrover
Copy link
Contributor

@ashnashahgrover ashnashahgrover commented Aug 8, 2024

Commit to be reviewed

test(besu): refactor jest test negative test cases

1. Refactored all negative test case exception assertions for cactus-plugin-ledger-connector-besu.
Removed try-catch blocks, replaced with declarations through jest and jest-extended's own API.
2. Noted two tests within openapi-validation.test.ts
(GetPastLogsEndpoint and GetBesuRecordEndpointV1 with empty parameters) where the status
code returned should be 400 but is 200. This could be investigated in a seperate issue.

Fixes #3467

Pull Request Requirements

  • Rebased onto upstream/main branch and squashed into single commit to help maintainers review it more efficient and to avoid spaghetti git commit graphs that obfuscate which commit did exactly what change, when and, why.
  • Have git sign off at the end of commit message to avoid being marked red. You can add -s flag when using git commit command. You may refer to this link for more information.
  • Follow the Commit Linting specification. You may refer to this link for more information.

Character Limit

  • Pull Request Title and Commit Subject must not exceed 72 characters (including spaces and special characters).
  • Commit Message per line must not exceed 80 characters (including spaces and special characters).

A Must Read for Beginners
For rebasing and squashing, here's a must read guide for beginners.

Copy link
Contributor

@outSH outSH left a comment

Choose a reason for hiding this comment

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

EDIT - Sorry, set wrong status by mistake :)

Copy link
Contributor

@outSH outSH left a comment

Choose a reason for hiding this comment

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

The test you've modified is failing in the CI, please investigate

@jagpreetsinghsasan
Copy link
Contributor

@ashnashahgrover please fix the failing CI tests
PR - Commit Parity test is a new one which deals with checking if the PR description matches exactly to one of the included commit messages. I checked the diff and it seems that you have updated your commit message but havent updated the same in PR message. Updating the PR message/Commit message to match will fix this failing test.
Also did you test the code after refactoring (I cloned and tested this branch) ? This is must (also spend some time creating a clean PR with good PR-commit message, title, no unneccesary code, irrelevant code comments and all that general stuff)

@ashnashahgrover ashnashahgrover force-pushed the ashnashahgrover/issue3455 branch 2 times, most recently from f4a4bda to 6af2416 Compare August 12, 2024 19:40
Copy link
Contributor

@petermetz petermetz left a comment

Choose a reason for hiding this comment

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

@ashnashahgrover Getting closer! I see that the lint is still failing, you could most likely fix that by running the lint locally and then committing the diff it generates.

@ashnashahgrover ashnashahgrover deleted the ashnashahgrover/issue3455 branch August 18, 2024 20:50
@ashnashahgrover ashnashahgrover restored the ashnashahgrover/issue3455 branch August 18, 2024 20:52
@ashnashahgrover ashnashahgrover force-pushed the ashnashahgrover/issue3455 branch from 6af2416 to 21d0f78 Compare August 18, 2024 21:13
@ashnashahgrover
Copy link
Contributor Author

@ashnashahgrover Getting closer! I see that the lint is still failing, you could most likely fix that by running the lint locally and then committing the diff it generates.

Just did this, by running yarn run lint.

Copy link
Contributor

@outSH outSH left a comment

Choose a reason for hiding this comment

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

LGTM, thank you for the updates!

Copy link
Contributor

@petermetz petermetz left a comment

Choose a reason for hiding this comment

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

@ashnashahgrover Looking good to me now. Tip for next time: Use the re-request review button to put it back in my review queue, otherwise it doesn't show up in my feed.

@jagpreetsinghsasan
Copy link
Contributor

LGTM

@jagpreetsinghsasan jagpreetsinghsasan dismissed their stale review August 29, 2024 02:48

Changes incorporated. Approved by Peter

Primary Changes
----------------
1. Refactored all negative test case exception assertions for cactus-plugin-ledger-connector-besu.
Removed try-catch blocks, replaced with declarations through jest and jest-extended's own API.
2. Noted two tests within openapi-validation.test.ts
(GetPastLogsEndpoint and GetBesuRecordEndpointV1 with empty parameters) where the status
code returned should be 400 but is 200. This could be investigated in a seperate issue.

Fixes hyperledger-cacti#3467

Signed-off-by: ashnashahgrover <[email protected]>
@petermetz petermetz force-pushed the ashnashahgrover/issue3455 branch from 21d0f78 to e7a8590 Compare August 29, 2024 14:59
@petermetz petermetz merged commit d509dad into hyperledger-cacti:main Aug 29, 2024
144 of 146 checks passed
@petermetz petermetz deleted the ashnashahgrover/issue3455 branch August 29, 2024 15:32
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.

test(besu): refactor jest test negative test cases
4 participants