apache/couchdb — pull request #253 by kxepal (2014-06-23 12:21:12+00:00)
Title: Replace etap tests with eunit

This PR replaces etap test with eunit.

Issues with etap:

1. It's etap (:
2. Almost for all suites each next test depends from the state of previous one
3. Lack of integration with rebar out of box
4. Badly organization

Goals:

1. Refresh test suite: split and isolate each test case
2. Find and get rid heisenbugs
3. Make test suite ready for CouchDB 2.0 build system

Considerations:

1. Each target test function name reflects the test goal
2. Each target test function starts with `should_` prefix to 1) separate test functions from helper ones 2) make names more clean
3. Otherwise test has description or reference to couchdb issue
4. Test suites which tests specific module named as this module is
5. Otherwise they starts with more common "couchdb_" prefix
6. Tests output should be human friendly

Fixed issues (at least):

- Timeouts are reduced to meanful values, all timer:sleep are removed unless they are required for test logic
- 073-changes.t: heartbeats count is very depended from host's performance
- 090-task-status.t: get_task_prop silently resets Acc if searched task isn't last in the list
- 140-attachments-comp.t: zlib:gzip only worked for small attachments
- 201-view-group-shutdown.t: race condition for {error, all_dbs_active} assertion check. Previously was solved by timer:sleep.

Some stats:

- CouchDB:
- Etap:
- Files=52, Tests=1219
- time make check 107.92s user 11.17s system 35% cpu 5:38.20 total
- Eunit:
- Files=29, Tests=693
- time make check 74.41s user 11.68s system 51% cpu 2:48.48 total
- couch_mrview:
- Etap:
- Files=7, Tests=41
- time make check 3.02s user 0.79s system 73% cpu 5.191 total
- Eunit:
- Files=7, Tests=39
- time make check 1.48s user 0.32s system 52% cpu 3.405 total
- couch_replicator:
- Etap:
- Files=7, Tests=1832
- time make check 115.11s user 13.94s system 81% cpu 2:37.98 total
- Eunit:
- Files=7, Tests=127
- time make check 133.73s user 15.99s system 89% cpu 2:47.51 total

(Notice: as for etap each "test" actually means the assertion)

Expected output: https://www.friendpaste.com/2MCgzw3g18ATOWyLGBSQwZ

Notice: I'd ran tests both on fast and slow environment (single cored virtualbox with 40% cpu cap), so execution timeouts fits both. However, I'm not sure about all possible configurations, so if any test fails with *timeout* for you please include in your report your system configuration - it

Notice: [error] messages in output is *FINE* - they happens because `log=none` doesn't disables logging completely, allowing error messages to be emit out.

P.S. All commits after "Goodbye etap!" will be squashed before merge.

COUCHDB-1963