Skip to content

Commit

Permalink
Start implementing smoke testing (#40)
Browse files Browse the repository at this point in the history
* Start implementing smoke testing
* add more api tests
* install test dependencies

Where there's smoke, there's fire!
See https://www.atlassian.com/continuous-delivery/software-testing/types-of-software-testing

Signed-off-by: nstarman <nstarman@users.noreply.github.com>
  • Loading branch information
nstarman committed Jan 20, 2024
1 parent c0eeee0 commit 1eca3ae
Show file tree
Hide file tree
Showing 14 changed files with 50 additions and 2 deletions.
18 changes: 17 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,26 @@ jobs:
# echo "::add-matcher::$GITHUB_WORKSPACE/.github/matchers/pylint.json"
# pipx run nox -s pylint

# Where there's smoke, there's fire!
smoke:
name: Smoke tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install package
run: python -m pip install ".[test]"
- name: Run smoke test
run: python -m pytest tests/smoke -ra

checks:
name: Check Python ${{ matrix.python-version }} on ${{ matrix.runs-on }}
runs-on: ${{ matrix.runs-on }}
needs: [pre-commit]
needs: [pre-commit, smoke]
strategy:
fail-fast: false
matrix:
Expand Down
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ filterwarnings = [
]
log_cli_level = "INFO"
testpaths = [
"tests",
"tests/",
"docs",
"src/galax",
]


Expand Down
Empty file added tests/smoke/__init__.py
Empty file.
Empty file.
Empty file.
10 changes: 10 additions & 0 deletions tests/smoke/dynamics/mockstream/test_package.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
"""Testing :mod:`galax.dynamics.mockstream` module."""

from galax.dynamics import mockstream


def test_all():
"""Test the `galax.dynamics.mockstream` API."""
assert set(mockstream.__all__) == set(
mockstream._df.__all__ + mockstream._mockstream_generator.__all__
)
10 changes: 10 additions & 0 deletions tests/smoke/dynamics/test_package.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
"""Testing :mod:`galax.dynamics` module."""

import galax.dynamics as gd


def test_all():
"""Test the `galax.potential` API."""
assert set(gd.__all__) == set(
gd._core.__all__ + gd._orbit.__all__ + gd.mockstream.__all__
)
Empty file.
10 changes: 10 additions & 0 deletions tests/smoke/integrate/test_package.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
"""Test the :mod:`galax.integrate` module."""

from galax import integrate


def test_all():
"""Test the API."""
assert set(integrate.__all__) == set(
integrate._base.__all__ + integrate._builtin.__all__
)
Empty file.
File renamed without changes.
File renamed without changes.
Empty file added tests/smoke/utils/__init__.py
Empty file.
File renamed without changes.

0 comments on commit 1eca3ae

Please sign in to comment.