From 8ae66fb66a4fdc876b9f429a09072f41c4ed48bd Mon Sep 17 00:00:00 2001 From: Jusong Yu Date: Thu, 9 Jan 2025 19:58:01 +0100 Subject: [PATCH 1/3] Timeout for single pytest to 240s (#6692) In #6674 I set timeout to 60s, but 60s for some tests are too short. There is an issue open to discuss whether we need to move those to nightly, see #6526 for more discussion. --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index a0c39cc5f6..32894eb4ac 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -387,7 +387,7 @@ minversion = '7.0' testpaths = [ 'tests' ] -timeout = 60 +timeout = 240 xfail_strict = true [tool.ruff] From a3ccec96d894ea7ce79dee4c14914ce4ebb869c6 Mon Sep 17 00:00:00 2001 From: Karl Liu Date: Tue, 17 Dec 2024 16:23:54 +0100 Subject: [PATCH 2/3] CI: Add matrix testing for both SQLite and PostgreSQL database backends Updates the GitHub Actions CI workflows ci-code.yml to include testing for both SQLite and PostgreSQL database backends. This will also increase the testing coverage over SQLite specific codebase. --- .github/workflows/ci-code.yml | 7 +++++-- docs/source/reference/command_line.rst | 2 +- tests/cmdline/commands/test_rabbitmq.py | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci-code.yml b/.github/workflows/ci-code.yml index 0f08f4ec0a..2dff454067 100644 --- a/.github/workflows/ci-code.yml +++ b/.github/workflows/ci-code.yml @@ -27,6 +27,10 @@ jobs: fail-fast: false matrix: python-version: ['3.9', '3.12'] + database-backend: [psql] + include: + - python-version: '3.9' + database-backend: sqlite services: postgres: @@ -79,7 +83,7 @@ jobs: run: | ${{ matrix.python-version == '3.9' && 'unset CI' || '' }} ${{ matrix.python-version == '3.9' && 'VIRTUAL_ENV=$PWD/.venv' || '' }} - pytest -n auto --db-backend psql -m 'not nightly' tests/ ${{ matrix.python-version == '3.9' && '--cov aiida' || '' }} + pytest -n auto --db-backend ${{ matrix.database-backend }} -m 'not nightly' tests/ ${{ matrix.python-version == '3.9' && '--cov aiida' || '' }} - name: Upload coverage report if: matrix.python-version == 3.9 && github.repository == 'aiidateam/aiida-core' @@ -90,7 +94,6 @@ jobs: file: ./coverage.xml fail_ci_if_error: false # don't fail job, if coverage upload fails - tests-presto: runs-on: ubuntu-latest diff --git a/docs/source/reference/command_line.rst b/docs/source/reference/command_line.rst index 1e8370e5e8..2b749fd3ae 100644 --- a/docs/source/reference/command_line.rst +++ b/docs/source/reference/command_line.rst @@ -451,7 +451,7 @@ Below is a list with all available subcommands. --broker-host HOSTNAME Hostname for the message broker. [default: 127.0.0.1] --broker-port INTEGER Port for the message broker. [default: 5672] --broker-virtual-host TEXT Name of the virtual host for the message broker without - leading forward slash. + leading forward slash. [default: ""] --repository DIRECTORY Absolute path to the file repository. --test-profile Designate the profile to be used for running the test suite only. diff --git a/tests/cmdline/commands/test_rabbitmq.py b/tests/cmdline/commands/test_rabbitmq.py index 8bb443cfe2..78d2d7ce73 100644 --- a/tests/cmdline/commands/test_rabbitmq.py +++ b/tests/cmdline/commands/test_rabbitmq.py @@ -69,7 +69,7 @@ def test_tasks_revive_without_daemon(run_cli_command): assert run_cli_command(cmd_rabbitmq.cmd_tasks_revive, raises=True) -@pytest.mark.usefixtures('started_daemon_client') +@pytest.mark.usefixtures('aiida_profile_clean') def test_revive(run_cli_command, monkeypatch, aiida_code_installed, submit_and_await): """Test ``tasks revive``.""" code = aiida_code_installed(default_calc_job_plugin='core.arithmetic.add', filepath_executable='/bin/bash') From 3f5e2c132554e58c868660b3ee874661925366ca Mon Sep 17 00:00:00 2001 From: Jusong Yu Date: Thu, 9 Jan 2025 15:35:50 +0100 Subject: [PATCH 3/3] Clean profile in orm/test_codes.py::test_input_code --- tests/tools/archive/orm/test_codes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/tools/archive/orm/test_codes.py b/tests/tools/archive/orm/test_codes.py index 27ae5f7882..5edc7e2fc7 100644 --- a/tests/tools/archive/orm/test_codes.py +++ b/tests/tools/archive/orm/test_codes.py @@ -35,7 +35,7 @@ def test_that_solo_code_is_exported_correctly(aiida_profile, tmp_path, aiida_loc assert orm.load_node(code_uuid).label == code_label -def test_input_code(aiida_profile, tmp_path, aiida_localhost): +def test_input_code(aiida_profile_clean, tmp_path, aiida_localhost): """This test checks that when a calculation is exported then the corresponding code is also exported. It also checks that the links are also in place after the import. @@ -59,7 +59,7 @@ def test_input_code(aiida_profile, tmp_path, aiida_localhost): export_file = tmp_path / 'export.aiida' create_archive([calc], filename=export_file) - aiida_profile.reset_storage() + aiida_profile_clean.reset_storage() import_archive(export_file)