8
8
###########################################################################
9
9
"""orm links tests for the export and import routines"""
10
10
11
+ import pytest
12
+
11
13
from aiida import orm
12
14
from aiida .common .links import LinkType
13
15
from aiida .orm .entities import EntityTypes
14
16
from aiida .tools .archive import ArchiveFormatSqlZip , create_archive , import_archive
15
17
from tests .tools .archive .utils import get_all_node_links
16
18
17
19
18
- def test_links_to_unknown_nodes (tmp_path , aiida_profile ):
20
+ def test_links_to_unknown_nodes (tmp_path , aiida_profile_clean ):
19
21
"""Test importing of nodes, that have links to unknown nodes."""
20
22
# store a node
21
23
node = orm .Data ()
@@ -46,7 +48,7 @@ def test_links_to_unknown_nodes(tmp_path, aiida_profile):
46
48
with ArchiveFormatSqlZip ().open (filename , 'r' ) as archive :
47
49
assert archive .querybuilder ().append (entity_type = 'link' ).count () == 1
48
50
49
- aiida_profile .reset_storage ()
51
+ aiida_profile_clean .reset_storage ()
50
52
51
53
# since the query builder only looks for links between known nodes,
52
54
# this should not import the erroneous link
@@ -262,7 +264,8 @@ def test_complex_workflow_graph_links(aiida_profile_clean, tmp_path, aiida_local
262
264
assert set (export_set ) == set (import_set )
263
265
264
266
265
- def test_complex_workflow_graph_export_sets (aiida_profile , tmp_path , aiida_localhost_factory ):
267
+ @pytest .mark .nightly
268
+ def test_complex_workflow_graph_export_sets (aiida_profile_clean , tmp_path , aiida_localhost_factory ):
266
269
"""Test ex-/import of individual nodes in complex graph"""
267
270
for export_conf in range (0 , 9 ):
268
271
_ , (export_node , export_target ) = construct_complex_graph (aiida_localhost_factory , export_conf )
@@ -272,7 +275,7 @@ def test_complex_workflow_graph_export_sets(aiida_profile, tmp_path, aiida_local
272
275
create_archive ([export_node ], filename = export_file , overwrite = True )
273
276
export_node_str = str (export_node )
274
277
275
- aiida_profile .reset_storage ()
278
+ aiida_profile_clean .reset_storage ()
276
279
277
280
import_archive (export_file )
278
281
@@ -296,7 +299,8 @@ def test_complex_workflow_graph_export_sets(aiida_profile, tmp_path, aiida_local
296
299
)
297
300
298
301
299
- def test_high_level_workflow_links (aiida_profile , tmp_path , aiida_localhost_factory ):
302
+ @pytest .mark .nightly
303
+ def test_high_level_workflow_links (aiida_profile_clean , tmp_path , aiida_localhost_factory ):
300
304
"""This test checks that all the needed links are correctly exported and imported.
301
305
INPUT_CALC, INPUT_WORK, CALL_CALC, CALL_WORK, CREATE, and RETURN
302
306
links connecting Data nodes and high-level Calculation and Workflow nodes:
@@ -318,7 +322,7 @@ def test_high_level_workflow_links(aiida_profile, tmp_path, aiida_localhost_fact
318
322
319
323
for calcs in high_level_calc_nodes :
320
324
for works in high_level_work_nodes :
321
- aiida_profile .reset_storage ()
325
+ aiida_profile_clean .reset_storage ()
322
326
323
327
graph_nodes , _ = construct_complex_graph (aiida_localhost_factory , calc_nodes = calcs , work_nodes = works )
324
328
@@ -350,7 +354,7 @@ def test_high_level_workflow_links(aiida_profile, tmp_path, aiida_localhost_fact
350
354
export_file = tmp_path .joinpath ('export.aiida' )
351
355
create_archive (graph_nodes , filename = export_file , overwrite = True )
352
356
353
- aiida_profile .reset_storage ()
357
+ aiida_profile_clean .reset_storage ()
354
358
355
359
import_archive (export_file )
356
360
import_links = get_all_node_links ()
@@ -450,7 +454,8 @@ def link_flags_export_helper(name, all_nodes, tmp_path, nodes_to_export, flags,
450
454
return ret
451
455
452
456
453
- def test_link_flags (aiida_profile , tmp_path , aiida_localhost_factory ):
457
+ @pytest .mark .nightly
458
+ def test_link_flags (aiida_profile_clean , tmp_path , aiida_localhost_factory ):
454
459
"""Verify all link follow flags are working as intended.
455
460
456
461
Graph (from ``construct_complex_graph()``)::
@@ -584,10 +589,10 @@ def test_link_flags(aiida_profile, tmp_path, aiida_localhost_factory):
584
589
),
585
590
)
586
591
587
- link_flags_import_helper (input_links_forward , aiida_profile .reset_storage )
588
- link_flags_import_helper (create_return_links_backward , aiida_profile .reset_storage )
589
- link_flags_import_helper (call_links_backward_calc1 , aiida_profile .reset_storage )
590
- link_flags_import_helper (call_links_backward_work2 , aiida_profile .reset_storage )
592
+ link_flags_import_helper (input_links_forward , aiida_profile_clean .reset_storage )
593
+ link_flags_import_helper (create_return_links_backward , aiida_profile_clean .reset_storage )
594
+ link_flags_import_helper (call_links_backward_calc1 , aiida_profile_clean .reset_storage )
595
+ link_flags_import_helper (call_links_backward_work2 , aiida_profile_clean .reset_storage )
591
596
592
597
593
598
def test_double_return_links_for_workflows (tmp_path , aiida_profile_clean ):
0 commit comments