Skip to content

Commit

Permalink
Merge pull request #273 from cadCAD-org/multi_os
Browse files Browse the repository at this point in the history
 Test in CI: Jupyter server not recognizing cadCAD module
  • Loading branch information
JEJodesty authored Jun 22, 2021
2 parents 00b00e6 + ba0383a commit 6a04369
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
5 changes: 1 addition & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,12 @@ jobs:
jupyterServerTest:
docker:
- image: cimg/python:3.9.5
# executor: python3_9_5/default
steps:
- checkout
- python/load-cache
# - python/install-deps
# - python/save-cache
- run: python --version
- run: pip install --upgrade pip
- run: pip install -r requirements.txt
- run: pip install jupyter
- python/save-cache
- run: python setup.py bdist_wheel
- run: pip install dist/*.whl --force-reinstall
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ plotly==4.10.0
pyarrow>=1.0.1
pytest==6.0.2
scikit-learn==0.23.2
scipy==1.5.2
scipy>=1.5.2
seaborn==0.11.0
tabulate==0.8.7
xarray==0.16.0
Expand Down
5 changes: 3 additions & 2 deletions testing/tests/import_cadCAD.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@
"metadata": {},
"outputs": [],
"source": [
"dunder_file = os.path.abspath('')\n",
"file_path = f'{dunder_file}/expected_results/cadCAD_memory_address.json'\n",
"# dunder_file = os.path.abspath('')\n",
"# file_path = f'{dunder_file}/expected_results/cadCAD_memory_address.json'\n",
"file_path = f'{os.getcwd()}/cadCAD_memory_address.json'\n",
"with open(file_path, 'w') as json_file:\n",
" memory_address = {'memory_address': hex(id(cadCAD))}\n",
" json.dump(memory_address, json_file)"
Expand Down
4 changes: 2 additions & 2 deletions testing/tests/import_cadCAD_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

class JupyterServerTest(unittest.TestCase):
def test_row_count(self):
command = 'jupyter nbconvert --to=notebook --ExecutePreprocessor.enabled=True import_cadCAD.ipynb'
command = f'jupyter nbconvert --to=notebook --ExecutePreprocessor.enabled=True {os.getcwd()}/testing/tests/import_cadCAD.ipynb'
process = subprocess.Popen(command.split(), stdout=subprocess.PIPE)
process.communicate()
json_path = f'{os.getcwd()}/expected_results/cadCAD_memory_address.json'
json_path = f'{os.getcwd()}/testing/tests/cadCAD_memory_address.json'
memory_address = json.load(open(json_path))['memory_address']
self.assertEqual(type(memory_address) == str, True, "cadCAD is not importable by jupyter server")

Expand Down

0 comments on commit 6a04369

Please sign in to comment.