aiidateam / aiida-core

The official repository for the AiiDA code
https://aiida-core.readthedocs.io
Other
436 stars 191 forks source link

Refactoring: use tmp path fixture to mock remote and local for transport plugins #6627

Open unkcpz opened 4 days ago

unkcpz commented 4 days ago

These are changes required by https://github.com/aiidateam/aiida-core/pull/6620, and some changes are overlap with changes in #6626. The changes are focus on following two purposes:

The change make every test has its own tmp folder therefore can run independent.

codecov[bot] commented 4 days ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 77.88%. Comparing base (ef60b66) to head (3b79faf). Report is 137 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #6627 +/- ## ========================================== + Coverage 77.51% 77.88% +0.38% ========================================== Files 560 567 +7 Lines 41444 42149 +705 ========================================== + Hits 32120 32824 +704 - Misses 9324 9325 +1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.


🚨 Try these New Features:

unkcpz commented 1 day ago

When running tests, I got a lot resource not clean warnings which may indicate some resource leak:

tests/transports/test_all_plugins.py::test_copy[core.local]
  /home/jyu/venv/aiida-core-dev/lib/python3.12/site-packages/psycopg/_connection_base.py:146: ResourceWarning: connection <psycopg.Connection [IDLE] (host=localhost port=46513 user=guest database=01029ab2-f1cd-4c66-a7f1-a405af5e5324) at 0x775bc419b920> was deleted while still open. Please use
 'with' or '.close()' to close the connection
    warn(

This require some investigation.

unkcpz commented 6 hours ago

This PR require the change in https://github.com/aiidateam/aiida-core/pull/6639 to not fail the mypy.