SKA-ScienceDataProcessor / integration-prototype

SDP Integration Prototype
BSD 3-Clause "New" or "Revised" License
4 stars 7 forks source link

Updates/ec mc #79

Closed njthykkathu closed 5 years ago

njthykkathu commented 5 years ago

Description

Added a script that containers functions which queries the health of each service. Can query each service and return the health status Can query the health and return the service id and health status of all the services Can query the overall health status of all the services

JIRA task: TSK-2754

Testing instructions:

Install the latest skasip-docker-swarm module (==1.0.10):

pip install -U skasip-docker-swarm

Run the following command from the top level directory

./tools/run_tests.sh sip/execution_control/master_controller  

Types of changes

codecov[bot] commented 5 years ago

Codecov Report

Merging #79 into master will increase coverage by 0.36%. The diff coverage is 97.7%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #79      +/-   ##
==========================================
+ Coverage   86.07%   86.43%   +0.36%     
==========================================
  Files          59       61       +2     
  Lines        2671     2758      +87     
  Branches      221      227       +6     
==========================================
+ Hits         2299     2384      +85     
- Misses        321      322       +1     
- Partials       51       52       +1
Impacted Files Coverage Δ
...roller/tests/test_master_controller_healthcheck.py 100% <100%> (ø)
...master_controller/master_controller_healthcheck.py 94.73% <94.73%> (ø)

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 ab49fd9...e94d04e. Read the comment docs.

njthykkathu commented 5 years ago

looks good, although we should work on improving the tests at some point.

On my laptop when running the tests I managed to have them fail at least once, probably due to the sleep not being sufficient. Hopefully the CI is stable enough not to exhibit this issue at a later date!

One way to avoid the sleep might be use another mechanism in a while loop (direct use of the docker api or system calls to the CLI) to check the services have reached the desired state instead of using the sleep. Another thing to address in the tests is the cleanup of services if the tests fail. At the moment if an assert fails the test never reaches the command to clean up services. One way to solve this might be to use fixtures, another way might be to store the expected test outcome in a variable, clean up, then call pytest.fail() if the test condition was not as expected.

I agree to all these points. We should create tasks and put it in the backlog.