Skip to content

Commit

Permalink
🧪 TESTS: Update CI to python 3.7,3.8,3.9 (aiidaplugins#24)
Browse files Browse the repository at this point in the history
and also for different lammps versions
  • Loading branch information
chrisjsewell authored Apr 30, 2021
1 parent 5592b68 commit a349766
Show file tree
Hide file tree
Showing 12 changed files with 124 additions and 66 deletions.
28 changes: 16 additions & 12 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.7
python-version: 3.8
- uses: pre-commit/[email protected]

tests:
Expand All @@ -27,17 +27,21 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.6, 3.7]
# TODO 3.8 is not compatible with lammps==2019.06.05,
# but the 2020 version changes the test results (1 more trajectory step)
os: [ubuntu-latest]
backend: ['django']
include:
- python-version: 3.7
os: ubuntu-latest
lammps-version: "2019.06.05"
backend: django
- python-version: 3.7
lammps-version: "2019.06.05"
backend: sqlalchemy
- python-version: 3.8
lammps-version: "2020.12.24"
backend: django
- python-version: 3.9
lammps-version: "2020.12.24"
backend: django

runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest

services:
postgres:
Expand Down Expand Up @@ -69,7 +73,7 @@ jobs:
conda-channels: conda-forge

- name: install lammps
run: conda install -y lammps==2019.06.05
run: conda install -y lammps==${{ matrix.lammps-version }}

- name: Upgrade pip
run: |
Expand All @@ -89,7 +93,7 @@ jobs:
if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.7
uses: codecov/codecov-action@v1
with:
name: pytests-py3.7
name: pytests-lammps
flags: pytests
file: ./coverage.xml
fail_ci_if_error: true
Expand All @@ -102,10 +106,10 @@ jobs:
steps:
- name: Checkout source
uses: actions/checkout@v2
- name: Set up Python 3.7
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.7
python-version: 3.8
- name: Build package
run: |
pip install wheel
Expand Down
7 changes: 5 additions & 2 deletions aiida_lammps/tests/test_calculations.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,8 +354,10 @@ def test_md_process(db_test_app, get_potential_data, potential_type, data_regres
code = db_test_app.get_or_create_code(calc_plugin)
pot_data = get_potential_data(potential_type)
potential = DataFactory("lammps.potential")(type=pot_data.type, data=pot_data.data)
version = get_lammps_version(code)
version_year = version[-4:]
parameters = get_calc_parameters(
get_lammps_version(code), calc_plugin, potential.default_units, potential_type
version, calc_plugin, potential.default_units, potential_type
)
builder = code.get_builder()
builder._update(
Expand Down Expand Up @@ -386,7 +388,8 @@ def test_md_process(db_test_app, get_potential_data, potential_type, data_regres
),
"system_data": calc_node.outputs.system_data.attributes,
"trajectory_data": calc_node.outputs.trajectory_data.attributes,
}
},
basename=f"test_md_process-{potential_type}-{version_year}",
)


Expand Down
32 changes: 32 additions & 0 deletions aiida_lammps/tests/test_calculations/test_md_process-eam-2020.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
results:
distance_units: Angstroms
energy: -8.1
energy_units: eV
errors: []
parser_class: MdParser
time_units: picoseconds
timestep_picoseconds: 0.001
units_style: metal
system_data:
array|etotal:
- 101
array|step:
- 101
array|temp:
- 101
units_style: metal
trajectory_data:
aliases: null
compression_method: 8
elements:
- Fe
field_names:
- element
- x
- y
- z
number_atoms: 2
number_steps: 101
timestep_filename: timesteps.txt
traj_filename: trajectory.zip
zip_prefix: step-
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
results:
distance_units: Angstroms
energy: 0.1
energy_units: eV
errors: []
parser_class: MdParser
time_units: picoseconds
timestep_picoseconds: 0.001
units_style: metal
system_data:
array|etotal:
- 101
array|step:
- 101
array|temp:
- 101
units_style: metal
trajectory_data:
aliases: null
compression_method: 8
elements:
- Ar
field_names:
- element
- x
- y
- z
number_atoms: 2
number_steps: 101
timestep_filename: timesteps.txt
traj_filename: trajectory.zip
zip_prefix: step-
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
results:
distance_units: Angstroms
energy: -17.8
energy_units: eV
errors: []
parser_class: MdParser
time_units: picoseconds
timestep_picoseconds: 0.001
units_style: metal
system_data:
array|etotal:
- 101
array|step:
- 101
array|temp:
- 101
units_style: metal
trajectory_data:
aliases: null
compression_method: 8
elements:
- Ga
- N
field_names:
- element
- x
- y
- z
number_atoms: 4
number_steps: 101
timestep_filename: timesteps.txt
traj_filename: trajectory.zip
zip_prefix: step-
48 changes: 0 additions & 48 deletions aiida_lammps/tests/test_calculations/test_md_process_reaxff_.yml

This file was deleted.

4 changes: 3 additions & 1 deletion conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ def get_work_directory(config):
def pytest_report_header(config):
"""Add header information for pytest execution."""
return [
"LAMMPS Executable: {}".format(config.getoption("lammps_exec") or "lammps"),
"LAMMPS Executable: {}".format(
shutil.which(config.getoption("lammps_exec") or "lammps")
),
"LAMMPS Work Directory: {}".format(
config.getoption("lammps_workdir") or "<TEMP>"
),
Expand Down
2 changes: 1 addition & 1 deletion setup.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
"classifiers": [
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Topic :: Scientific/Engineering :: Chemistry",
"Topic :: Scientific/Engineering :: Physics",
"Framework :: AiiDA"
Expand Down
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[tox]
envlist = py{36,37,38}
envlist = py37

[testenv]
use_develop = true

[testenv:py{36,37,38}]
[testenv:py{37,38,39}]
extras = testing
deps =
black
Expand Down

0 comments on commit a349766

Please sign in to comment.