Cloud-CV / EvalAI

:cloud: :rocket: :bar_chart: :chart_with_upwards_trend: Evaluating state of the art in AI
https://eval.ai
Other
1.77k stars 787 forks source link

Low code coverage #4058

Open Suryansh5545 opened 1 year ago

Suryansh5545 commented 1 year ago

We have a Current cove coverage of around 67% which is quite low. we should aim to increase the coverage upto 90%. Below are the specfic functions and areas of code which remain uncovered and are causing low coverage.

Base: utils.py

encode_data
decode_data
send_email
get_url_from_hostname
get_or_create_sqs_queue

Challenge: aws_utils.py

register_task_def_by_challenge_pk
create_service_by_challenge_pk
update_service_by_challenge_pk
delete_service_by_challenge_pk
service_manager
start_workers
stop_workers
scale_workers
delete_workers

admin.py

start_selected_workers
scale_selected_workers
restart_selected_workers
delete_selected_workers

admin_filters.py

lookups
queryset

Jobs: utils

is_url_valid
get_file_from_url

Jobs: aws_utils.py

generate_aws_eks_bearer_token

tasks.py

download_file_and_publish_submission_message

admin.py

make_submission_private
change_submission_status_to_cancel

Additionally, I've noticed that some files under the "Scripts/worker" directory have a code coverage of 0%. It would be beneficial to address this and include appropriate tests for these files as well:

Scripts/worker - remote_submission_worker.py

download_and_extract_zip_file
load_challenge
extract_challenge_data
process_submission_callback
process_submission_message
extract_submission_data
read_file_content
run_submission

Scripts/worker - submission_worker.py

extract_challenge_data
load_challenge
run_submission
process_add_challenge_message

Scripts/worker - worker_utils.py: (0% coverage)

Scripts/worker - rl_submission_worker.py: (0% coverage)

AlvaroJoseLopes commented 8 months ago

Hey @Suryansh5545, I would like to contribute towards better test coverage. And also I believe that's a good starting point to contribute =)

I was thinking about starting to write some unit tests for Jobs:utils. Specially is_valid_url, sounds like a pretty much standalone method and a good starting point. Do you have any other suggestions on where to start?

I would appreciate any guidance on how to set up the dev environment for this (maybe I missed it in the docs). I noticed that there isn't any test for Jobs:utils, so I also would appreciate any other information to get started, like how to properly structure the test suite and libs to use.