Skip to content

Commit

Permalink
Use aiida_profile_clean for links nightly tests
Browse files Browse the repository at this point in the history
  • Loading branch information
unkcpz committed Jan 15, 2025
1 parent 81a3910 commit 2d3b125
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions tests/tools/archive/orm/test_links.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from tests.tools.archive.utils import get_all_node_links


def test_links_to_unknown_nodes(tmp_path, aiida_profile):
def test_links_to_unknown_nodes(tmp_path, aiida_profile_clean):
"""Test importing of nodes, that have links to unknown nodes."""
# store a node
node = orm.Data()
Expand Down Expand Up @@ -48,7 +48,7 @@ def test_links_to_unknown_nodes(tmp_path, aiida_profile):
with ArchiveFormatSqlZip().open(filename, 'r') as archive:
assert archive.querybuilder().append(entity_type='link').count() == 1

aiida_profile.reset_storage()
aiida_profile_clean.reset_storage()

# since the query builder only looks for links between known nodes,
# this should not import the erroneous link
Expand Down Expand Up @@ -265,7 +265,7 @@ def test_complex_workflow_graph_links(aiida_profile_clean, tmp_path, aiida_local


@pytest.mark.nightly
def test_complex_workflow_graph_export_sets(aiida_profile, tmp_path, aiida_localhost_factory):
def test_complex_workflow_graph_export_sets(aiida_profile_clean, tmp_path, aiida_localhost_factory):
"""Test ex-/import of individual nodes in complex graph"""
for export_conf in range(0, 9):
_, (export_node, export_target) = construct_complex_graph(aiida_localhost_factory, export_conf)
Expand All @@ -275,7 +275,7 @@ def test_complex_workflow_graph_export_sets(aiida_profile, tmp_path, aiida_local
create_archive([export_node], filename=export_file, overwrite=True)
export_node_str = str(export_node)

aiida_profile.reset_storage()
aiida_profile_clean.reset_storage()

import_archive(export_file)

Expand All @@ -300,7 +300,7 @@ def test_complex_workflow_graph_export_sets(aiida_profile, tmp_path, aiida_local


@pytest.mark.nightly
def test_high_level_workflow_links(aiida_profile, tmp_path, aiida_localhost_factory):
def test_high_level_workflow_links(aiida_profile_clean, tmp_path, aiida_localhost_factory):
"""This test checks that all the needed links are correctly exported and imported.
INPUT_CALC, INPUT_WORK, CALL_CALC, CALL_WORK, CREATE, and RETURN
links connecting Data nodes and high-level Calculation and Workflow nodes:
Expand All @@ -322,7 +322,7 @@ def test_high_level_workflow_links(aiida_profile, tmp_path, aiida_localhost_fact

for calcs in high_level_calc_nodes:
for works in high_level_work_nodes:
aiida_profile.reset_storage()
aiida_profile_clean.reset_storage()

graph_nodes, _ = construct_complex_graph(aiida_localhost_factory, calc_nodes=calcs, work_nodes=works)

Expand Down Expand Up @@ -354,7 +354,7 @@ def test_high_level_workflow_links(aiida_profile, tmp_path, aiida_localhost_fact
export_file = tmp_path.joinpath('export.aiida')
create_archive(graph_nodes, filename=export_file, overwrite=True)

aiida_profile.reset_storage()
aiida_profile_clean.reset_storage()

import_archive(export_file)
import_links = get_all_node_links()
Expand Down Expand Up @@ -455,7 +455,7 @@ def link_flags_export_helper(name, all_nodes, tmp_path, nodes_to_export, flags,


@pytest.mark.nightly
def test_link_flags(aiida_profile, tmp_path, aiida_localhost_factory):
def test_link_flags(aiida_profile_clean, tmp_path, aiida_localhost_factory):
"""Verify all link follow flags are working as intended.
Graph (from ``construct_complex_graph()``)::
Expand Down Expand Up @@ -589,10 +589,10 @@ def test_link_flags(aiida_profile, tmp_path, aiida_localhost_factory):
),
)

link_flags_import_helper(input_links_forward, aiida_profile.reset_storage)
link_flags_import_helper(create_return_links_backward, aiida_profile.reset_storage)
link_flags_import_helper(call_links_backward_calc1, aiida_profile.reset_storage)
link_flags_import_helper(call_links_backward_work2, aiida_profile.reset_storage)
link_flags_import_helper(input_links_forward, aiida_profile_clean.reset_storage)
link_flags_import_helper(create_return_links_backward, aiida_profile_clean.reset_storage)
link_flags_import_helper(call_links_backward_calc1, aiida_profile_clean.reset_storage)
link_flags_import_helper(call_links_backward_work2, aiida_profile_clean.reset_storage)


def test_double_return_links_for_workflows(tmp_path, aiida_profile_clean):
Expand Down

0 comments on commit 2d3b125

Please sign in to comment.