Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0036663Openbravo ERPZ. Otherspublic2017-08-17 17:032017-09-21 16:49
markmm82 
markmm82 
normalmajorhave not tried
closedfixed 
5
 
3.0PR17Q4 
aferraz
Core
No
0036663: TaxesText junit test does 2.400 junit skip all the time
TaxesTest is parametrized junit test-case. So some individual test-case will get called several times with different data.

For this the class contains the big param function defining 200 lines of data.

Then for each of the lines 4 individual junit testcase-types are run:
- testSalesOrder
- testPurchaseOrder
- testSalesInvoice
- testPurchaseInvoice

It just runs those 4 together so in the following treated as one block. Total testcases to run 800.

However:
of the 200 data lines each of those has 2 'flags: technically boolean values as part of the data
a.) isPriceIncludingTaxes
b.) isTaxDocumentLevel

For all 4 combination of those 2 booleans (ff, ft, tf, tt) there exist separate junit testcases (1 copy of the 4 above).
Note there is no overlap.

So for each of the 200 data lines
3 group say -> not for me -> SKIP -> 3*800 = 2400 skip
1 group says -> for me and runs 1*800 = 800 test-cases run

As there is 0 overlap between the 200 data-lines they can be just split into 4 groups matching the 4 groups of tests.

So each gets 'its' lines but not the others -> 2.4k skip gone.

It is needed only run those 800 tests and avoid those 2400 skip.
Run TaxesText and you will see the 2400 skip
No tags attached.
Issue History
2017-08-17 17:03markmm82New Issue
2017-08-17 17:03markmm82Assigned To => markmm82
2017-08-17 17:03markmm82Modules => Core
2017-08-17 17:03markmm82Triggers an Emergency Pack => No
2017-08-18 09:38hgbotCheckin
2017-08-18 09:38hgbotNote Added: 0098537
2017-08-18 09:38hgbotStatusnew => resolved
2017-08-18 09:38hgbotResolutionopen => fixed
2017-08-18 09:38hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/6700912c8eec76b63dfad40e53e93ecf992bf124 [^]
2017-08-18 09:39hgbotCheckin
2017-08-18 09:39hgbotNote Added: 0098538
2017-08-18 09:41aferrazReview Assigned To => aferraz
2017-08-18 09:41aferrazNote Added: 0098539
2017-08-18 09:41aferrazStatusresolved => closed
2017-08-18 09:41aferrazFixed in Version => 3.0PR17Q4
2017-09-21 16:49hudsonbotCheckin
2017-09-21 16:49hudsonbotNote Added: 0099313
2017-09-21 16:49hudsonbotCheckin
2017-09-21 16:49hudsonbotNote Added: 0099314

Notes
(0098537)
hgbot   
2017-08-18 09:38   
Repository: erp/devel/pi
Changeset: 6700912c8eec76b63dfad40e53e93ecf992bf124
Author: Mark <markmm82 <at> gmail.com>
Date: Thu Aug 17 11:57:01 2017 -0400
URL: http://code.openbravo.com/erp/devel/pi/rev/6700912c8eec76b63dfad40e53e93ecf992bf124 [^]

Fixes issue 36663: TaxesTest junit test does 2.400 junit skip all the time

Refactorized TaxesTest junit test to only run the needed 800 tests and avoid the 2400 skip.
To do that, were grouped methods with same logic and possible combinations into an unique
Test Case to run it once.

---
M src-test/src/org/openbravo/test/taxes/TaxesTest.java
---
(0098538)
hgbot   
2017-08-18 09:39   
Repository: erp/devel/pi
Changeset: 0e986cedf7be2c8fb96205eb5e9696826931a08e
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Fri Aug 18 09:37:27 2017 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/0e986cedf7be2c8fb96205eb5e9696826931a08e [^]

Related to issue 36663: Code review improvements

Use OBDal.getInstance().getProxy() instead of OBDal.getInstance().get() to avoid initializing the object with a database read when not required.

---
M src-test/src/org/openbravo/test/taxes/TaxesTest.java
---
(0098539)
aferraz   
2017-08-18 09:41   
Code review + Testing OK
(0099313)
hudsonbot   
2017-09-21 16:49   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/9750b78d3e5c [^]
Maturity status: Test
(0099314)
hudsonbot   
2017-09-21 16:49   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/9750b78d3e5c [^]
Maturity status: Test