Skip to content
Draft
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
26 changes: 26 additions & 0 deletions bin/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

python3 -m venv ENV

source ENV/bin/activate

pip install hublib
pip install jupyterlab
pip install testbook
pip install widgetsnbextension
pip install svgwrite
pip install pypng
pip install pytest
pip install scipy
pip install tensorflow
pip install keras
pip install pandas
pip install scikit-learn
pip install matplotlib
pip install ipywidgets
pip install pandas
jupyter nbextension enable --py widgetsnbextension

export ENVIRON_CONFIG_DIRS=","
export PATH=$PATH:$PWD
pytest test || exit 1
35 changes: 35 additions & 0 deletions bin/test/integration_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import pytest
import subprocess
import sys
import threading
import pandas as pd
import math

def exec_command(command, cwd=None):
process = subprocess.Popen(command,
stdout=subprocess.PIPE,
universal_newlines=True)
while True:
output = process.stdout.readline()
print(output.strip())
# Do something else
return_code = process.poll()
if return_code is not None:
print('RETURN CODE', return_code)
# Process has finished, read rest of the output
for output in process.stdout.readlines():
print(output.strip())
break


def test_example_one():
exec_command(['md_simulation_confined_ions', '-T', '0.001', '-Z', '3', '-p', '1', '-n', '-1', '-c', '.5', '-d', '0.474', '-a', '0.627', '-i', '0', '-S', '10000'], cwd="..")
df = pd.read_csv('outfiles/energy.dat', sep=r"\s+", header=None)
t = df.iat[-1, 6]
assert math.isclose(t, 2310.45, rel_tol=1e-1)