Skip to content

Commit 7821495

Browse files
committed
Add python tests to CI
1 parent a95ab86 commit 7821495

File tree

9 files changed

+28
-5
lines changed

9 files changed

+28
-5
lines changed

.github/workflows/CI.yml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,19 @@ jobs:
4949
- uses: docker-practice/actions-setup-docker@v1
5050
- run: docker run "mmore500/dishtiny:GITHUB_ACTION_${{ github.run_number }}" /bin/bash -c "cd /opt/dishtiny && ./ci/test_trailing_whitespace.sh && ./ci/test_tabs.sh && ./ci/test_missing_newlines.sh && make docs && ./ci/test_headerguards.sh && ./ci/test_alphabetize_includes.sh && python3 ci/test_readme_snippets.py"
5151

52-
unit:
53-
name: Unit Tests
52+
py-unit:
53+
name: Python Unit Tests
54+
runs-on: ubuntu-16.04
55+
needs:
56+
- docker-build
57+
steps:
58+
# Adapted from https://askubuntu.com/a/524368
59+
- run: echo $(hostname -I | cut -d\ -f1) $(hostname) | sudo -h 127.0.0.1 tee -a /etc/hosts
60+
- uses: docker-practice/actions-setup-docker@v1
61+
- run: docker run -e "DISH_MPICXX=$DISH_MPICXX" -e "OMPI_CXX=$OMPI_CXX" --cap-add=SYS_ADMIN -i "mmore500/dishtiny:GITHUB_ACTION_${{ github.run_number }}" /bin/bash -c "/opt/dishtiny/dishpylib/test/run_tests.sh"
62+
63+
cpp-unit:
64+
name: C++ Unit Tests
5465
runs-on: ubuntu-16.04
5566
needs:
5667
- docker-build
@@ -156,7 +167,8 @@ jobs:
156167
if: github.ref == 'refs/heads/master'
157168
needs:
158169
- docs
159-
- unit
170+
- py-unit
171+
- cpp-unit
160172
- source
161173
- coverage
162174
- fuzzing
@@ -191,7 +203,8 @@ jobs:
191203
runs-on: ubuntu-16.04
192204
needs:
193205
- docs
194-
- unit
206+
- py-unit
207+
- cpp-unit
195208
- source
196209
- coverage
197210
- fuzzing

dishpylib/test/__init__.py

Whitespace-only changes.

dishpylib/test/run_tests.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
set -e # exit with error if any of this fails
4+
5+
script_dir="$(dirname "$(readlink -f "$0")")"
6+
7+
nosetests "${script_dir}"/**/test_*.py

dishpylib/test/test_pyanalysis/__init__.py

Whitespace-only changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../..

dishpylib/tests/dishpylib

Lines changed: 0 additions & 1 deletion
This file was deleted.

third-party/requirements.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ jupyter_core==4.7.1
3030
traitlets==4.3.3
3131
ipykernel==5.5.3
3232
ipython==7.16.1
33+
nose==1.3.7
3334

3435
# docs
3536
sphinx==3.1.2

third-party/requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,8 @@ nbformat==5.1.3
179179
# via nbconvert
180180
networkx==2.5
181181
# via -r requirements.in
182+
nose==1.3.7
183+
# via -r requirements.in
182184
numpy==1.19.5
183185
# via
184186
# -r requirements.in

0 commit comments

Comments
 (0)