Skip to content

Conversation

@matusdrobuliak66
Copy link
Collaborator

@matusdrobuliak66 matusdrobuliak66 commented Feb 5, 2025

What do these changes do?

The consumer (Sim4Life) has unit tests running in its own CI. These unit tests use the Pact framework, which automatically generates a pact (contract) that defines the expected interactions with the provider (Osparc API Server). This contract is published to a Pact Broker container that we are hosting ourselves and is publicly available.

This PR introduces unit tests on the provider side. When these tests run, they automatically inform the Pact Broker of the last execution time and status. The Pact Broker URL will be added to the Batman slide/credentials page. These tests will be executed on each PR request.

Next steps: I have received four more contracts from the Sim4Life consumer, and I will add them.


Pact framework: https://docs.pact.io/pact_broker

Image

Related issue/s

How to test

Dev-ops checklist

@matusdrobuliak66 matusdrobuliak66 self-assigned this Feb 5, 2025
@matusdrobuliak66 matusdrobuliak66 added this to the Singularity milestone Feb 5, 2025
@matusdrobuliak66 matusdrobuliak66 added the a:apiserver api-server service label Feb 5, 2025
@codecov
Copy link

codecov bot commented Feb 5, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.20%. Comparing base (59bf9c3) to head (034063e).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7172      +/-   ##
==========================================
+ Coverage   87.14%   87.20%   +0.05%     
==========================================
  Files        1690     1683       -7     
  Lines       65625    65447     -178     
  Branches     1121     1121              
==========================================
- Hits        57192    57072     -120     
+ Misses       8113     8056      -57     
+ Partials      320      319       -1     
Flag Coverage Δ
integrationtests 65.41% <ø> (+0.02%) ⬆️
unittests 86.35% <100.00%> (+0.05%) ⬆️
Components Coverage Δ
api ∅ <ø> (∅)
pkg_aws_library 94.24% <ø> (ø)
pkg_dask_task_models_library 97.09% <ø> (ø)
pkg_models_library 91.57% <100.00%> (+<0.01%) ⬆️
pkg_notifications_library 84.57% <ø> (ø)
pkg_postgres_database 88.28% <ø> (ø)
pkg_service_integration 70.03% <ø> (ø)
pkg_service_library 72.77% <ø> (+0.05%) ⬆️
pkg_settings_library 90.61% <ø> (ø)
pkg_simcore_sdk 85.46% <ø> (ø)
agent 96.46% <ø> (ø)
api_server 90.68% <100.00%> (+0.02%) ⬆️
autoscaling 96.08% <ø> (ø)
catalog 91.73% <ø> (ø)
clusters_keeper 99.24% <ø> (ø)
dask_sidecar 91.25% <ø> (ø)
datcore_adapter 98.06% <ø> (ø)
director 76.59% <ø> (ø)
director_v2 91.30% <ø> (ø)
dynamic_scheduler 97.33% <ø> (ø)
dynamic_sidecar 89.74% <ø> (ø)
efs_guardian 90.25% <ø> (ø)
invitations 93.28% <ø> (ø)
osparc_gateway_server ∅ <ø> (∅)
payments 92.66% <ø> (ø)
resource_usage_tracker 89.11% <ø> (-0.11%) ⬇️
storage 84.47% <ø> (+0.28%) ⬆️
webclient ∅ <ø> (∅)
webserver 85.31% <ø> (+0.03%) ⬆️

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 59bf9c3...034063e. Read the comment docs.

@matusdrobuliak66 matusdrobuliak66 changed the title WIP: 🎨 introducing contract testing 🎨 introducing contract testing Feb 28, 2025
Copy link
Member

@sanderegg sanderegg left a comment

Choose a reason for hiding this comment

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

This looks pretty cool tool!
Please adjust the CI names and also the dependencies.

Copy link
Member

@mrnicegyu11 mrnicegyu11 left a comment

Choose a reason for hiding this comment

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

minors, thanks

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.

Nice work. Left some comments and suggestions .

Copy link
Contributor

@bisgaard-itis bisgaard-itis left a comment

Choose a reason for hiding this comment

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

Cool stuff. Someday you will have to explain me what exactly the advantage of the consumer driven contract testing is 😅, compared to using the openapi specs (which I guess is the provider driven 🤔).

Copy link
Contributor

@GitHK GitHK left a comment

Choose a reason for hiding this comment

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

waiting for other issues to be addressed.
Pleas take care into updating the javascript dependencies

Copy link
Member

@sanderegg sanderegg left a comment

Choose a reason for hiding this comment

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

Please check the CI workflow name and file name. Thanks!

@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 4, 2025

@matusdrobuliak66 matusdrobuliak66 enabled auto-merge (squash) March 4, 2025 09:51
@matusdrobuliak66 matusdrobuliak66 merged commit 7870cc8 into ITISFoundation:master Mar 4, 2025
92 of 95 checks passed
@matusdrobuliak66 matusdrobuliak66 mentioned this pull request Mar 6, 2025
63 tasks
mrnicegyu11 pushed a commit to mrnicegyu11/osparc-simcore that referenced this pull request Mar 26, 2025
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.

6 participants