mchlvl / starlette-zipkin

Zipkin client for asgi. Compatible with Starlette Framework and Jaeger tracing server
10 stars 5 forks source link

30 tests are soft complaning #33

Closed mardiros closed 2 years ago

mardiros commented 2 years ago

Here is a second pass of the tests where we add unit tests of the middleware.

some tests does not override the transport and the await middleware.tracer.close() is used at the end of the tests. (it could be improved by using a pytest fixture actually.)

The tests test_dispatch_trace_reuse_tracer is written to ensure the tracer is reused.

I also update the code to use new_trace instead of raising 500 errors if the call contains invalid zipkin headers ( a trace without a span for instance )

codecov-commenter commented 2 years ago

Codecov Report

Merging #33 (a371694) into master (7719133) will increase coverage by 3.55%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #33      +/-   ##
==========================================
+ Coverage   86.75%   90.31%   +3.55%     
==========================================
  Files           8        8              
  Lines         287      289       +2     
==========================================
+ Hits          249      261      +12     
+ Misses         38       28      -10     
Impacted Files Coverage Δ
starlette_zipkin/middleware.py 91.74% <100.00%> (+9.50%) :arrow_up:

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 7719133...a371694. Read the comment docs.

mardiros commented 2 years ago

@mchlvl

If you are ok with this pull request, I can merge it.

mchlvl commented 2 years ago

Looks good!