riotkit-org / infracheck

Incredibly elastic and lightweight health check endpoint to cover ANY CASE, including infrastructure as well as applications
https://infracheck.docs.riotkit.org
Apache License 2.0
19 stars 1 forks source link

Rewrite app/checks/disk-space to python, change the syntax #3

Closed p00rt closed 5 years ago

p00rt commented 5 years ago

Rewrite of disk-space health check. Uses sys.statvfs (unix system call) now, also the syntax has changed from using env variables to using argv as a means to get dir and required space.

codecov-io commented 5 years ago

Codecov Report

Merging #3 into master will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff           @@
##           master      #3   +/-   ##
======================================
  Coverage    80.1%   80.1%           
======================================
  Files           8       8           
  Lines         196     196           
  Branches       22      22           
======================================
  Hits          157     157           
  Misses         35      35           
  Partials        4       4
Flag Coverage Δ
#python 80.1% <ø> (ø) :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 76a9c65...3382409. Read the comment docs.

codecov-io commented 5 years ago

Codecov Report

Merging #3 into master will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff           @@
##           master      #3   +/-   ##
======================================
  Coverage    80.1%   80.1%           
======================================
  Files           8       8           
  Lines         196     196           
  Branches       22      22           
======================================
  Hits          157     157           
  Misses         35      35           
  Partials        4       4
Flag Coverage Δ
#python 80.1% <ø> (ø) :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 76a9c65...1bf5a6e. Read the comment docs.

blackandred commented 5 years ago

Thanks for the pull request. The test is failing because the mocking no longer works. You can rewrite the test also to Python if you would like to use Python unittest's mock.

p00rt commented 5 years ago

i'm pretty sure that the test is broken since it wants to assert that 4GB is enough when 4.5GB is the defined minimum. This commit fixes it and also makes check/disk-space work properly with mock values.

blackandred commented 5 years ago

Approved, one non-critical comment left. Can be merged, and the improvement can be applied with a next PR :wink: