Skip to content
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

🔨 New pytest-simcore environment_config fixtures and utils_postgres helpers #5909

Conversation

pcrespov
Copy link
Member

@pcrespov pcrespov commented Jun 3, 2024

What do these changes do?

Here are some changes in pytest-simcore and servicelib that can be useful in many services. I have used them in some of the services as example and will do systematically with many more in different PRs

  • 🔨 new fixture docker_compose_service_environment_dict: replicates the env vars that the real services will encounter
    • resolves .env-devel and the environment section of a service_name. Detects e.g. missing env vars in .env-devel
    • used in payments as example (NOTE: recommended to build app_environment fixture in all services services)
  • 🔨 new helper pytest_simcore.helpers.utils_postgres.insert_and_get_row_lifespan context for a control lifespan of a new row.
  • ♻️ moved middleware to packages/service-library/src/servicelib/fastapi/timing_middleware.py from dat-core service

Related issue/s

How to test

in place

Dev-ops checklist

None

@pcrespov pcrespov self-assigned this Jun 3, 2024
@pcrespov pcrespov added this to the Leeroy Jenkins milestone Jun 3, 2024
Copy link

codecov bot commented Jun 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.8%. Comparing base (cafbf96) to head (f015145).
Report is 250 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #5909      +/-   ##
=========================================
- Coverage    84.5%   78.8%    -5.8%     
=========================================
  Files          10    1165    +1155     
  Lines         214   48699   +48485     
  Branches       25     821     +796     
=========================================
+ Hits          181   38403   +38222     
- Misses         23   10132   +10109     
- Partials       10     164     +154     
Flag Coverage Δ
integrationtests 58.9% <ø> (?)
unittests 78.7% <100.0%> (-5.8%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...imcore_service_datcore_adapter/api/module_setup.py 100.0% <100.0%> (ø)

... and 1147 files with indirect coverage changes

@pcrespov pcrespov added the t:maintenance Some planned maintenance work label Jun 3, 2024
@pcrespov pcrespov marked this pull request as ready for review June 3, 2024 17:20
@pcrespov pcrespov enabled auto-merge (squash) June 3, 2024 17:20
@pcrespov pcrespov force-pushed the mai/pytest-simcore-environment-configs branch from d8be837 to e46307a Compare June 4, 2024 08:44
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.

Very nice. I would move more of these pytest fixtures out to pytest-simcore. Just a suggestion...

Copy link
Contributor

@matusdrobuliak66 matusdrobuliak66 left a comment

Choose a reason for hiding this comment

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

Thanks a lot!

@pcrespov pcrespov force-pushed the mai/pytest-simcore-environment-configs branch from e46307a to f015145 Compare June 4, 2024 12:09
Copy link

sonarqubecloud bot commented Jun 4, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.2% Duplication on New Code

See analysis details on SonarCloud

@pcrespov pcrespov merged commit 5d4290a into ITISFoundation:master Jun 4, 2024
57 checks passed
@pcrespov pcrespov deleted the mai/pytest-simcore-environment-configs branch June 4, 2024 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t:maintenance Some planned maintenance work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants