iilyak opened a new pull request #1790: Move tests to suite URL: https://github.com/apache/couchdb/pull/1790 ## Overview Implementation of eunit tests in the same module with the code we are trying to test is not a good idea. The test suites in the module are conditionally compiled using `-ifdef(TEST).`. This means that depending on phase of the moon the tests can be skipped. They are certainly skipped when `eunit` is used in combination with `meck` library. This problem manifested itself in https://github.com/apache/couchdb/pull/1754 where the tests were originally introduced. The PR was merged because Travis was green and it had a `+1`. However close look at test logs (https://travis-ci.org/apache/couchdb/builds/458820868?utm_source=github_status&utm_medium=notification) on Travis reveal that the tests didn't run (search for couch_flags_config): ``` module 'couch_bt_engine_stream' module 'couch_flags_config' module 'couch_changes' module 'couch_changes_tests' Changes feed Filter _selector couch_changes_tests:368: should_select_basic...[0.055 s] ok couch_changes_tests:382: should_select_with_since...[0.001 s] ok ``` The only correct solution is to move tests into a suite in `test` directory. In this case compilation will be unconditional so the tests wouldn't be skipped. This PR moves the tests and updates the expected return value so the test pass. ## Testing recommendations 1. Run `make eunit > eunit.log` without reducing the scope of testing (using apps= or tests=). 2. Consult `eunit.log` to see if tests for couch_flags_config has been run. ## Related Issues or Pull Requests - https://github.com/apache/couchdb/pull/1754 ## Checklist - [x] Code is written and works correctly; - [x] Changes are covered by tests; - [ ] Documentation reflects the changes;
---------------------------------------------------------------- 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
