Conversation
|
В |
Pull Request Test Coverage Report for Build 2996169178
💛 - Coveralls |
Codecov Report
@@ Coverage Diff @@
## master #43 +/- ##
=======================================
Coverage 89.37% 89.37%
=======================================
Files 49 49
Lines 4555 4555
=======================================
Hits 4071 4071
Misses 484 484
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
| -define(PARTY_ID_WITH_LIMIT, <<"bIg merch limit">>). | ||
| -define(PARTY_ID_WITH_SEVERAL_LIMITS, <<"bIg merch limit cascading">>). | ||
| -define(PARTYID_EXTERNAL, <<"DUBTV">>). | ||
| -define(LIMIT_ID, <<"ID">>). | ||
| -define(LIMIT_ID2, <<"ID2">>). | ||
| -define(LIMIT_ID3, <<"ID3">>). | ||
| -define(LIMIT_UPPER_BOUNDARY, 100000). |
| -define(invoice(ID), #domain_Invoice{id = ID}). | ||
| -define(payment(ID), #domain_InvoicePayment{id = ID}). | ||
| -define(payment(ID, Revision), #domain_InvoicePayment{id = ID, party_revision = Revision}). | ||
| -define(adjustment(ID), #domain_InvoicePaymentAdjustment{id = ID}). | ||
| -define(adjustment(ID, Status), #domain_InvoicePaymentAdjustment{id = ID, status = Status}). | ||
| -define(adjustment_revision(Revision), #domain_InvoicePaymentAdjustment{party_revision = Revision}). | ||
| -define(adjustment_reason(Reason), #domain_InvoicePaymentAdjustment{reason = Reason}). | ||
| -define(invoice_state(Invoice), #payproc_Invoice{invoice = Invoice}). | ||
| -define(invoice_state(Invoice, Payments), #payproc_Invoice{invoice = Invoice, payments = Payments}). | ||
| -define(payment_state(Payment), #payproc_InvoicePayment{payment = Payment}). | ||
| -define(payment_state(Payment, Refunds), #payproc_InvoicePayment{payment = Payment, refunds = Refunds}). | ||
| -define(payment_route(Route), #payproc_InvoicePayment{route = Route}). | ||
| -define(refund_state(Refund), #payproc_InvoicePaymentRefund{refund = Refund}). | ||
| -define(payment_cashflow(CashFlow), #payproc_InvoicePayment{cash_flow = CashFlow}). | ||
| -define(payment_last_trx(Trx), #payproc_InvoicePayment{last_transaction_info = Trx}). | ||
| -define(invoice_w_status(Status), #domain_Invoice{status = Status}). | ||
| -define(invoice_w_revision(Revision), #domain_Invoice{party_revision = Revision}). | ||
| -define(payment_w_status(Status), #domain_InvoicePayment{status = Status}). | ||
| -define(payment_w_status(ID, Status), #domain_InvoicePayment{id = ID, status = Status}). | ||
| -define(invoice_payment_refund(Cash, Status), #domain_InvoicePaymentRefund{cash = Cash, status = Status}). | ||
| -define(trx_info(ID), #domain_TransactionInfo{id = ID}). | ||
| -define(trx_info(ID, Extra), #domain_TransactionInfo{id = ID, extra = Extra}). | ||
| -define(refund_id(RefundID), #domain_InvoicePaymentRefund{id = RefundID}). | ||
| -define(refund_id(RefundID, ExternalID), #domain_InvoicePaymentRefund{id = RefundID, external_id = ExternalID}). | ||
|
|
||
| -define(CB_PROVIDER_LEVY, 50). | ||
| -define(merchant_to_system_share_1, ?share(45, 1000, operation_amount)). | ||
| -define(merchant_to_system_share_2, ?share(100, 1000, operation_amount)). |
| %%% - Do not share state between test cases | ||
| %%% - Run cases in parallel | ||
|
|
||
| -module(hg_invoice_parallel_tests_SUITE). |
There was a problem hiding this comment.
Тесты и так должны все в параллель работать. Смысл задачи в том, чтобы выделить тестсьют с обработкой разных платёжных инструментов, а не в том, чтобы выделить тестсьют с параллельными тесткейсами.
| {all_non_destructive_tests, [], [ | ||
| {group, base_payments} | ||
| ]}, |
There was a problem hiding this comment.
Какой смысл в этой вложенности?
| payment_success_empty_cvv(C) -> | ||
| Client = cfg(client, C), | ||
| InvoiceID = hg_invoice_tests_utils:start_invoice(<<"rubberduck">>, make_due_date(10), 42000, C), | ||
| {PaymentTool, Session} = hg_dummy_provider:make_payment_tool(empty_cvv, ?pmt_sys(<<"visa-ref">>)), |
There was a problem hiding this comment.
В задаче предлагается добиться использования здесь inline моков вместо hg_dummy_provider, чтобы из последнего выкинуть часть сложности.
| ?assertMatch( | ||
| #domain_TransactionInfo{ | ||
| extra = #{ | ||
| <<"payment.payer_session_info.redirect_url">> := RedirectURL | ||
| } | ||
| }, | ||
| Trx | ||
| ). |
There was a problem hiding this comment.
В целом вот эта вся хрень в случае использования inline-моков тривиально меняется на ?assertMatch прямо в моке, без необходимости как-то дополнительно это засовывать в extra.
| get_random_port() -> | ||
| rand:uniform(32768) + 32767. |
| instant -> | ||
| {instant, #payproc_InvoicePaymentParamsFlowInstant{}}; | ||
| {hold, OnHoldExpiration} -> | ||
| {hold, #payproc_InvoicePaymentParamsFlowHold{on_hold_expiration = OnHoldExpiration}} |
There was a problem hiding this comment.
Кажется проще тогда два макроса дополнительно завести, ?instant() / ?hold(...).
| %% timeout should be at least as large as hold expiration in construct_domain_fixture/0 | ||
| next_event(InvoiceID, 12000, Client). |
There was a problem hiding this comment.
На этом уровне коммент неактуален. Эти магические 12000 должны на каком-то другом уровне быть определены.
| @@ -0,0 +1,449 @@ | |||
| -module(hg_invoice_tests_utils). | |||
There was a problem hiding this comment.
Nit. Я б тогда по аналогии hg_ct_invoice бы может назвал.
No description provided.