You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by kxepal <gi...@git.apache.org> on 2015/07/14 23:43:35 UTC

[GitHub] couchdb-khash pull request: Migrate the tests from etap to eunit

Github user kxepal commented on a diff in the pull request:

    https://github.com/apache/couchdb-khash/pull/2#discussion_r34623658
  
    --- Diff: test/khash_test.erl ---
    @@ -0,0 +1,443 @@
    +-module(khash_test).
    +
    +-compile([export_all]).
    +
    +-define(NODEBUG, true).
    --- End diff --
    
    Hm, it seems this option prevents tests from run:
    ```
    rebar compile
    ==> couchdb-khash (compile)
    rebar eunit
    ==> couchdb-khash (eunit)
    test/khash_test.erl:26: Warning: variable 'C' is unused
    test/khash_test.erl:87: Warning: erlang:now/0: Deprecated BIF. See the "Time and Time Correction in Erlang" chapter of the ERTS User's Guide for more information.
    test/khash_test.erl:102: Warning: variable 'State' is unused
    test/khash_test.erl:123: Warning: variable 'DTime' is unused
    test/khash_test.erl:124: Warning: variable 'KTime' is unused
    test/khash_test.erl:133: Warning: variable 'DTime' is unused
    test/khash_test.erl:134: Warning: variable 'KTime' is unused
    test/khash_test.erl:155: Warning: variable 'H' is unused
    test/khash_test.erl:155: Warning: variable 'I' is unused
    test/khash_test.erl:168: Warning: variable 'Fold' is unused
    test/khash_test.erl:168: Warning: a term is constructed, but never used
    test/khash_test.erl:189: Warning: variable 'I' is unused
    test/khash_test.erl:189: Warning: variable 'KVs' is unused
    test/khash_test.erl:211: Warning: variable 'Err' is unused
    test/khash_test.erl:211: Warning: variable 'I' is unused
    test/khash_test.erl:218: Warning: variable 'Err' is unused
    test/khash_test.erl:218: Warning: variable 'I' is unused
    test/khash_test.erl:225: Warning: variable 'Err' is unused
    test/khash_test.erl:225: Warning: variable 'I' is unused
    test/khash_test.erl:249: Warning: variable 'Err' is unused
    test/khash_test.erl:249: Warning: variable 'I' is unused
    test/khash_test.erl:256: Warning: variable 'Err' is unused
    test/khash_test.erl:256: Warning: variable 'I' is unused
    test/khash_test.erl:263: Warning: variable 'Err' is unused
    test/khash_test.erl:263: Warning: variable 'I' is unused
    test/khash_test.erl:270: Warning: variable 'Err' is unused
    test/khash_test.erl:270: Warning: variable 'I' is unused
    test/khash_test.erl:277: Warning: variable 'Err' is unused
    test/khash_test.erl:368: Warning: variable 'Value' is unused
    test/khash_test.erl:380: Warning: variable 'Value' is unused
    test/khash_test.erl:384: Warning: variable 'Val' is unused
    test/khash_test.erl:413: Warning: variable 'DKeys' is unused
    test/khash_test.erl:415: Warning: variable 'HKeys' is unused
    test/khash_test.erl:420: Warning: variable 'DKVs' is unused
    test/khash_test.erl:421: Warning: variable 'HKVs' is unused
    Compiled test/khash_test.erl
    ======================== EUnit ========================
    module 'khash'
    module 'khash_test'
      khash_test:16: load_test_ (Loaded khash)...ok
      khash basic operations
        khash_test:30: basic_test_ (Lookup missing is ok)...ok
        khash_test:34: basic_test_ (Get missing is ok)...ok
        khash_test:38: basic_test_ (Del missing is ok)...ok
        khash_test:42: basic_test_ (Stored a key)...ok
        khash_test:46: basic_test_ (Lookuped a key)...ok
        khash_test:50: basic_test_ (Retrieved a key)...ok
        khash_test:54: basic_test_ (Stored a key)...ok
        khash_test:58: basic_test_ (Correct size for hash)...ok
        khash_test:62: basic_test_ (Deleted a key)...ok
        khash_test:66: basic_test_ (Correct size after delete)...ok
        khash_test:70: basic_test_ (Cleared the hash)...ok
        khash_test:74: basic_test_ (Correct size after clear)...ok
        [done in 0.036 s]
      khash randomized test
        khash_test:105: randomized_test_ (State matches dict implementation)...ok
        [done in 0.003 s]
      khash vs dict
        khash_test:122: compare_dict_test_ (Dict's fetch is slower than of khash)...[0.194 s] ok
        khash_test:132: compare_dict_test_ (Dict's store is slower than of khash)...[0.629 s] ok
        [done in 0.833 s]
      khash itrators basics operations
        khash_test:159: basic_iterators_test_ (Got only kv pair as first element)...ok
        khash_test:163: basic_iterators_test_ (Only the one kv pair exists)...ok
        khash_test:167: basic_iterators_test_ (Fold works)...ok
        [done in 0.009 s]
      khash iterators multi-read test
        khash_test:192: multiread_iterators_test_ (Read the same exact key/val pairs)...ok
        [done in 0.003 s]
      khash iterators exipiration functions
        khash_test:215: expiration_iterators_test_ (put expires iterators)...ok
        khash_test:222: expiration_iterators_test_ (del expires iterators)...ok
        khash_test:229: expiration_iterators_test_ (clear expires iterators)...ok
        [done in 0.009 s]
      khash iterators no exipiration functions
        khash_test:253: no_expiration_iterators_test_ (to_list doesn't expire iterators)...ok
        khash_test:260: no_expiration_iterators_test_ (lookup doesn't expire iterators)...ok
        khash_test:267: no_expiration_iterators_test_ (get doesn't expire iterators)...ok
        khash_test:274: no_expiration_iterators_test_ (size doesn't expire iterators)...ok
        khash_test:283: no_expiration_iterators_test_ (iteration doesn't expire iterators)...ok
        [done in 0.015 s]
      [done in 1.916 s]
    module 'gen_term'
    =======================================================
      All 28 tests passed.
    ```
    
    If I remove it feels that tests are actually being run:
    
    ```
    rebar compile
    ==> couchdb-khash (compile)
    rebar eunit
    ==> couchdb-khash (eunit)
    test/khash_test.erl:86: Warning: erlang:now/0: Deprecated BIF. See the "Time and Time Correction in Erlang" chapter of the ERTS User's Guide for more information.
    Compiled test/khash_test.erl
    ======================== EUnit ========================
    module 'khash'
    module 'khash_test'
      khash_test:15: load_test_ (Loaded khash)...[0.002 s] ok
      khash basic operations
        khash_test:29: basic_test_ (Lookup missing is ok)...ok
        khash_test:33: basic_test_ (Get missing is ok)...ok
        khash_test:37: basic_test_ (Del missing is ok)...ok
        khash_test:41: basic_test_ (Stored a key)...ok
        khash_test:45: basic_test_ (Lookuped a key)...ok
        khash_test:49: basic_test_ (Retrieved a key)...ok
        khash_test:53: basic_test_ (Stored a key)...ok
        khash_test:57: basic_test_ (Correct size for hash)...ok
        khash_test:61: basic_test_ (Deleted a key)...ok
        khash_test:65: basic_test_ (Correct size after delete)...ok
        khash_test:69: basic_test_ (Cleared the hash)...ok
        khash_test:73: basic_test_ (Correct size after clear)...ok
        [done in 0.036 s]
      khash randomized test
        khash_test:104: randomized_test_ (State matches dict implementation)...[2.410 s] ok
        [done in 2.413 s]
      khash vs dict
        khash_test:121: compare_dict_test_ (Dict's fetch is slower than of khash)...test/khash_test.erl:124:<0.75.0>: Dict:     2223065
    test/khash_test.erl:125:<0.75.0>: KHash:    1673265
    [3.902 s] ok
        khash_test:131: compare_dict_test_ (Dict's store is slower than of khash)...test/khash_test.erl:134:<0.75.0>: Dict:      521395
    test/khash_test.erl:135:<0.75.0>: KHash:     144867
    [0.666 s] ok
        [done in 4.579 s]
      khash itrators basics operations
        khash_test:158: basic_iterators_test_ (Got only kv pair as first element)...ok
        khash_test:162: basic_iterators_test_ (Only the one kv pair exists)...ok
        khash_test:166: basic_iterators_test_ (Fold works)...ok
        [done in 0.009 s]
      khash iterators multi-read test
        khash_test:191: multiread_iterators_test_ (Read the same exact key/val pairs)...ok
        [done in 0.003 s]
      khash iterators exipiration functions
        khash_test:214: expiration_iterators_test_ (put expires iterators)...ok
        khash_test:221: expiration_iterators_test_ (del expires iterators)...ok
        khash_test:228: expiration_iterators_test_ (clear expires iterators)...ok
        [done in 0.009 s]
      khash iterators no exipiration functions
        khash_test:252: no_expiration_iterators_test_ (to_list doesn't expire iterators)...ok
        khash_test:259: no_expiration_iterators_test_ (lookup doesn't expire iterators)...ok
        khash_test:266: no_expiration_iterators_test_ (get doesn't expire iterators)...ok
        khash_test:273: no_expiration_iterators_test_ (size doesn't expire iterators)...ok
        khash_test:282: no_expiration_iterators_test_ (iteration doesn't expire iterators)...ok
        [done in 0.015 s]
      [done in 8.073 s]
    module 'gen_term'
    =======================================================
      All 28 tests passed.
    ```
    
    
    Thoughts?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---