FundingCircle / jackdaw

A Clojure library for the Apache Kafka distributed streaming platform.
https://fundingcircle.github.io/jackdaw/
BSD 3-Clause "New" or "Revised" License
369 stars 80 forks source link

Only numbers should be num-coercable #203

Closed gphilipp closed 5 years ago

gphilipp commented 5 years ago

If you have a union type like ["long" "string"], the avro serde would fail to serialise a string which contains a numerical value, eg: "123". I added a test case for that. The fix simply checks if the passed value to the num-coercable? function is actually a number.

codecov[bot] commented 5 years ago

Codecov Report

Merging #203 into master will increase coverage by 1.27%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #203      +/-   ##
=========================================
+ Coverage   79.52%   80.8%   +1.27%     
=========================================
  Files          41      39       -2     
  Lines        2530    2365     -165     
  Branches      151     149       -2     
=========================================
- Hits         2012    1911     -101     
+ Misses        367     305      -62     
+ Partials      151     149       -2
Impacted Files Coverage Δ
src/jackdaw/serdes/avro.clj 87.92% <100%> (+0.03%) :arrow_up:
src/jackdaw/serdes/edn.clj 80.76% <0%> (-19.24%) :arrow_down:
src/jackdaw/test/commands.clj 86.95% <0%> (-13.05%) :arrow_down:
src/jackdaw/test/fixtures.clj 55.7% <0%> (-11.18%) :arrow_down:
src/jackdaw/admin.clj 83.48% <0%> (-5.51%) :arrow_down:
src/jackdaw/streams/interop.clj 78.68% <0%> (-1.6%) :arrow_down:
src/jackdaw/client.clj 78.51% <0%> (-1.22%) :arrow_down:
src/jackdaw/test.clj 77.77% <0%> (-1.02%) :arrow_down:
src/jackdaw/streams.clj 81.96% <0%> (-0.3%) :arrow_down:
src/jackdaw/test/serde.clj 94.44% <0%> (ø) :arrow_up:
... and 10 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 2301271...eede5cc. Read the comment docs.