Skip to content

Payment e2e test - #2013

Merged
vkuznecovas merged 2 commits into
masterfrom
payment-e2e-test
Apr 7, 2020
Merged

Payment e2e test#2013
vkuznecovas merged 2 commits into
masterfrom
payment-e2e-test

Conversation

@vkuznecovas

Copy link
Copy Markdown
Contributor

Added payment + settlement tests.

Fixes #1330

@anjmao anjmao left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice 👍

Comment thread e2e/connection_test.go
fees, err := tequilapiProvider.GetTransactorFees()
assert.NoError(t, err)

accountantFee := math.Round(0.04 * float64(providerStatus.EarningsTotal))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

its a 4% accountant fee?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yes it is.

Comment thread e2e/connection_test.go
expected := initialBalance + providerStatus.EarningsTotal - fees.Settlement - accountantFeeUint

// To avoid running into rounding errors, assume a delta of 2 micromyst is OK
assert.InDelta(t, expected, providerStatus.Balance, 2)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nice func

@codecov-io

codecov-io commented Apr 6, 2020

Copy link
Copy Markdown

Codecov Report

Merging #2013 into master will decrease coverage by 0.08%.
The diff coverage is 36.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2013      +/-   ##
==========================================
- Coverage   48.02%   47.94%   -0.09%     
==========================================
  Files         290      290              
  Lines       13024    13026       +2     
==========================================
- Hits         6255     6245      -10     
- Misses       6189     6199      +10     
- Partials      580      582       +2     
Impacted Files Coverage Δ
config/flags_payments.go 0.00% <0.00%> (ø)
session/pingpong/factory.go 0.00% <ø> (ø)
tequilapi/client/dto.go 0.00% <ø> (ø)
session/pingpong/invoice_payer.go 76.72% <36.36%> (ø)
session/pingpong/invoice_tracker.go 58.93% <36.36%> (ø)
session/pingpong/price_calculator.go 100.00% <100.00%> (ø)
tequilapi/endpoints/sse_handler.go 71.66% <0.00%> (-4.17%) ⬇️
communication/nats/dialog/dialog_waiter.go 86.11% <0.00%> (-2.78%) ⬇️
nat/traversal/pinger.go 63.49% <0.00%> (-0.77%) ⬇️
core/connection/manager.go 71.71% <0.00%> (-0.46%) ⬇️
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dc03042...b3814f0. Read the comment docs.

@vkuznecovas
vkuznecovas merged commit dcfde43 into master Apr 7, 2020
@vkuznecovas
vkuznecovas deleted the payment-e2e-test branch April 7, 2020 07:17
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.

e2e tests: add accountant, test payment flow

5 participants