Skip to content

Conversation

@pcrespov
Copy link
Member

@pcrespov pcrespov commented Jun 26, 2025

What do these changes do?

This PR refactors the pytest_simcore.helpers.webserver_* module by splitting it into two focused helper modules:

  • pytest_simcore.helpers.webserver_users: for setting up/tearing down user accounts (direct DB access).
  • pytest_simcore.helpers.webserver_login: for handling signed-in user setup/teardown.

This separation reduces interdependencies and fixture requirements, making test setup more modular and maintainable.

It also eliminates legacy dependencies on simcore_service_webserver.login._login_repository_legacy, which is deprecated.

NOTE: A new exit_stack fixture is introduced. It can be used to create unit-of-work contexts for test setup/teardown within the test.

Related issue/s

How to test

cd services/web/server
make install-dev
make test-dev-unit

Dev-ops

None

@pcrespov pcrespov self-assigned this Jun 26, 2025
@pcrespov pcrespov added a:webserver webserver's codebase. Assigning the area is particularly useful for bugs t:maintenance Some planned maintenance work labels Jun 26, 2025
@pcrespov pcrespov marked this pull request as ready for review June 26, 2025 08:26
@codecov
Copy link

codecov bot commented Jun 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.85%. Comparing base (b4006b9) to head (d0efde9).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7984      +/-   ##
==========================================
- Coverage   87.85%   83.85%   -4.01%     
==========================================
  Files        1850     1843       -7     
  Lines       71393    71203     -190     
  Branches     1254     1254              
==========================================
- Hits        62725    59706    -3019     
- Misses       8303    11132    +2829     
  Partials      365      365              
Flag Coverage Δ
integrationtests 64.25% <ø> (+0.02%) ⬆️
unittests 82.27% <ø> (-4.20%) ⬇️
Components Coverage Δ
api ∅ <ø> (∅)
pkg_aws_library 93.93% <ø> (ø)
pkg_celery_library 81.08% <ø> (ø)
pkg_dask_task_models_library 79.62% <ø> (ø)
pkg_models_library 93.28% <ø> (ø)
pkg_notifications_library 85.26% <ø> (ø)
pkg_postgres_database 88.19% <ø> (ø)
pkg_service_integration 69.92% <ø> (ø)
pkg_service_library 71.63% <ø> (ø)
pkg_settings_library 90.64% <ø> (ø)
pkg_simcore_sdk 85.05% <ø> (+0.05%) ⬆️
agent 96.29% <ø> (ø)
api_server 92.64% <ø> (ø)
autoscaling 96.03% <ø> (ø)
catalog 92.29% <ø> (ø)
clusters_keeper 99.13% <ø> (ø)
dask_sidecar 92.35% <ø> (ø)
datcore_adapter 97.94% <ø> (ø)
director 76.73% <ø> (ø)
director_v2 91.08% <ø> (+0.02%) ⬆️
dynamic_scheduler 96.69% <ø> (ø)
dynamic_sidecar 90.09% <ø> (ø)
efs_guardian 89.65% <ø> (ø)
invitations 93.60% <ø> (ø)
payments 92.57% <ø> (ø)
resource_usage_tracker 89.10% <ø> (+0.10%) ⬆️
storage 86.23% <ø> (-0.46%) ⬇️
webclient ∅ <ø> (∅)
webserver 73.73% <ø> (-13.90%) ⬇️

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 b4006b9...d0efde9. 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.

@pcrespov pcrespov enabled auto-merge (squash) June 26, 2025 11:53
@pcrespov
Copy link
Member Author

@mergify queue

@pcrespov pcrespov added the 🤖-automerge marks PR as ready to be merged for Mergify label Jun 26, 2025
@pcrespov pcrespov added this to the Engage milestone Jun 26, 2025
@mergify
Copy link
Contributor

mergify bot commented Jun 26, 2025

queue

🟠 Waiting for conditions to match

  • -closed [📌 queue requirement]
  • -conflict [📌 queue requirement]
  • -draft [📌 queue requirement]
  • any of: [📌 queue -> configuration change requirements]
    • -mergify-configuration-changed
    • check-success = Configuration changed
  • any of: [🔀 queue conditions]
    • all of: [📌 queue conditions of queue default]
      • #approved-reviews-by >= 2 [🛡 GitHub branch protection]
      • #approved-reviews-by>=2
      • #changes-requested-reviews-by = 0 [🛡 GitHub branch protection]
      • #changes-requested-reviews-by=0
      • #review-threads-unresolved = 0 [🛡 GitHub branch protection]
      • #review-threads-unresolved=0
      • -conflict
      • -draft
      • base=master
      • branch-protection-review-decision = APPROVED [🛡 GitHub branch protection]
      • label!=🤖-do-not-merge
      • label=🤖-automerge
      • any of: [🛡 GitHub branch protection]
        • check-skipped = deploy to dockerhub
        • check-neutral = deploy to dockerhub
        • check-success = deploy to dockerhub
      • any of: [🛡 GitHub branch protection]
        • check-success = system-tests
        • check-neutral = system-tests
        • check-skipped = system-tests
      • any of: [🛡 GitHub branch protection]
        • check-success = unit-tests
        • check-neutral = unit-tests
        • check-skipped = unit-tests
      • any of: [🛡 GitHub branch protection]
        • check-success = check OAS' are up to date
        • check-neutral = check OAS' are up to date
        • check-skipped = check OAS' are up to date
      • any of: [🛡 GitHub branch protection]
        • check-success = integration-tests
        • check-neutral = integration-tests
        • check-skipped = integration-tests
      • any of: [🛡 GitHub branch protection]
        • check-success = build-test-images (frontend) / build-test-images
        • check-neutral = build-test-images (frontend) / build-test-images
        • check-skipped = build-test-images (frontend) / build-test-images

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.

oh I guess I won't like it... I am currently also updating the tools and the pytest-asyncio which is a mess in the webserver. let's check tomorrow. but feel free to merge this anyway.

@sonarqubecloud
Copy link

@pcrespov pcrespov merged commit ca8acae into ITISFoundation:master Jun 26, 2025
93 of 97 checks passed
@matusdrobuliak66 matusdrobuliak66 mentioned this pull request Aug 5, 2025
88 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🤖-automerge marks PR as ready to be merged for Mergify a:webserver webserver's codebase. Assigning the area is particularly useful for bugs t:maintenance Some planned maintenance work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants