TritonDataCenter / node-artedi

a library for measuring fish
2 stars 4 forks source link

package.json claims v0.10.48 support, but tests fail with no method 'log10' #20

Open cburroughs opened 5 years ago

cburroughs commented 5 years ago

I'm unsure if the right answer is to 'fix' a bug, or drop v0.10.48 support

 $ node --version
v0.10.48
$ make test
TAP=1 ./node_modules/.bin/tape test/*.test.js
TAP version 13
# getValue tests
ok 1 default counter should start at zero
ok 2 default counter should be incremented
ok 3 should be truthy
ok 4 child label get value
ok 5 get value from a gauge
ok 6 error on nonexistent gauge
ok 7 error name checks out
# parent/child tests
ok 8 basic full name
ok 9 metric registered
ok 10 duplicate collector with same name
ok 11 get collector by name
# trim functionality tests
ok 12 left- and right-trim
ok 13 left- and right-trim of multiple labels
# hash tests
ok 14 consistent hashing with unordered objects
# label tests
ok 15 increment w/ static labels from Collector and Counter
ok 16 default counter with getValue
ok 17 increment w/ dynamic label and static labels
ok 18 increment w/ label from Collector
ok 19 increment with empty label structure
ok 20 numeric label values, multiple labels
# absolute gauge tests
ok 21 basic absolute gauge set value
ok 22 basic absolute gauge set value to zero
ok 23 basic absolute gauge set value to negative float
ok 24 set gauge value to a string
# counter serialization tests
ok 25 error present for invalid serialization format
ok 26 no metrics returned with serialization error
ok 27 no error for no metrics
ok 28 no metrics, only comments
ok 29 no error for two labels
ok 30 two label increment
ok 31 no error for reversed labels
ok 32 reversed label add
ok 33 no error for default counter
ok 34 default counter
# histogram serialization tests
ok 35 no error for no metrics
ok 36 no labels or data points
ok 37 no error for single label
ok 38 single label
ok 39 no error for collector labels
ok 40 Collector labels and no Histogram labels
ok 41 no error for inherited labels
ok 42 inherited Histogram and Collector labels
ok 43 no error for dynamic and static labels
ok 44 dynamic labels, and static labels from Histogram and Collector
ok 45 no error for copying bucket values
ok 46 initial values copied from low-order buckets to high-order buckets
# odd value tests
ok 47 add zero to counter
ok 48 histogram tracks values less than one
ok 49 histogram observes zero value
ok 50 invalid collector name (invalid chars)
ok 51 invalid collector name (space)
ok 52 invalid collector help (numeric)
ok 53 invalid collector help (object)
# basic trigger tests
ok 54 collector object present
ok 55 collector object correct
ok 56 counter object is valid
ok 57 no error from triggered metrics
ok 58 trigger function called
# default bucket tests
ok 59 default buckets for histogram with no buckets opt
# non-monotonic buckets
ok 60 non-monotonic buckets should not be allowed
# histogram buckets incremented
ok 61 no error for copying bucket values
ok 62 observe(2) incremented all subsequent buckets
ok 63 no error for copying bucket values
ok 64 observe(0.5) incremented all subsequent buckets
# gauge expiry tests
ok 65 initial gauge set value
ok 66 initial gauge set value
ok 67 initial gauge set value
ok 68 initial expiryGauge2 set value
ok 69 nonExpiryGauge value not reset
ok 70 initial expiryGauge1 set value
# linearBuckets

/home/jcsb/src/j/mc/node-artedi/lib/buckets.js:19
        decimals = Math.max(Math.abs(Math.floor(Math.log10(value))) + 1, 4);
                                                     ^
TypeError: Object #<Object> has no method 'log10'
    at fixDecimals (/home/jcsb/src/j/mc/node-artedi/lib/buckets.js:19:54)
    at linearBuckets (/home/jcsb/src/j/mc/node-artedi/lib/buckets.js:42:22)
    at simpleTest (/home/jcsb/src/j/mc/node-artedi/test/buckets.test.js:14:35)
    at Test.<anonymous> (/home/jcsb/src/j/mc/node-artedi/test/buckets.test.js:22:5)
    at Test.bound [as _cb] (/home/jcsb/src/j/mc/node-artedi/node_modules/tape/lib/test.js:66:32)
    at Test.run (/home/jcsb/src/j/mc/node-artedi/node_modules/tape/lib/test.js:85:10)
    at Test.bound [as run] (/home/jcsb/src/j/mc/node-artedi/node_modules/tape/lib/test.js:66:32)
    at Object.next [as _onImmediate] (/home/jcsb/src/j/mc/node-artedi/node_modules/tape/lib/results.js:71:15)
    at processImmediate [as _immediateCallback] (timers.js:363:15)
make: *** [Makefile:57: test] Error 8
KodyKantor commented 5 years ago

Thanks. Yeah, I think we should probably just drop 0.10.48 support.