aiidateam / aiida-core

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

Tests: Fix `tests.orm.nodes.test_node:test_delete_through_backend` #6496

Closed sphuber closed 3 months ago

sphuber commented 3 months ago

Fixes #6436

The test was failing with a core.sqlite_dos storage plugin for the test profile. The problem is that the last assert was checking that the logs for data_two were deleted because data_two itself had been deleted. However, since it was deleted, the ORM instance can no longer be used either, which was causing an exception. Instead, its pk should be recorded before deleting the node, and the final check should just use the pk directly.

It is not quite clear why this test was not failing for the default core.psql_dos storage plugin that is used for tests. It should not be backend specific since both use SQLAlchemy for the ORM.

codecov[bot] commented 3 months ago

Codecov Report

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

Project coverage is 77.79%. Comparing base (ef60b66) to head (3e99afe). Report is 115 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #6496 +/- ## ========================================== + Coverage 77.51% 77.79% +0.29% ========================================== Files 560 561 +1 Lines 41444 41809 +365 ========================================== + Hits 32120 32522 +402 + Misses 9324 9287 -37 ```

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