Skip to content

Commit

Permalink
Add Unit and Documentation Build Tests (#306)
Browse files Browse the repository at this point in the history
* Add test dependencies to setup.cfg

* Add tox configuration

* Add unit tests for process module while fixing various bugs

* Add unit tests for config module while fixing various bugs

* Add testing caches to gitgnore

* Add unit testing GHA workflow

* Add documentation test workflow

* Suppress mathjax warning from myst-parser plugin

* Add documentation page on testing practices

* Modify sphinx build to re-run notebooks on build

* Modify adding_workloads notebook to run on Azure

* Remove needed ok-to-test label, as no need

* Add manifest to force including version.txt

* Add missing coverage configuration to tox

* Remove '_source' directory from html_static_path

* Add information on docstring tests

* Remove extra space

* Add export for benchmark operator image for ripsaw cli

* Add coveragerc file

* Add python 3.9 to doc and unit tests

* Use matrix for parallel runs

* Add missing needs to coverage_report job

* Fix issues preventing coverage report job from running

* Replace uppercase P with lowercase p in pip command

* Add retry and timeout to linkcheck build

* Increase timeout and retries for linkcheck

* Change links in unit testing page from SFT to guru99

* Add pretty name for jobs

* Don't use coverage combine across python versions

Not needed, as we have same tests for each python version

We expect that the coverage will remain the same regardless of the python version

* Only upload coverage report for python 3.6

* Add missing install for coverage package

* Use tox coverage environment to generate reports
  • Loading branch information
Ryan Drew authored Aug 9, 2021
1 parent 63f1d9b commit ac3ccf8
Show file tree
Hide file tree
Showing 16 changed files with 759 additions and 320 deletions.
6 changes: 6 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[run]
omit =
snafu/benchmarks/*/*
**/*_wrapper*
**/trigger*
**/__init__.py
24 changes: 24 additions & 0 deletions .github/workflows/doc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Documentation Build Test
on:
- push
- pull_request
- workflow_dispatch

jobs:
build_docs:
runs-on: ubuntu-latest
strategy:
matrix:
pyver: [6, 7, 8, 9]
name: Run Doc Tests -- Python 3.${{ matrix.pyver }}
steps:
- uses: actions/checkout@v2
- name: Install build dependencies
run: sudo apt-get install -y pandoc
- uses: actions/setup-python@v2
with:
python-version: 3.${{ matrix.pyver }}
- name: Install tox
run: pip install tox
- name: Run Tox
run: tox -e py3${{ matrix.pyver }}-docs
33 changes: 33 additions & 0 deletions .github/workflows/unit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Unit Tests
on:
push:
paths-ignore:
- 'docs/**'
pull_request:
workflow_dispatch:

jobs:
unit_tests:
runs-on: ubuntu-latest
strategy:
matrix:
pyver: [6, 7, 8, 9]
name: Run Unit Tests -- Python 3.${{ matrix.pyver }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.${{ matrix.pyver }}
- name: Install tox
run: pip install tox
- name: Run Tox
run: tox -e py3${{ matrix.pyver }}-unit
- name: Generate coverage report
if: matrix.pyver == 6
run: tox -e coverage
- name: Upload coverage report
if: matrix.pyver == 6
uses: codecov/codecov-action@v1
with:
files: ./coverage.xml
flags: unit,gha,python-3.${{ matrix.pyver }}
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ venv.bak/
/.project
/.pydevproject

# Testing
.tox
.coverage
.coverage.*

# JetBrains settings
.idea/

Expand Down
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include version.txt
13 changes: 12 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ["myst_parser", "nbsphinx"]
suppress_warnings = ["myst.mathjax"]

# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]
Expand All @@ -55,4 +56,14 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ["_static"]
html_static_path = []


# -- nbsphinx configuration --------------------------------------------------

nbsphinx_execute = "always"


# -- linkcheck configuration --------------------------------------------------
linkcheck_retries = 5
linkcheck_timeout = 60
1 change: 1 addition & 0 deletions docs/source/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
contributing/setting_up_env
contributing/adding_workloads
contributing/adding_exports
contributing/unit_testing
contributing/documentation
```
Loading

0 comments on commit ac3ccf8

Please sign in to comment.