Skip to content

test: add and fix existing ethermint rpc unit test#2294

Merged
skosito merged 45 commits intodevelopfrom
rpc-tests
Jun 6, 2024
Merged

test: add and fix existing ethermint rpc unit test#2294
skosito merged 45 commits intodevelopfrom
rpc-tests

Conversation

@skosito
Copy link
Member

@skosito skosito commented May 30, 2024

Description

Rpc folder was moved from ethermint repo to node, but unit tests weren't. This PR moves existing unit tests as well, with some fixes i will provide in comments so PR is easier to review - otherwise there are no significant changes. Modifications for unit tests to address rpc changes will be added in next PR to make review of those changes easier.

Partially closes: #2283

Type of change

Unit tests

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Include instructions and any relevant details so others can reproduce.

  • Tested CCTX in localnet
  • Tested in development environment
  • Go unit tests
  • Go integration tests
  • Tested via GitHub Actions

Checklist:

  • I have added unit tests that prove my fix feature works

@skosito skosito marked this pull request as ready for review May 31, 2024 11:40
Base automatically changed from debug-trace-tx-changes to develop May 31, 2024 18:37
@gitguardian
Copy link

gitguardian bot commented May 31, 2024

⚠️ GitGuardian has uncovered 2 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secrets in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
11033145 Triggered Generic High Entropy Secret 7dd8aa6 cmd/zetae2e/local/accounts.go View secret
11033146 Triggered Generic High Entropy Secret 7dd8aa6 cmd/zetae2e/local/accounts.go View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

Copy link
Contributor

@lumtis lumtis left a comment

Choose a reason for hiding this comment

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

Would it makes sense to add rpc/backend in test coverage scope?

@codecov
Copy link

codecov bot commented Jun 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.22%. Comparing base (a28d7e1) to head (077eb2e).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #2294      +/-   ##
===========================================
- Coverage    69.68%   68.22%   -1.46%     
===========================================
  Files          281      298      +17     
  Lines        16644    18857    +2213     
===========================================
+ Hits         11598    12865    +1267     
- Misses        4570     5355     +785     
- Partials       476      637     +161     
Files Coverage Δ
rpc/backend/tx_info.go 59.79% <100.00%> (ø)

... and 16 files with indirect coverage changes

@skosito
Copy link
Member Author

skosito commented Jun 3, 2024

Would it makes sense to add rpc/backend in test coverage scope?

added whole rpc folder, and coverage is 57% https://app.codecov.io/gh/zeta-chain/node/tree/rpc-tests/?trend=3%20months

with new issue to add more tests probably will increase, i would like to keep types folder as well since some new tests will touch that code as well

@skosito skosito requested a review from lumtis June 3, 2024 14:18
@lumtis
Copy link
Contributor

lumtis commented Jun 3, 2024

Would it makes sense to add rpc/backend in test coverage scope?

added whole rpc folder, and coverage is 57% https://app.codecov.io/gh/zeta-chain/node/tree/rpc-tests/?trend=3%20months

with new issue to add more tests probably will increase, i would like to keep types folder as well since some new tests will touch that code as well

Global test coverage only lose 1.5%, this is fine

Copy link
Contributor

@lumtis lumtis left a comment

Choose a reason for hiding this comment

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

LGTM

@skosito skosito merged commit cc18372 into develop Jun 6, 2024
@skosito skosito deleted the rpc-tests branch June 6, 2024 12:51
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.

Fork existing rpc methods unit tests

3 participants