Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0043802Openbravo ERP04. Warehouse managementpublic2020-04-20 13:482020-04-27 14:06
shuehner 
inigo_lerga 
normalminorhave not tried
closedfixed 
5
 
3.0PR20Q23.0PR20Q2 
vmromanos
Core
No
0043802: Referencedinventory tests are incompatible with AWO and should auto-skip themselves if AWO is present
The referencesinventory junit tests in PI are not compatible with AWO module as they create some data not compliant with some new constraint added when installing AWO.

To avoid them failing when AWO is present they can be disabled manually however that needs to be done in every environment (developer or many CI jobs) having AWO installed.
Current list:
org.openbravo.test.referencedinventory.ReferencedInventoryBoxForcedReservation
org.openbravo.test.referencedinventory.ReferencedInventoryBoxFullReservationTest
org.openbravo.test.referencedinventory.ReferencedInventoryBoxOverReservation1MovementLineTest
org.openbravo.test.referencedinventory.ReferencedInventoryBoxOverReservation2MovementLinesTest
org.openbravo.test.referencedinventory.ReferencedInventoryBoxPartialReservation1MovementLineTest
org.openbravo.test.referencedinventory.ReferencedInventoryBoxPartialReservation2MovementLinesTest
org.openbravo.test.referencedinventory.ReferencedInventoryBoxSeveralStorageDetailsTest
org.openbravo.test.referencedinventory.ReferencedInventoryBoxTest
org.openbravo.test.referencedinventory.ReferencedInventoryExceptionTest
org.openbravo.test.referencedinventory.ReferencedInventoryFullBoxTest
org.openbravo.test.referencedinventory.ReferencedInventoryFullUnboxFullReservation
org.openbravo.test.referencedinventory.ReferencedInventoryFullUnboxPartialReservation
org.openbravo.test.referencedinventory.ReferencedInventoryFullUnboxTest
org.openbravo.test.referencedinventory.ReferencedInventoryPartialBoxTest
org.openbravo.test.referencedinventory.ReferencedInventoryPartialUnboxFullReservation
org.openbravo.test.referencedinventory.ReferencedInventoryPartialUnboxPartialReservation1MovementLineUnboxTest
org.openbravo.test.referencedinventory.ReferencedInventoryPartialUnboxPartialReservation2MovementLinesUnboxTest
org.openbravo.test.referencedinventory.ReferencedInventoryPartialUnboxTest
org.openbravo.test.referencedinventory.ReferencedInventorySequenceTest
org.openbravo.test.referencedinventory.ReferencedInventoryTest
org.openbravo.test.referencedinventory.ReferencedInventoryTestSuite
org.openbravo.test.referencedinventory.ReferencedInventoryTestUtils
org.openbravo.test.referencedinventory.ReferencedInventoryUnboxReservationTest
org.openbravo.test.referencedinventory.ReferencedInventoryUnboxTest

Instead those tests should check 'awo is present' and auto-skip themselves do avoid needing to have replicate that long exception list everywhere.

Attached patch implements that by checking if 'org.openbravo.warehouse.advancedwarehouse' module is present in the workspace.
1.) Fresh pi
2.) Add awo + dependencies
https://code.openbravo.com/erp/pmods/org.openbravo.warehouse.advancedwarehouseoperations [^]
https://code.openbravo.com/erp/pmods/org.openbravo.mobile.core [^]
3.) run ant run.all.tests
Notice tests listed above failing
Similar to code for skipping tests with 'config/disabled-tests' add assumeThat(<awo-not-installed>) as @Before.
As all referencedinventory tests have a single base class ReferencedInventoryTest that can be done centrally there easily.
No tags attached.
blocks defect 0043791 closed shuehner Referencedinventory tests are incompatible with AWO and should auto-skip themselves if AWO is present 
Issue History
2020-04-21 10:18shuehnerTypedefect => backport
2020-04-21 10:18shuehnerTarget Version => 3.0PR20Q2
2020-04-24 12:59inigo_lergaAssigned ToTriage Finance => inigo_lerga
2020-04-27 13:07hgbotCheckin
2020-04-27 13:07hgbotNote Added: 0119425
2020-04-27 13:07hgbotStatusscheduled => resolved
2020-04-27 13:07hgbotResolutionopen => fixed
2020-04-27 13:07hgbotFixed in SCM revision => http://code.openbravo.com/erp/backports/3.0PR20Q2/rev/80537edee10ad31a8814fa059786563205e6f410 [^]
2020-04-27 14:06vmromanosReview Assigned To => vmromanos
2020-04-27 14:06vmromanosNote Added: 0119430
2020-04-27 14:06vmromanosStatusresolved => closed
2020-04-27 14:06vmromanosFixed in Version => 3.0PR20Q2

Notes
(0119425)
hgbot   
2020-04-27 13:07   
Repository: erp/backports/3.0PR20Q2
Changeset: 80537edee10ad31a8814fa059786563205e6f410
Author: IƱigo Lerga <inigo.lerga <at> openbravo.com>
Date: Mon Apr 27 13:06:57 2020 +0200
URL: http://code.openbravo.com/erp/backports/3.0PR20Q2/rev/80537edee10ad31a8814fa059786563205e6f410 [^]

Fixed ISSUE-43802. Make referencedinventory test auto-skip if AWO is installed.

Those test are not compatible with AWO as data they create does not comply with
some new constraint added by AWO.
So far that was required to be handled manually by adding config/disabled-tests
i.e. in every CI job with AWO installed to list the all individual tests here
to skip them.

This issue makes that behavior automatic by checking inside a central base-class
if AWO module is present and skipping the tests themselves (using similar logic
as is used by code for skipping config/disabled-tests from OBBaseTest).
Note that the repeated (per test) calls to isModulePresent are very fast as
that function caches the data inside so no need for caching isAwoInstalled inside
the test-class.

---
M src-test/src/org/openbravo/test/referencedinventory/ReferencedInventoryTest.java
---
(0119430)
vmromanos   
2020-04-27 14:06   
Code review OK