Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 10 additions & 27 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: aiida-fleur

on: [push, pull_request]

env:
FORCE_COLOR: 1

jobs:

docs:
Expand All @@ -27,20 +30,11 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: 3.8

- name: Cache python dependencies
id: cache-pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: pip-docs-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
pip-docs-
cache: pip

- name: Install python dependencies
run: |
pip install -e .[docs]
reentry scan || true

- name: Build documentation
env:
Expand All @@ -57,19 +51,11 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Cache python dependencies
id: cache-pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: pip-pre-commit-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
pip-pre-commit-

- name: Set up Python 3.8
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: 3.9
cache: pip

- name: Install python dependencies
run: |
Expand Down Expand Up @@ -167,13 +153,10 @@ jobs:

- name: Install python dependencies
run: |
pip install --upgrade wheel setuptools
pip install git+https://github.com/aiidateam/aiida-testing.git@main
pip install --no-deps git+https://github.com/aiidateam/aiida-common-workflows.git@master
pip install .[testing,graphs]
pip install ${{ matrix.aiida.version }} ${{ matrix.masci-tools.version }}
pip install ${{ matrix.bokeh-version }} ${{ matrix.mpl-version }}
reentry scan || true
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You no longer test with aiida-core v1 so this is not needed.

pip install -e .[testing,graphs] \
${{ matrix.aiida.version }} ${{ matrix.masci-tools.version }} \
${{ matrix.bokeh-version }} ${{ matrix.mpl-version }}

- name: Run pytest
run: |
Expand Down
9 changes: 5 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,19 @@ graphs = [
"masci-tools[bokeh-plots]"
]
docs = [
"sphinx~=4.0",
"sphinx~=5.0",
"sphinx_rtd_theme",
"sphinx-click",
"myst-parser~=0.15.2"
"myst-parser==0.18.1"
]
testing = [
"pytest>=2.9",
"pytest-timeout",
"pytest-cov~=3.0", #For reading configuration from pyproject.toml
"pytest-cov~=3.0",
"pytest-mpl>=0.12",
"pgtest",
"pytest-regressions>=1.0"
"pytest-regressions>=1.0",
"aiida-test-cache==0.0.1",
]
pre-commit = [
"pre-commit>=2.6.0",
Expand Down
20 changes: 7 additions & 13 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@

CONFTEST_LOCATION = Path(__file__).parent.resolve()

# aiida_testing.mock_codes in development, not yet a stable dependency
# aiida-test-cache package is in development, not yet a stable dependency
# therefore we try to import it and if it fails we skip tests with it

RUN_REGRESSION_TESTS = True
try:
import aiida_testing
import aiida_test_cache
except ImportError:
print('AiiDA-testing not in path. Running without regression tests for Workchains and CalcJobs.')
print('aiida-test-cache package not installed. Running without regression tests for Workchains and CalcJobs.')
RUN_REGRESSION_TESTS = False

pytest_plugins = ['aiida.manage.tests.pytest_fixtures', 'masci_tools.testing.bokeh']
Expand All @@ -36,30 +36,24 @@ def pytest_configure(config):
We make them all lowercaps as convention
"""
config.addinivalue_line('markers',
'regression_test: test using the aiida-testing plugin for workflow regression tests')
'regression_test: test using the aiida-test-cache plugin for workflow regression tests')


def pytest_collection_modifyitems(session, config, items):
"""After test collection modify collection.

Skip regression test if aiida-tesing is not there
Skip regression tests if aiida-test-cache is not there
"""
import aiida

skip_regression = pytest.mark.skip(
reason='Workflow regression test is skipped, because aiida-testing is not available')
# aiida_version_skip = pytest.mark.skipif(
# aiida.get_version().startswith('2.'),
# reason='Workflow regression test is skipped, because aiida-testing is not compatible with AiiDA 2.0')
reason='Workflow regression test is skipped, because aiida-test-cache is not available')

regression_items = [item for item in items if 'regression_test' in item.keywords]
if not RUN_REGRESSION_TESTS:
for item in regression_items:
item.add_marker(skip_regression)

# for item in regression_items:
# item.add_marker(aiida_version_skip)


@pytest.fixture(scope='function')
def fixture_sandbox():
Expand Down Expand Up @@ -767,7 +761,7 @@ def load_cache(absolute_archive_path): # pylint: disable=redefined-outer-name

def _load_cache(archive_path):
#TODO: private import not good
from aiida_testing.archive_cache._utils import load_node_archive # pylint: disable=import-error
from aiida_test_cache.archive_cache._utils import load_node_archive # pylint: disable=import-error
full_archive_path = absolute_archive_path(archive_path, overwrite=False)
# check and load export
export_exists = os.path.isfile(full_archive_path)
Expand Down