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

refactor(libs/fraud): fraud tests overhaul #2039

Merged
merged 2 commits into from
Apr 12, 2023
Merged

Conversation

Wondertan
Copy link
Member

The main goal here is to prepare everything for extraction. There was a cyclic dependency and dependence on ExtendedHeader inside of fraud, which blocked the extraction. This patch fixes this in conjunction with cleanings for testing utilities and actual tests.

List of other notable changes:

  • Updates go-header and
    • migrates to the new API for testing in header
  • Restructures fraud pkg and extract fraud.Service and related logic into sub pkg fraudserv
    • Keeping only interface definitions inside of the root fraud
  • Extracts testing utilities into fraudtest
  • Adds sprinkles of documentation

@Wondertan Wondertan self-assigned this Apr 7, 2023
@Wondertan Wondertan added kind:refactor Attached to refactoring PRs area:header Extended header labels Apr 7, 2023
The main goal here is to prepare everything for extraction. There was a cyclic dependency
and dependance on ExtendedHeader inside of `fraud` which blocked the extraction. This patch
fixes this in conjuction with cleanings for testing utilies and actual tests.

Other list of notable changes:
* Updates go-header
* Restuctures fraud pkg and extract fraud.Service into sub pkg fraudserv
* Extracts testing utilities into fraudtest
* Adds sprinkles of documentation
@codecov-commenter
Copy link

Codecov Report

Merging #2039 (3b8842a) into main (9c0a5fb) will decrease coverage by 0.24%.
The diff coverage is 73.13%.

@@            Coverage Diff             @@
##             main    #2039      +/-   ##
==========================================
- Coverage   54.41%   54.17%   -0.24%     
==========================================
  Files         216      217       +1     
  Lines       14057    13991      -66     
==========================================
- Hits         7649     7580      -69     
- Misses       5582     5583       +1     
- Partials      826      828       +2     
Impacted Files Coverage Δ
libs/fraud/fraudserv/pb/proof.pb.go 34.71% <ø> (ø)
libs/fraud/fraudserv/requester.go 48.14% <ø> (ø)
libs/fraud/fraudtest/dummy_service.go 0.00% <0.00%> (ø)
libs/fraud/metrics.go 65.38% <ø> (ø)
libs/fraud/proof.go 64.28% <0.00%> (-6.69%) ⬇️
share/eds/store.go 61.77% <ø> (ø)
libs/fraud/fraudserv/sync.go 58.47% <66.66%> (ø)
libs/fraud/fraudserv/store.go 58.33% <83.33%> (ø)
libs/fraud/fraudserv/service.go 69.07% <84.61%> (ø)
header/headertest/testing.go 83.69% <100.00%> (-0.04%) ⬇️
... and 6 more

... and 3 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Member

@vgonkivs vgonkivs left a comment

Choose a reason for hiding this comment

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

LGTM

header/headertest/testing.go Show resolved Hide resolved
libs/fraud/proof.go Show resolved Hide resolved
libs/fraud/fraudserv/service_test.go Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:fraud area:header Extended header kind:refactor Attached to refactoring PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants