cancel
Showing results for 
Search instead for 
Did you mean: 

Unify unit and integration tests configs

0 Kudos

Unify unit and integration tests configs

Feature request from wojtekn, posted on GitHub Mar 03, 2016

This isn't something big, but I think it may be worth to improve both phpunit.xml.dist files to make them working in similar way by default. For now the biggest difference is that integration tests don't include whole app/code but limit code coverage only to Magento code:

<directory suffix=".php">../../../app/code/Magento</directory>

Unit tests enable everything from app/code by default:

<directory suffix=".php">../../../app/code/*</directory>

Another improvements may include adding logging configuration example in integration tests and adjusting nodes order.

4 Comments
New Member

Comment from Vinai, posted on GitHub Mar 03, 2016

During development I commonly only run the whole integration test suite by CI, so I like having individual testsuites for non-magento modules.

New Member

Comment from wojtekn, posted on GitHub Mar 03, 2016

@Vinai when I work on custom module I run tests only for that module eg.:

phpunit -c phpunit.xml.dist ../../../app/code/Vendor/Module/Test/Integration

I found that issue when I wanted to review code coverage. For unit tests I copied phpunit.xml.dist to phpunit.xml, commented out logging nodes and that was it.

For integration I did the same and it didn't work - logging nodes are not there and default filter setup doesn't cover non-Magento code.

I would expect similar experience for both test types.

New Member

Comment from Vinai, posted on GitHub Mar 03, 2016

Collecting coverage data for integration tests isn't that common in my experience except for maybe identifying bigger uncovered areas. Integration tests are not really meant to cover all execution paths, they are generally too expensive to write and maintain. That's what unit tests are really good at.

New Member

Comment from wojtekn, posted on GitHub Mar 09, 2016

@Vinai thanks, I understand your point, however it still may make sense to have these configs unified.