Skip to content

🎨 Add program unit tests #7524

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

bisgaard-itis
Copy link
Contributor

@bisgaard-itis bisgaard-itis commented Apr 14, 2025

What do these changes do?

Related issue/s

How to test

Dev-ops checklist

@bisgaard-itis bisgaard-itis self-assigned this Apr 14, 2025
@bisgaard-itis bisgaard-itis added the a:apiserver api-server service label Apr 14, 2025
@bisgaard-itis bisgaard-itis added this to the Pauwel Kwak milestone Apr 14, 2025
@bisgaard-itis bisgaard-itis marked this pull request as ready for review April 14, 2025 14:16
Copy link

codecov bot commented Apr 14, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.51%. Comparing base (c5fe5bc) to head (2824f07).
Report is 9 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7524      +/-   ##
==========================================
+ Coverage   87.44%   87.51%   +0.07%     
==========================================
  Files        1740     1733       -7     
  Lines       67389    67199     -190     
  Branches     1143     1143              
==========================================
- Hits        58931    58812     -119     
+ Misses       8138     8067      -71     
  Partials      320      320              
Flag Coverage Δ
integrationtests 65.09% <ø> (-0.05%) ⬇️
unittests 86.70% <ø> (+0.06%) ⬆️
Components Coverage Δ
api ∅ <ø> (∅)
pkg_aws_library 93.91% <ø> (ø)
pkg_dask_task_models_library 97.09% <ø> (ø)
pkg_models_library 91.96% <ø> (ø)
pkg_notifications_library 85.26% <ø> (ø)
pkg_postgres_database 88.18% <ø> (ø)
pkg_service_integration 70.03% <ø> (ø)
pkg_service_library 72.66% <ø> (ø)
pkg_settings_library 90.79% <ø> (ø)
pkg_simcore_sdk 85.40% <ø> (ø)
agent 96.46% <ø> (ø)
api_server 90.65% <ø> (+0.63%) ⬆️
autoscaling 96.08% <ø> (ø)
catalog 92.52% <ø> (ø)
clusters_keeper 99.24% <ø> (ø)
dask_sidecar 91.29% <ø> (ø)
datcore_adapter 98.12% <ø> (ø)
director 76.78% <ø> (ø)
director_v2 91.30% <ø> (+0.02%) ⬆️
dynamic_scheduler 97.40% <ø> (ø)
dynamic_sidecar 90.11% <ø> (ø)
efs_guardian 89.79% <ø> (ø)
invitations 93.28% <ø> (ø)
payments 92.66% <ø> (ø)
resource_usage_tracker 89.23% <ø> (+0.10%) ⬆️
storage 87.59% <ø> (-0.26%) ⬇️
webclient ∅ <ø> (∅)
webserver 85.93% <ø> (+0.04%) ⬆️

Continue to review full report in Codecov by Sentry.

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

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link

Copy link
Member

@pcrespov pcrespov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thx

@@ -499,7 +499,7 @@ def _patch(href):
return data.status_href, data.result_href

return mocker.patch(
"simcore_service_api_server.services.webserver._get_lrt_urls",
"simcore_service_api_server.services_http.webserver._get_lrt_urls",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIP: to avoid these it is better if you import the module and then patch the object. It is more resistant to refactoring. Also add auto_spec=True to enhance validity of your mock

import simcore_service_api_server.services_http.webserver
mocker.patch.object(simcore_service_api_server.services_http.webserver,._get_lrt_urls", auto_spec=True, side_effect=_get_lrt_urls)

)
async def test_create_program_job(
client: AsyncClient,
mocked_webserver_rest_api_base,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Annotate all fixtures

@bisgaard-itis
Copy link
Contributor Author

These tests have been added here instead (using the new catalog client): #7541

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:apiserver api-server service
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants