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

[WIP] - add check to unit tests to ensure all created payments are valid #15706

Closed
wants to merge 2 commits into from

Conversation

eileenmcnaughton
Copy link
Contributor

Overview

A brief description of the pull request. Try to keep it non-technical.

Before

The current status. Please provide screenshots or gifs (LICEcap, SilentCast) where appropriate.

After

What has been changed. Please provide screenshots or gifs (LICEcap, SilentCast) where appropriate.

Technical Details

If the PR introduces noteworthy technical changes, please describe them here. Provide code snippets if necessary

Comments

Anything else you would like the reviewer to note

@civibot
Copy link

civibot bot commented Nov 2, 2019

(Standard links)

@civibot civibot bot added the master label Nov 2, 2019
@eileenmcnaughton eileenmcnaughton force-pushed the bug_test branch 3 times, most recently from 4efbcf0 to 30aeb93 Compare November 6, 2019 08:57
eileenmcnaughton added a commit to eileenmcnaughton/civicrm-core that referenced this pull request Nov 6, 2019
While testing payments I hit a bug where I tried to add a payment to a contribution with no financial items.

I never managed to replicate it again or determine how the payment came to be in that state but
it's been playing in my mind that people could get fatal errors if the financial_items don't exist
and dealing with those as regression reports will very tough. So my plan is
- for 5.20 add this extra routine to create it if it does not exist
- use this mechanism + more digging to figure out how legit an issue it is civicrm#15706
- in future releases 'get noisy' about having to create them if they don't exist
- eventually remove this routine
eileenmcnaughton added a commit to eileenmcnaughton/civicrm-core that referenced this pull request Nov 6, 2019
While testing payments I hit a bug where I tried to add a payment to a contribution with no financial items.

I never managed to replicate it again or determine how the payment came to be in that state but
it's been playing in my mind that people could get fatal errors if the financial_items don't exist
and dealing with those as regression reports will very tough. So my plan is
- for 5.20 add this extra routine to create it if it does not exist
- use this mechanism + more digging to figure out how legit an issue it is civicrm#15706
- in future releases 'get noisy' about having to create them if they don't exist
- eventually remove this routine
eileenmcnaughton added a commit to eileenmcnaughton/civicrm-core that referenced this pull request Nov 6, 2019
While testing payments I hit a bug where I tried to add a payment to a contribution with no financial items.

I never managed to replicate it again or determine how the payment came to be in that state but
it's been playing in my mind that people could get fatal errors if the financial_items don't exist
and dealing with those as regression reports will very tough. So my plan is
- for 5.20 add this extra routine to create it if it does not exist
- use this mechanism + more digging to figure out how legit an issue it is civicrm#15706
- in future releases 'get noisy' about having to create them if they don't exist
- eventually remove this routine
eileenmcnaughton added a commit to eileenmcnaughton/civicrm-core that referenced this pull request Nov 6, 2019
While testing payments I hit a bug where I tried to add a payment to a contribution with no financial items.

I never managed to replicate it again or determine how the payment came to be in that state but
it's been playing in my mind that people could get fatal errors if the financial_items don't exist
and dealing with those as regression reports will very tough. So my plan is
- for 5.20 add this extra routine to create it if it does not exist
- use this mechanism + more digging to figure out how legit an issue it is civicrm#15706
- in future releases 'get noisy' about having to create them if they don't exist
- eventually remove this routine
eileenmcnaughton added a commit to eileenmcnaughton/civicrm-core that referenced this pull request Nov 6, 2019
While testing payments I hit a bug where I tried to add a payment to a contribution with no financial items.

I never managed to replicate it again or determine how the payment came to be in that state but
it's been playing in my mind that people could get fatal errors if the financial_items don't exist
and dealing with those as regression reports will very tough. So my plan is
- for 5.20 add this extra routine to create it if it does not exist
- use this mechanism + more digging to figure out how legit an issue it is civicrm#15706
- in future releases 'get noisy' about having to create them if they don't exist
- eventually remove this routine
@eileenmcnaughton eileenmcnaughton changed the title [WIP] - throwing stuff at jenkins [WIP] - add check to unit tests to ensure all created payments are valid Nov 8, 2019
@eileenmcnaughton
Copy link
Contributor Author

test this please

eileenmcnaughton added a commit to eileenmcnaughton/civicrm-core that referenced this pull request Nov 11, 2019
…cenario

I have discovered a lot of tests are creating invalid contributions - civicrm#15706

So far the issues have been in the test + us permitting something that doesn't work on the form - ie civicrm#15771

I'm trying to work through them all & then we can ideally validate payments in general. In this case
it turns out that because 'amount' is currently a 'required' parameter the tests have 'any value' stuck in there.
In a real submission it would be calculated so I'm trying to share the code that would do that with
the path used by the test (& in this case the api) and to move towards getting the tests valid
eileenmcnaughton added a commit to eileenmcnaughton/civicrm-core that referenced this pull request Nov 11, 2019
…cenario

I have discovered a lot of tests are creating invalid contributions - civicrm#15706

So far the issues have been in the test + us permitting something that doesn't work on the form - ie civicrm#15771

I'm trying to work through them all & then we can ideally validate payments in general. In this case
it turns out that because 'amount' is currently a 'required' parameter the tests have 'any value' stuck in there.
In a real submission it would be calculated so I'm trying to share the code that would do that with
the path used by the test (& in this case the api) and to move towards getting the tests valid
eileenmcnaughton added a commit to eileenmcnaughton/civicrm-core that referenced this pull request Nov 11, 2019
…cenario

I have discovered a lot of tests are creating invalid contributions - civicrm#15706

So far the issues have been in the test + us permitting something that doesn't work on the form - ie civicrm#15771

I'm trying to work through them all & then we can ideally validate payments in general. In this case
it turns out that because 'amount' is currently a 'required' parameter the tests have 'any value' stuck in there.
In a real submission it would be calculated so I'm trying to share the code that would do that with
the path used by the test (& in this case the api) and to move towards getting the tests valid
eileenmcnaughton added a commit to eileenmcnaughton/civicrm-core that referenced this pull request Nov 12, 2019
…cenario

I have discovered a lot of tests are creating invalid contributions - civicrm#15706

So far the issues have been in the test + us permitting something that doesn't work on the form - ie civicrm#15771

I'm trying to work through them all & then we can ideally validate payments in general. In this case
it turns out that because 'amount' is currently a 'required' parameter the tests have 'any value' stuck in there.
In a real submission it would be calculated so I'm trying to share the code that would do that with
the path used by the test (& in this case the api) and to move towards getting the tests valid
@eileenmcnaughton
Copy link
Contributor Author

test this please

eileenmcnaughton added a commit to eileenmcnaughton/civicrm-core that referenced this pull request Nov 15, 2019
…lly paying a contribution.

As civicrm#15706 signposts - creating a contribution with a status of 'Partially Paid'
is not actually a valid thing to do. There are no created financial_trxns & the balance is wrong. In some places the code does
this in conjunction with some parameters. These don't really work either. We need to deprecate & eliminate this flow.

I'm expecting some tests to fail & need fixing before this passes
eileenmcnaughton added a commit to eileenmcnaughton/civicrm-core that referenced this pull request Nov 15, 2019
…lly paying a contribution.

As civicrm#15706 signposts - creating a contribution with a status of 'Partially Paid'
is not actually a valid thing to do. There are no created financial_trxns & the balance is wrong. In some places the code does
this in conjunction with some parameters. These don't really work either. We need to deprecate & eliminate this flow.

I'm expecting some tests to fail & need fixing before this passes
eileenmcnaughton added a commit to eileenmcnaughton/civicrm-core that referenced this pull request Nov 15, 2019
…lly paying a contribution.

As civicrm#15706 signposts - creating a contribution with a status of 'Partially Paid'
is not actually a valid thing to do. There are no created financial_trxns & the balance is wrong. In some places the code does
this in conjunction with some parameters. These don't really work either. We need to deprecate & eliminate this flow.

I'm expecting some tests to fail & need fixing before this passes
eileenmcnaughton added a commit to eileenmcnaughton/civicrm-core that referenced this pull request Nov 16, 2019
…lly paying a contribution.

As civicrm#15706 signposts - creating a contribution with a status of 'Partially Paid'
is not actually a valid thing to do. There are no created financial_trxns & the balance is wrong. In some places the code does
this in conjunction with some parameters. These don't really work either. We need to deprecate & eliminate this flow.

I'm expecting some tests to fail & need fixing before this passes
eileenmcnaughton added a commit to eileenmcnaughton/civicrm-core that referenced this pull request Nov 21, 2019
…lly paying a contribution.

As civicrm#15706 signposts - creating a contribution with a status of 'Partially Paid'
is not actually a valid thing to do. There are no created financial_trxns & the balance is wrong. In some places the code does
this in conjunction with some parameters. These don't really work either. We need to deprecate & eliminate this flow.

I'm expecting some tests to fail & need fixing before this passes
Honestly - why isn't this failing already? We only need the contributionID so this works
eileenmcnaughton added a commit to eileenmcnaughton/civicrm-core that referenced this pull request Nov 21, 2019
Per civicrm#15706 the setup for this test
is creating invalid transactions. This fixes - I had to do an order fix in the process
eileenmcnaughton added a commit to eileenmcnaughton/civicrm-core that referenced this pull request Nov 21, 2019
…lly paying a contribution.

As civicrm#15706 signposts - creating a contribution with a status of 'Partially Paid'
is not actually a valid thing to do. There are no created financial_trxns & the balance is wrong. In some places the code does
this in conjunction with some parameters. These don't really work either. We need to deprecate & eliminate this flow.

I'm expecting some tests to fail & need fixing before this passes
eileenmcnaughton added a commit to eileenmcnaughton/civicrm-core that referenced this pull request Nov 21, 2019
Per civicrm#15706 the setup for this test
is creating invalid transactions. This fixes - I had to do an order fix in the process
eileenmcnaughton added a commit to eileenmcnaughton/civicrm-core that referenced this pull request Nov 22, 2019
Per civicrm#15706 the setup for this test
is creating invalid transactions. This fixes - I had to do an order fix in the process
eileenmcnaughton added a commit to eileenmcnaughton/civicrm-core that referenced this pull request Nov 22, 2019
Per civicrm#15706 the setup for this test
is creating invalid transactions. This fixes - I had to do an order fix in the process
@eileenmcnaughton
Copy link
Contributor Author

Will re-open when I want to run again - need to pull out validateContributions - too hard

eileenmcnaughton added a commit to eileenmcnaughton/civicrm-core that referenced this pull request Nov 28, 2019
Per civicrm#15706 the setup for this test
is creating invalid transactions. This fixes - I had to do an order fix in the process
eileenmcnaughton added a commit to eileenmcnaughton/civicrm-core that referenced this pull request Nov 29, 2019
Per civicrm#15706 the setup for this test
is creating invalid transactions. This fixes - I had to do an order fix in the process
eileenmcnaughton added a commit to eileenmcnaughton/civicrm-core that referenced this pull request Nov 29, 2019
Per civicrm#15706 the setup for this test
is creating invalid transactions. This fixes - I had to do an order fix in the process
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant