From af66281ec332fbeb1ed13c48b427894d70768d40 Mon Sep 17 00:00:00 2001 From: Alexander Goscinski Date: Wed, 24 Jul 2024 11:49:13 +0200 Subject: [PATCH] add aiida profile creation to ci --- .github/workflows/ci.yaml | 2 ++ src/wcflow/cmdline.py | 2 +- tests/files/scripts/icon.py | 2 -- tests/test_wc_workflow.py | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 3a257c1..e4e14fc 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -42,10 +42,12 @@ jobs: run: | pip install --upgrade pip pip install hatch + pip install . # to get verdi - name: Run test suite env: PYTEST_ADDOPTS: "--durations=0" run: | + verdi presto hatch test --cover docs: diff --git a/src/wcflow/cmdline.py b/src/wcflow/cmdline.py index b26e750..065dc4d 100644 --- a/src/wcflow/cmdline.py +++ b/src/wcflow/cmdline.py @@ -1,6 +1,6 @@ import argparse -from aiida import load_profile +from aiida.manage.configuration import load_profile from wcflow import core, wc, workgraph diff --git a/tests/files/scripts/icon.py b/tests/files/scripts/icon.py index f5ec27b..d514a48 100755 --- a/tests/files/scripts/icon.py +++ b/tests/files/scripts/icon.py @@ -7,8 +7,6 @@ def main(): parser = argparse.ArgumentParser(description='A simple script with an optional restart argument.') parser.add_argument('icon_input', type=str, help='The icon input.') parser.add_argument('--restart', nargs='?', type=str, help='The icon restart file.') - #parser.add_argument('--restart', nargs='?', const='default', type=str, help='Initiate a restart operation with an optional string argument.') - args = parser.parse_args() diff --git a/tests/test_wc_workflow.py b/tests/test_wc_workflow.py index 18deaf2..1c2187a 100644 --- a/tests/test_wc_workflow.py +++ b/tests/test_wc_workflow.py @@ -1,6 +1,7 @@ from wcflow import wc from wcflow import core from wcflow.workgraph import AiidaWorkGraph +from aiida.manage.configuration import load_profile import pytest @pytest.fixture @@ -8,11 +9,10 @@ def small_config_path_str(): return "tests/files/configs/test_config_small.yaml" def test_small_wc_workflow(small_config_path_str): + load_profile() wc_workflow = wc.Workflow.from_yaml(small_config_path_str) core_workflow: core.Workflow = wc_workflow.to_core_workflow() - from aiida import load_profile - load_profile() aiida_workgraph = AiidaWorkGraph(core_workflow) result = aiida_workgraph.run() assert result.get('execution_count') == 0