iilyak commented on issue #1790: Move tests to suite
URL: https://github.com/apache/couchdb/pull/1790#issuecomment-443882712
 
 
   @kxepal: Unfortunately tests within a module don't work in some cases. There 
are at least two problems with such tests:
   - when `meck` mocks the module it doesn't define `TEST` macro. When eunit 
stops the test where meck was used it is not smart enough to unload the module. 
BEAM uses that version of the module which doesn't have exported test 
functions. When eunit framework scans the loaded modules to find what tests to 
run it doesn't see the tests (because they are not define in the loaded 
module). 
   - when module is used from a dependency. Let's assume the eunit decided to 
run tests for applications in following order `chttpd`, `couch`. `chttpd` uses 
some functions from `couch` application. Therefore `couch` application is 
compiled. The problem is `TEST` is not defined. Which means that modules are 
compiled without test functions. This set of modules loaded in the VM. Again 
eunit cannot unload the module and load correct version when it moves on to 
`couch` app testing.
   
   Therefore tests in the same module is anti-pattern, unfortunately.  

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to