Skip to content

[CI] fixing tests #162

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Aug 20, 2020
Merged
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
8 changes: 4 additions & 4 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
# In this step, this action saves a list of existing images,
# the cache is created without them in the post run.
# It also restores the cache if it exists.
- uses: satackey/action-docker-layer-caching@v0.0.5
- uses: satackey/action-docker-layer-caching@v0.0.7
- name: build the image
run: docker build . --file Dockerfile -t nipype_tutorial:latest

Expand All @@ -27,7 +27,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: satackey/action-docker-layer-caching@v0.0.5
- uses: satackey/action-docker-layer-caching@v0.0.7
- name: run test 1
run: docker run --rm nipype_tutorial:latest python /home/neuro/nipype_tutorial/test_notebooks.py 1

Expand All @@ -36,7 +36,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: satackey/action-docker-layer-caching@v0.0.5
- uses: satackey/action-docker-layer-caching@v0.0.7
- name: run test 2
run: docker run --rm nipype_tutorial:latest python /home/neuro/nipype_tutorial/test_notebooks.py 2

Expand All @@ -45,6 +45,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: satackey/action-docker-layer-caching@v0.0.5
- uses: satackey/action-docker-layer-caching@v0.0.7
- name: run test 3
run: docker run --rm nipype_tutorial:latest python /home/neuro/nipype_tutorial/test_notebooks.py 3
21 changes: 14 additions & 7 deletions notebooks/advanced_create_interfaces.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1214,7 +1214,7 @@
"from scipy.io import savemat\n",
"\n",
"# 1. save the image in matlab format as tmp_image.mat\n",
"tmp_image = 'tmp_image'\n",
"tmp_image = 'tmp_image.mat'\n",
"data = nb.load(in_file).get_data()\n",
"savemat(tmp_image, {b'data': data}, do_compression=False)"
]
Expand Down Expand Up @@ -1298,7 +1298,7 @@
"\n",
" def _run_interface(self, runtime): \n",
" # Save the image in matlab format as tmp_image.mat\n",
" tmp_image = 'tmp_image'\n",
" tmp_image = 'tmp_image.mat'\n",
" data = nb.load(self.inputs.in_file).get_data()\n",
" savemat(tmp_image, {b'data': data}, do_compression=False)\n",
" \n",
Expand Down Expand Up @@ -1374,7 +1374,7 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"solution2": "hidden",
"solution2": "shown",
"solution2_first": true
},
"outputs": [],
Expand All @@ -1386,7 +1386,7 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"solution2": "hidden"
"solution2": "shown"
},
"outputs": [],
"source": [
Expand All @@ -1411,7 +1411,7 @@
"\n",
" def _run_interface(self, runtime): \n",
" # Save the image in matlab format as tmp_image.mat\n",
" tmp_image = 'tmp_image'\n",
" tmp_image = 'tmp_image.mat'\n",
" data = nb.load(self.inputs.in_file).get_data()\n",
" savemat(tmp_image, {b'data': data}, do_compression=False)\n",
" \n",
Expand Down Expand Up @@ -1495,11 +1495,18 @@
"source": [
"!cat volume.txt"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python [default]",
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
Expand All @@ -1513,7 +1520,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.5"
"version": "3.7.8"
}
},
"nbformat": 4,
Expand Down
14 changes: 10 additions & 4 deletions notebooks/handson_analysis.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -998,8 +998,11 @@
"outputs": [],
"source": [
"plot_glass_brain('/output/datasink_handson/normalized/sub-07/wess_0008.nii',\n",
" output_file=\"/output/datasink_handson/normalized/sub-07/f-contr_activation.png\",\n",
" colorbar=True, display_mode='lyrz', black_bg=True, threshold=25,\n",
" title='subject 7 - F-contrast: Activation');"
" title='subject 7 - F-contrast: Activation');\n",
"\n",
"Image(filename='/output/datasink_handson/normalized/sub-07/f-contr_activation.png')"
]
},
{
Expand All @@ -1009,8 +1012,11 @@
"outputs": [],
"source": [
"plot_glass_brain('/output/datasink_handson/normalized/sub-07/wess_0009.nii',\n",
" output_file=\"/output/datasink_handson/normalized/sub-07/f-contr_differences.png\",\n",
" colorbar=True, display_mode='lyrz', black_bg=True, threshold=25,\n",
" title='subject 7 - F-contrast: Differences');"
" title='subject 7 - F-contrast: Differences');\n",
"\n",
"Image(filename='/output/datasink_handson/normalized/sub-07/f-contr_differences.png')"
]
},
{
Expand Down Expand Up @@ -1648,7 +1654,7 @@
"metadata": {
"anaconda-cloud": {},
"kernelspec": {
"display_name": "Python [default]",
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
Expand All @@ -1662,7 +1668,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.5"
"version": "3.7.8"
}
},
"nbformat": 4,
Expand Down
10 changes: 4 additions & 6 deletions test_notebooks.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import os
import sys
import time
from glob import glob
import pytest

def test_version():
import nipype
Expand Down Expand Up @@ -90,7 +89,6 @@ def reduce_notebook_load(path):
print('Reducing: %s' % n)
notebooks.append(reduce_notebook_load(n))

for test in notebooks:
pytest_cmd = 'pytest --nbval-lax --nbval-cell-timeout 7200 -v -s %s' % test
print(pytest_cmd)
os.system(pytest_cmd)
# testing all tests from the notebooks list
pytest_exit_code = pytest.main(["--nbval-lax", "--nbval-cell-timeout", "7200", "-vs"] + notebooks)
sys.exit(pytest_exit_code)