Skip to content

Commit 8074ee4

Browse files
committed
#277 fix/clean tests, improve containerization
1 parent 50dfeb7 commit 8074ee4

58 files changed

Lines changed: 72 additions & 8732 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.dockerignore

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,24 @@ org.geppetto.frontend.jupyter
22
pygeppetto
33
.vscode
44
.ipynb_checkpoints
5-
netpyne_ui/geppetto
5+
66
*.egg-info
77
notebook.ipynb
88
.git
9-
netpyne
9+
1010
Dockerfile
1111
Dockerfile_base
1212
Dockerfile_dev
13-
webapp/node_modules
13+
node_modules
1414
webapp/build
1515
webapp/geppetto-client
1616
workspace
17-
tests
17+
.idea
1818
k8s
19-
src
20-
x86_64
19+
/src
20+
x86_64
21+
app.log
22+
/.pytest_cache
23+
.jupyter-config
24+
**/*.pyc
25+
**/__pycache__

Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,7 @@ RUN python install.py ${BUILD_ARGS}
2828

2929
WORKDIR ${INSTALLATION_FOLDER}
3030

31+
RUN pip install -r requirements-test.txt
32+
RUN pip install -e .
33+
RUN pytest tests/backend
3134
CMD /bin/bash -c "jupyter notebook --NotebookApp.default_url=/geppetto --NotebookApp.token='' --library=netpyne_ui --NotebookApp.disable_check_xsrf=True"

netpyne_ui/constants.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,16 @@
44
NETPYNE_WORKDIR = 'workspace'
55

66
ALLOWED_EXTENSIONS = ["py", "zip", "gz", ".tar.gz", "pdf", "txt", "xls", "png", "jpeg", "hoc"]
7+
HERE = os.path.dirname(os.path.abspath(__file__))
8+
ROOT = os.path.dirname(HERE)
9+
UPLOAD_FOLDER_PATH = os.path.join(ROOT, NETPYNE_WORKDIR, UPLOAD_FOLDER_NAME)
10+
NETPYNE_WORKDIR_PATH = os.path.join(ROOT, NETPYNE_WORKDIR)
711

8-
UPLOAD_FOLDER_PATH = os.path.join(os.getcwd(), NETPYNE_WORKDIR, UPLOAD_FOLDER_NAME)
9-
NETPYNE_WORKDIR_PATH = os.path.join(os.getcwd(), NETPYNE_WORKDIR)
12+
if not os.path.exists(NETPYNE_WORKDIR_PATH):
13+
NETPYNE_WORKDIR_PATH = os.path.join(os.getcwd(), NETPYNE_WORKDIR)
14+
15+
if not os.path.exists(NETPYNE_WORKDIR_PATH):
16+
raise Exception(f"Workdir path {NETPYNE_WORKDIR_PATH} does not exist")
1017

1118
if not os.path.exists(UPLOAD_FOLDER_PATH):
1219
os.makedirs(UPLOAD_FOLDER_PATH)

netpyne_ui/netpyne_geppetto.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@
2626
from netpyne_ui.constants import NETPYNE_WORKDIR_PATH, NUM_CONN_LIMIT
2727
from netpyne_ui.mod_utils import compileModMechFiles
2828

29+
2930
os.chdir(NETPYNE_WORKDIR_PATH)
3031

31-
neuron.nrn_dll_loaded.append("/home/user/NetPyNE-UI/workspace/mod") # Avoids to load workspace modfiles twice
32+
neuron.nrn_dll_loaded.append(os.path.join(NETPYNE_WORKDIR_PATH, 'mod')) # Avoids to load workspace modfiles twice
3233

3334
class NetPyNEGeppetto:
3435

0 commit comments

Comments
 (0)