diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 18325540da..4e7e85b31a 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -54,7 +54,7 @@ jobs: - 5001:22 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Install system dependencies run: sudo apt update && sudo apt install postgresql @@ -122,7 +122,7 @@ jobs: - 15672:15672 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Install aiida-core id: install diff --git a/tests/calculations/arithmetic/test_add.py b/tests/calculations/arithmetic/test_add.py index f5c8c3af95..925467eb0e 100644 --- a/tests/calculations/arithmetic/test_add.py +++ b/tests/calculations/arithmetic/test_add.py @@ -8,11 +8,14 @@ ########################################################################### """Tests for the `ArithmeticAddCalculation` plugin.""" +import pytest + from aiida import orm from aiida.calculations.arithmetic.add import ArithmeticAddCalculation from aiida.common import datastructures +@pytest.mark.requires_rmq def test_add_default(fixture_sandbox, aiida_localhost, generate_calc_job): """Test a default `ArithmeticAddCalculation`.""" inputs = { @@ -43,6 +46,7 @@ def test_add_default(fixture_sandbox, aiida_localhost, generate_calc_job): assert input_written == f"echo $(({inputs['x'].value} + {inputs['y'].value}))\n" +@pytest.mark.requires_rmq def test_add_custom_filenames(fixture_sandbox, aiida_localhost, generate_calc_job): """Test an `ArithmeticAddCalculation` with non-default input and output filenames.""" input_filename = 'custom.in' @@ -67,6 +71,7 @@ def test_add_custom_filenames(fixture_sandbox, aiida_localhost, generate_calc_jo assert calc_info.retrieve_list == [output_filename] +@pytest.mark.requires_rmq def test_sleep(fixture_sandbox, aiida_localhost, generate_calc_job): """Test the ``metadata.options.sleep`` input.""" sleep = 5 diff --git a/tests/calculations/test_stash.py b/tests/calculations/test_stash.py index 93e8d4dd98..364b0baf43 100644 --- a/tests/calculations/test_stash.py +++ b/tests/calculations/test_stash.py @@ -23,6 +23,7 @@ from aiida.plugins import CalculationFactory +@pytest.mark.requires_rmq @pytest.mark.parametrize( 'operation_type,entry_point_name', [ @@ -214,6 +215,7 @@ def create_unstash_source_node(): generate_calc_job(fixture_sandbox, 'core.unstash', unstash_input) +@pytest.mark.requires_rmq @pytest.mark.parametrize('unstash_target_mode', [UnstashTargetMode.NewRemoteData, UnstashTargetMode.OriginalPlace]) def test_submit_custom_code(fixture_sandbox, aiida_localhost, generate_calc_job, tmp_path, unstash_target_mode): """Test the full functionality of the `StashCalculation` and `UnstashCalculation` with a custom code submission.""" @@ -367,6 +369,7 @@ def test_submit_custom_code(fixture_sandbox, aiida_localhost, generate_calc_job, @pytest.mark.usefixtures('aiida_profile_clean') +@pytest.mark.requires_rmq @pytest.mark.parametrize( 'unstash_target_mode', [UnstashTargetMode.OriginalPlace.value, UnstashTargetMode.NewRemoteData.value] ) diff --git a/tests/calculations/test_templatereplacer.py b/tests/calculations/test_templatereplacer.py index ea55609b8c..cad048debc 100644 --- a/tests/calculations/test_templatereplacer.py +++ b/tests/calculations/test_templatereplacer.py @@ -10,10 +10,13 @@ import io +import pytest + from aiida import orm from aiida.common import datastructures +@pytest.mark.requires_rmq def test_base_template(fixture_sandbox, aiida_localhost, generate_calc_job): """Test a base template that emulates the arithmetic add.""" entry_point_name = 'core.templatereplacer' @@ -54,6 +57,7 @@ def test_base_template(fixture_sandbox, aiida_localhost, generate_calc_job): assert input_written == f"echo $(({inputs['parameters']['x']} + {inputs['parameters']['y']}))" +@pytest.mark.requires_rmq def test_file_usage(fixture_sandbox, aiida_localhost, generate_calc_job): """Test a base template that uses two files.""" file1_node = orm.SinglefileData(io.BytesIO(b'Content of file 1')) diff --git a/tests/calculations/test_transfer.py b/tests/calculations/test_transfer.py index 5d6a80f334..3fc43649b8 100644 --- a/tests/calculations/test_transfer.py +++ b/tests/calculations/test_transfer.py @@ -10,10 +10,13 @@ import os +import pytest + from aiida import orm from aiida.common import datastructures +@pytest.mark.requires_rmq def test_get_transfer(fixture_sandbox, aiida_localhost, generate_calc_job, tmp_path): """Test a default `TransferCalculation`.""" file1 = tmp_path / 'file1.txt' @@ -61,6 +64,7 @@ def test_get_transfer(fixture_sandbox, aiida_localhost, generate_calc_job, tmp_p assert sorted(calc_info.retrieve_list) == sorted(retrieve_list) +@pytest.mark.requires_rmq def test_put_transfer(fixture_sandbox, aiida_localhost, generate_calc_job, tmp_path): """Test a default `TransferCalculation`.""" file1 = tmp_path / 'file1.txt' @@ -193,6 +197,7 @@ def test_validate_transfer_inputs(aiida_localhost, tmp_path): assert result == expected +@pytest.mark.requires_rmq def test_integration_transfer(aiida_localhost, tmp_path): """Test a default `TransferCalculation`.""" from aiida.calculations.transfer import TransferCalculation diff --git a/tests/cmdline/commands/test_data.py b/tests/cmdline/commands/test_data.py index 041f893241..28f33c40a5 100644 --- a/tests/cmdline/commands/test_data.py +++ b/tests/cmdline/commands/test_data.py @@ -233,6 +233,7 @@ def test_arrayshow(self): assert res.exit_code == 0, 'The command did not finish correctly' +@pytest.mark.requires_rmq class TestVerdiDataBands(DummyVerdiDataListable): """Testing verdi data core.bands.""" diff --git a/tests/cmdline/commands/test_run.py b/tests/cmdline/commands/test_run.py index 3ad3d69099..4ad0111d75 100644 --- a/tests/cmdline/commands/test_run.py +++ b/tests/cmdline/commands/test_run.py @@ -11,6 +11,8 @@ import tempfile import textwrap +import pytest + from aiida.cmdline.commands import cmd_run from aiida.common.log import override_log_level @@ -18,6 +20,7 @@ class TestVerdiRun: """Tests for `verdi run`.""" + @pytest.mark.requires_rmq def test_run_workfunction(self, run_cli_command): """Regression test for #2165 @@ -156,6 +159,7 @@ def test_no_autogroup(self, run_cli_command): all_auto_groups = queryb.all() assert len(all_auto_groups) == 0, 'There should be no autogroup generated' + @pytest.mark.requires_rmq def test_autogroup_filter_class(self, run_cli_command): """Check if the autogroup is properly generated but filtered classes are skipped.""" from aiida.orm import AutoGroup, Node, QueryBuilder, load_node diff --git a/tests/engine/processes/calcjobs/test_calc_job.py b/tests/engine/processes/calcjobs/test_calc_job.py index fda1b99e81..f8c861c3a7 100644 --- a/tests/engine/processes/calcjobs/test_calc_job.py +++ b/tests/engine/processes/calcjobs/test_calc_job.py @@ -57,6 +57,7 @@ def _factory(**kwargs): return _factory +@pytest.mark.requires_rmq class DummyCalcJob(CalcJob): """`DummyCalcJob` implementation to test the calcinfo with container code.""" @@ -80,6 +81,7 @@ def prepare_for_submission(self, folder): return calcinfo +@pytest.mark.requires_rmq class FileCalcJob(CalcJob): """Example `CalcJob` implementation to test the `provenance_exclude_list` functionality. @@ -117,6 +119,7 @@ def prepare_for_submission(self, folder): return calcinfo +@pytest.mark.requires_rmq class MultiCodesCalcJob(CalcJob): """`MultiCodesCalcJob` implementation to test the calcinfo with multiple codes set. @@ -247,6 +250,7 @@ def define(cls, spec): assert len(job_tmpl['codes_info'][0]['prepend_cmdline_params']) == expected +@pytest.mark.requires_rmq @pytest.mark.usefixtures('chdir_tmp_path') @pytest.mark.parametrize('parallel_run', [True, False]) def test_multi_codes_run_parallel(aiida_code_installed, file_regression, parallel_run): @@ -275,6 +279,7 @@ def test_multi_codes_run_parallel(aiida_code_installed, file_regression, paralle file_regression.check(content, extension='.sh') +@pytest.mark.requires_rmq @pytest.mark.usefixtures('chdir_tmp_path') @pytest.mark.parametrize('computer_use_double_quotes', [True, False]) def test_computer_double_quotes( @@ -306,6 +311,7 @@ def test_computer_double_quotes( file_regression.check(content, extension='.sh') +@pytest.mark.requires_rmq @pytest.mark.usefixtures('chdir_tmp_path') @pytest.mark.parametrize('code_use_double_quotes', [True, False]) def test_code_double_quotes(aiida_localhost, file_regression, code_use_double_quotes): @@ -332,6 +338,7 @@ def test_code_double_quotes(aiida_localhost, file_regression, code_use_double_qu file_regression.check(content, extension='.sh') +@pytest.mark.requires_rmq @pytest.mark.usefixtures('chdir_tmp_path') def test_containerized_code(file_regression, aiida_localhost): """Test the :class:`~aiida.orm.nodes.data.code.containerized.ContainerizedCode`.""" @@ -364,6 +371,7 @@ def test_containerized_code(file_regression, aiida_localhost): file_regression.check(content, extension='.sh') +@pytest.mark.requires_rmq @pytest.mark.usefixtures('chdir_tmp_path') def test_containerized_code_wrap_cmdline_params(file_regression, aiida_localhost): """Test :class:`~aiida.orm.nodes.data.code.containerized.ContainerizedCode` with ``wrap_cmdline_params = True``.""" @@ -397,6 +405,7 @@ def test_containerized_code_wrap_cmdline_params(file_regression, aiida_localhost file_regression.check(content, extension='.sh') +@pytest.mark.requires_rmq @pytest.mark.usefixtures('chdir_tmp_path') def test_containerized_code_withmpi_true(file_regression, aiida_localhost): """Test the :class:`~aiida.orm.nodes.data.code.containerized.ContainerizedCode` with ``withmpi=True``.""" @@ -429,6 +438,7 @@ def test_containerized_code_withmpi_true(file_regression, aiida_localhost): file_regression.check(content, extension='.sh') +@pytest.mark.requires_rmq @pytest.mark.usefixtures('chdir_tmp_path') def test_portable_code(tmp_path, aiida_localhost): """Test run container code""" @@ -474,6 +484,7 @@ def test_portable_code(tmp_path, aiida_localhost): assert subsubcontent == 'sub dummy' +@pytest.mark.requires_rmq class TestCalcJob: """Test for the `CalcJob` process sub class.""" @@ -844,6 +855,7 @@ def _generate_process(inputs=None): return _generate_process +@pytest.mark.requires_rmq @pytest.mark.usefixtures('override_logging') def test_parse_insufficient_data(generate_process): """Test the scheduler output parsing logic in `CalcJob.parse`. @@ -874,6 +886,7 @@ def test_parse_insufficient_data(generate_process): assert log in logs +@pytest.mark.requires_rmq @pytest.mark.usefixtures('override_logging') def test_parse_non_zero_retval(generate_process): """Test the scheduler output parsing logic in `CalcJob.parse`. @@ -893,6 +906,7 @@ def test_parse_non_zero_retval(generate_process): assert 'could not parse scheduler output: return value of `detailed_job_info` is non-zero' in logs +@pytest.mark.requires_rmq @pytest.mark.usefixtures('override_logging') def test_parse_not_implemented(generate_process): """Test the scheduler output parsing logic in `CalcJob.parse`. @@ -924,6 +938,7 @@ def test_parse_not_implemented(generate_process): assert log in logs +@pytest.mark.requires_rmq @pytest.mark.usefixtures('override_logging') def test_parse_scheduler_excepted(generate_process, monkeypatch): """Test the scheduler output parsing logic in `CalcJob.parse`. @@ -961,6 +976,7 @@ def raise_exception(*args, **kwargs): assert log in logs +@pytest.mark.requires_rmq @pytest.mark.parametrize( ('exit_status_scheduler', 'exit_status_retrieved', 'final'), ( @@ -1030,6 +1046,7 @@ def parse_retrieved_output(_, __): assert result.status == final +@pytest.mark.requires_rmq def test_additional_retrieve_list(generate_process, fixture_sandbox): """Test the ``additional_retrieve_list`` option.""" process = generate_process() @@ -1325,6 +1342,7 @@ def _parse_submit_output(self, *args): assert node.exit_status == 418 +@pytest.mark.requires_rmq def test_restart_after_daemon_reset(get_calcjob_builder, daemon_client, submit_and_await): """Test that a job can be restarted when it is launched and the daemon is restarted. diff --git a/tests/engine/processes/workchains/test_restart.py b/tests/engine/processes/workchains/test_restart.py index 28662e5e81..bf870292d7 100644 --- a/tests/engine/processes/workchains/test_restart.py +++ b/tests/engine/processes/workchains/test_restart.py @@ -94,6 +94,7 @@ def test_get_process_handlers_by_priority(generate_work_chain, inputs, prioritie ] +@pytest.mark.requires_rmq def test_excepted_process(generate_work_chain, generate_calculation_node): """Test that the workchain aborts if the sub process was excepted.""" process = generate_work_chain(SomeWorkChain, {}) @@ -102,6 +103,7 @@ def test_excepted_process(generate_work_chain, generate_calculation_node): assert process.inspect_process() == engine.BaseRestartWorkChain.exit_codes.ERROR_SUB_PROCESS_EXCEPTED +@pytest.mark.requires_rmq def test_killed_process(generate_work_chain, generate_calculation_node): """Test that the workchain aborts if the sub process was killed.""" process = generate_work_chain(SomeWorkChain, {}) @@ -110,6 +112,7 @@ def test_killed_process(generate_work_chain, generate_calculation_node): assert process.inspect_process() == engine.BaseRestartWorkChain.exit_codes.ERROR_SUB_PROCESS_KILLED +@pytest.mark.requires_rmq def test_unhandled_failure(generate_work_chain, generate_calculation_node): """Test the unhandled failure mechanism. @@ -128,6 +131,7 @@ def test_unhandled_failure(generate_work_chain, generate_calculation_node): ) +@pytest.mark.requires_rmq def test_unhandled_reset_after_success(generate_work_chain, generate_calculation_node): """Test `ctx.unhandled_failure` is reset to `False` in `inspect_process` after a successful process.""" process = generate_work_chain(SomeWorkChain, {}) @@ -141,6 +145,7 @@ def test_unhandled_reset_after_success(generate_work_chain, generate_calculation assert process.ctx.unhandled_failure is False +@pytest.mark.requires_rmq def test_unhandled_reset_after_handled(generate_work_chain, generate_calculation_node): """Test `ctx.unhandled_failure` is reset to `False` in `inspect_process` after a handled failed process.""" process = generate_work_chain(SomeWorkChain, {}) @@ -161,6 +166,7 @@ def test_unhandled_reset_after_handled(generate_work_chain, generate_calculation assert process.ctx.unhandled_failure is False +@pytest.mark.requires_rmq def test_run_process(generate_work_chain, generate_calculation_node, monkeypatch): """Test the `run_process` method.""" @@ -228,12 +234,14 @@ def setup(self): self.ctx.inputs.parameters = self.ctx.inputs.parameters.get_dict() +@pytest.mark.requires_rmq def test_results(): results, node = engine.launch.run_get_node(CustomBaseRestartWorkChain) assert results['sub'].result.value == 1 assert node.exit_status == 11 +@pytest.mark.requires_rmq def test_wrap_bare_dict_inputs(): """Test that ``BaseRestartWorkChain._wrap_bare_dict_inputs`` method works properly. diff --git a/tests/engine/processes/workchains/test_utils.py b/tests/engine/processes/workchains/test_utils.py index 9aa3678fad..4397c50828 100644 --- a/tests/engine/processes/workchains/test_utils.py +++ b/tests/engine/processes/workchains/test_utils.py @@ -19,6 +19,7 @@ ArithmeticAddCalculation = CalculationFactory('core.arithmetic.add') +@pytest.mark.requires_rmq class TestRegisterProcessHandler: """Tests for the `process_handler` decorator.""" diff --git a/tests/engine/test_calcfunctions.py b/tests/engine/test_calcfunctions.py index 7cb3859f18..98c53aefa4 100644 --- a/tests/engine/test_calcfunctions.py +++ b/tests/engine/test_calcfunctions.py @@ -37,6 +37,7 @@ def execution_counter_calcfunction(data): return Int(data.value + 1) +@pytest.mark.requires_rmq class TestCalcFunction: """Tests for calcfunctions. diff --git a/tests/engine/test_futures.py b/tests/engine/test_futures.py index 73a44fef71..b8ba78aa8f 100644 --- a/tests/engine/test_futures.py +++ b/tests/engine/test_futures.py @@ -17,12 +17,12 @@ from tests.utils import processes as test_processes +@pytest.mark.requires_rmq class TestWf: """Test process futures.""" TIMEOUT = 5.0 # seconds - @pytest.mark.requires_rmq def test_calculation_future_broadcasts(self): """Test calculation future broadcasts.""" manager = get_manager() diff --git a/tests/engine/test_launch.py b/tests/engine/test_launch.py index b5dd2f56f7..6aba82cdcc 100644 --- a/tests/engine/test_launch.py +++ b/tests/engine/test_launch.py @@ -131,6 +131,7 @@ def test_await_processes(aiida_code_installed, caplog): assert 'out of 1 processes terminated.' in caplog.records[0].message +@pytest.mark.requires_rmq class TestLaunchers: """Class to test process launchers.""" @@ -209,6 +210,7 @@ def test_submit_store_provenance_false(self): launch.submit(AddWorkChain, term_a=self.term_a, term_b=self.term_b, metadata={'store_provenance': False}) +@pytest.mark.requires_rmq class TestLaunchersDryRun: """Test the launchers when performing a dry-run.""" @@ -231,7 +233,6 @@ def init_profile(self, aiida_localhost): except Exception: pass - @pytest.mark.requires_rmq def test_launchers_dry_run(self): """All launchers should work with `dry_run=True`, even `submit` which forwards to `run`.""" inputs = { @@ -258,7 +259,6 @@ def test_launchers_dry_run(self): node = launch.submit(ArithmeticAddCalculation, **inputs) assert isinstance(node, orm.CalcJobNode) - @pytest.mark.requires_rmq def test_launchers_dry_run_no_provenance(self): """Test the launchers in `dry_run` mode with `store_provenance=False`.""" inputs = { diff --git a/tests/engine/test_persistence.py b/tests/engine/test_persistence.py index eb978749a6..7ca9908376 100644 --- a/tests/engine/test_persistence.py +++ b/tests/engine/test_persistence.py @@ -16,6 +16,7 @@ from tests.utils.processes import DummyProcess +@pytest.mark.requires_rmq class TestProcess: """Test the basic saving and loading of process states.""" @@ -38,6 +39,7 @@ def test_save_load(self): assert loaded_process.state == plumpy.ProcessState.FINISHED +@pytest.mark.requires_rmq class TestAiiDAPersister: """Test AiiDAPersister.""" diff --git a/tests/engine/test_process.py b/tests/engine/test_process.py index f72fc5ed8c..1fce019442 100644 --- a/tests/engine/test_process.py +++ b/tests/engine/test_process.py @@ -36,6 +36,7 @@ def define(cls, spec): spec.input('some.name.space.a', valid_type=orm.Int) +@pytest.mark.requires_rmq class TestProcessNamespace: """Test process namespace""" @@ -93,6 +94,7 @@ def on_stop(self): assert self._thread_id is threading.current_thread().ident +@pytest.mark.requires_rmq class TestProcess: """Test AiiDA process.""" diff --git a/tests/engine/test_run.py b/tests/engine/test_run.py index c7b08a5218..fd4fd5ddfa 100644 --- a/tests/engine/test_run.py +++ b/tests/engine/test_run.py @@ -8,11 +8,14 @@ ########################################################################### """Tests for the `run` functions.""" +import pytest + from aiida.engine import run, run_get_node from aiida.orm import Int, ProcessNode, Str from tests.utils.processes import DummyProcess +@pytest.mark.requires_rmq class TestRun: """Tests for the `run` functions.""" diff --git a/tests/engine/test_work_chain.py b/tests/engine/test_work_chain.py index 453103bbf8..4306d18591 100644 --- a/tests/engine/test_work_chain.py +++ b/tests/engine/test_work_chain.py @@ -223,6 +223,7 @@ def success(self): self.out(self.OUTPUT_LABEL, Int(self.OUTPUT_VALUE).store()) +@pytest.mark.requires_rmq class TestExitStatus: """This class should test the various ways that one can exit from the outline flow of a WorkChain, other than it running it all the way through. Currently this can be done directly in the outline by calling the `return_` @@ -302,6 +303,7 @@ def step2(self): self.ctx.s2 = True +@pytest.mark.requires_rmq class TestContext: def test_attributes(self): wc = IfTest() @@ -322,6 +324,7 @@ def test_dict(self): wc.ctx['new_attr'] +@pytest.mark.requires_rmq class TestWorkchain: @pytest.fixture(autouse=True) def init_profile(self): @@ -1096,6 +1099,7 @@ def test_member_calcfunction_daemon(self, entry_points, daemon_client, submit_an assert node.outputs.out_static == 3 +@pytest.mark.requires_rmq class TestWorkChainAbort: """Test the functionality to abort a workchain""" @@ -1166,6 +1170,7 @@ async def run_async(): assert process.node.is_killed is True +@pytest.mark.requires_rmq class TestWorkChainAbortChildren: """Test the functionality to abort a workchain and verify that children are also aborted appropriately @@ -1220,7 +1225,6 @@ def test_simple_run(self): assert process.node.is_excepted is True assert process.node.is_killed is False - @pytest.mark.requires_rmq def test_simple_kill_through_process(self): """Run the workchain for one step and then kill it. This should have the workchain and its children end up in the KILLED state. @@ -1251,6 +1255,7 @@ async def run_async(): assert process.node.is_killed is True +@pytest.mark.requires_rmq class TestImmutableInputWorkchain: """Test that inputs cannot be modified""" @@ -1344,6 +1349,7 @@ def do_test(self): assert self.inputs.test == self.inputs.reference +@pytest.mark.requires_rmq class TestSerializeWorkChain: """Test workchains with serialized input / output.""" @@ -1461,6 +1467,7 @@ def do_run(self): self.out('c', self.inputs.c) +@pytest.mark.requires_rmq class TestWorkChainExpose: """Test the expose inputs / outputs functionality""" @@ -1556,6 +1563,7 @@ def define(cls, spec): assert input_namespace['b'].help == 'An integer argument.' +@pytest.mark.requires_rmq class TestWorkChainMisc: class PointlessWorkChain(WorkChain): @classmethod @@ -1590,6 +1598,7 @@ def test_global_submit_raises(self): launch.run(TestWorkChainMisc.IllegalSubmitWorkChain) +@pytest.mark.requires_rmq class TestDefaultUniqueness: """Test that default inputs of exposed nodes will get unique UUIDS.""" diff --git a/tests/engine/test_workfunctions.py b/tests/engine/test_workfunctions.py index ae071c614c..b84438ac6a 100644 --- a/tests/engine/test_workfunctions.py +++ b/tests/engine/test_workfunctions.py @@ -16,6 +16,7 @@ from aiida.orm import CalcFunctionNode, Int, WorkFunctionNode +@pytest.mark.requires_rmq class TestWorkFunction: """Tests for workfunctions. diff --git a/tests/orm/test_querybuilder.py b/tests/orm/test_querybuilder.py index 9f70cabd28..8754d13d30 100644 --- a/tests/orm/test_querybuilder.py +++ b/tests/orm/test_querybuilder.py @@ -125,6 +125,7 @@ def test_get_group_type_filter(self): # Tracked in issue #4281 @pytest.mark.flaky(reruns=2) + @pytest.mark.requires_rmq @pytest.mark.usefixtures('aiida_profile_clean') def test_process_query(self): """Test querying for a process class.""" diff --git a/tests/parsers/test_parser.py b/tests/parsers/test_parser.py index eaf64ed380..e4b6af5be9 100644 --- a/tests/parsers/test_parser.py +++ b/tests/parsers/test_parser.py @@ -111,6 +111,7 @@ def test_parser_get_outputs_for_parsing(self): assert 'output' in outputs_for_parsing assert outputs_for_parsing['output'].uuid == output.uuid + @pytest.mark.requires_rmq def test_parse_from_node(self): """Test that the `parse_from_node` returns a tuple of the parsed output nodes and a calculation node. @@ -143,6 +144,7 @@ def test_parse_from_node(self): # Verify that the `retrieved_temporary_folder` keyword can be passed, there is no validation though result, calcfunction = ArithmeticAddParser.parse_from_node(node, retrieved_temporary_folder='/some/path') + @pytest.mark.requires_rmq def test_parse_from_node_output_validation(self): """Test that the ``parse_from_node`` properly validates attached outputs. diff --git a/tests/test_dataclasses.py b/tests/test_dataclasses.py index ab1dce91e4..df0a43c195 100644 --- a/tests/test_dataclasses.py +++ b/tests/test_dataclasses.py @@ -205,6 +205,7 @@ def test_change_cifdata_file(self): @skip_ase @skip_pycifrw + @pytest.mark.requires_rmq @pytest.mark.filterwarnings('ignore:Cannot determine chemical composition from CIF:UserWarning:pymatgen.io') def test_get_structure(self): """Test `CifData.get_structure`.""" @@ -243,6 +244,7 @@ def test_get_structure(self): @skip_ase @skip_pycifrw + @pytest.mark.requires_rmq def test_ase_primitive_and_conventional_cells_ase(self): """Checking the number of atoms per primitive/conventional cell returned by ASE ase.io.read() method. Test input is @@ -285,6 +287,7 @@ def test_ase_primitive_and_conventional_cells_ase(self): @skip_ase @skip_pycifrw @skip_pymatgen + @pytest.mark.requires_rmq @pytest.mark.filterwarnings('ignore:Cannot determine chemical composition from CIF:UserWarning:pymatgen.io') def test_ase_primitive_and_conventional_cells_pymatgen(self): """Checking the number of atoms per primitive/conventional cell @@ -545,6 +548,7 @@ def test_attached_hydrogens(self): @skip_ase @skip_pycifrw @skip_spglib + @pytest.mark.requires_rmq def test_refine(self): """Test case for refinement (space group determination) for a CifData object. @@ -1595,6 +1599,7 @@ def test_get_formula_unknown(self): @skip_ase @skip_pycifrw + @pytest.mark.requires_rmq def test_get_cif(self): """Tests the conversion to CifData""" import re @@ -2873,6 +2878,7 @@ def test_creation(self): # Step 66 does not exist n.get_index_from_stepid(66) + @pytest.mark.requires_rmq def test_conversion_to_structure(self): """Check the methods to export a given time step to a StructureData node.""" # Create a node with two arrays diff --git a/tests/tools/archive/orm/test_calculations.py b/tests/tools/archive/orm/test_calculations.py index 2a01da1d85..0f1c3bc63a 100644 --- a/tests/tools/archive/orm/test_calculations.py +++ b/tests/tools/archive/orm/test_calculations.py @@ -17,6 +17,7 @@ from aiida.tools.archive import create_archive, import_archive +@pytest.mark.requires_rmq def test_calcfunction(tmp_path, aiida_profile): """Test @calcfunction""" aiida_profile.reset_storage() diff --git a/tests/workflows/arithmetic/test_add_multiply.py b/tests/workflows/arithmetic/test_add_multiply.py index dd099ff381..1de06ff369 100644 --- a/tests/workflows/arithmetic/test_add_multiply.py +++ b/tests/workflows/arithmetic/test_add_multiply.py @@ -8,6 +8,8 @@ ########################################################################### """Tests for the `aiida.workflows.arithmetic.add_multiply` work function.""" +import pytest + from aiida.orm import Int from aiida.plugins import WorkflowFactory from aiida.workflows.arithmetic.add_multiply import add_multiply @@ -19,6 +21,7 @@ def test_factory(): assert loaded.is_process_function +@pytest.mark.requires_rmq def test_run(): """Test running the work function.""" x = Int(1)