WeareJH / m2-module-import

Import module for Magento 2 - provides commands, utilities and abstractions for building imports for Magento 2 projects
MIT License
19 stars 8 forks source link

Trying to part of failing tests #47

Closed bartoszkubicki closed 2 years ago

bartoszkubicki commented 2 years ago

This is attempt to fix some of failing unit tests. However it seems like test hasn't been fixed from a long time. Still even after this fixes we encounter:

EEEE.......................................................E... 63 / 314 ( 20%) ...................F....E.........EEEE.FFFFFFE..EE.....F....... 126 / 314 ( 40%) .............................FFF.F............E..E........E.... 189 / 314 ( 60%) ..E..........FEFFE........FF..F................................ 252 / 314 ( 80%) .................................EE.EEEEEEEEEE.E.......EEE.... 314 / 314 (100%)

35 errors + 18 failures. A lot of errors seem to touch classes for csv import. It means that test are outdated from a very long time and they failed even before adding db data source.

After doing some work I started wondering if all tests actually should not be wiped out. This kind of module require integration tests. Unit tests are maybe good for some parts, but not for almost all classes like we have now. Additional problem are dependencies https://github.com/WeareJH/m2-unit-test-helpers/pull/6 and https://github.com/phpspec/prophecy. Maybe there is some kind of gain if we speak about that amount of overmocked tests, but normally I would get rid of them, as they add to much shortcuts, that don't really change anything (my personal opinion - prophecy is still used for mocking). They make keeping up with quick-developing phpunit much harder than if we would use pure phpunit only.