Skip to content

Commit

Permalink
only use nox for python tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rmorshea committed May 20, 2021
1 parent f42cbd5 commit 5056b7b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 42 deletions.
19 changes: 8 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,20 @@ jobs:
run: pip install -r requirements/test-run.txt
- name: Run Tests
run: |
nox -s test_python -- pytest[--headless]
nox -s test -- pytest[--headless]
test-javascript:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2-beta
- uses: actions/setup-node@v2
with:
node-version: "14"
- name: Use Latest Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install Python Dependencies
run: pip install -r requirements/test-run.txt
- name: Run Tests
- name: Test Javascript
working-directory: ./src/idom/client/app
run: |
nox -s test_javascript
npm --version
npm install
npm test
test-python-versions:
runs-on: ${{ matrix.os }}
strategy:
Expand All @@ -64,4 +61,4 @@ jobs:
run: pip install -r requirements/test-run.txt
- name: Run Tests
run: |
nox -s test_python -- pytest[--headless,--no-cov]
nox -s test -- pytest[--headless,--no-cov]
36 changes: 9 additions & 27 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,17 @@ def docs_in_docker(session: Session) -> None:


@nox.session
def test_python(session: Session) -> None:
def test(session: Session) -> None:
"""Run the complete test suite"""
session.install("--upgrade", "pip", "setuptools", "wheel")
test_python_suite(session)
test_python_types(session)
test_python_style(session)
test_python_docs(session)
test_suite(session)
test_types(session)
test_style(session)
test_docs(session)


@nox.session
def test_python_suite(session: Session) -> None:
def test_suite(session: Session) -> None:
"""Run the Python-based test suite"""
session.env["IDOM_DEBUG_MODE"] = "1"
install_requirements_file(session, "test-env")
Expand All @@ -101,7 +101,7 @@ def test_python_suite(session: Session) -> None:


@nox.session
def test_python_types(session: Session) -> None:
def test_types(session: Session) -> None:
"""Perform a static type analysis of the codebase"""
install_requirements_file(session, "check-types")
install_requirements_file(session, "pkg-deps")
Expand All @@ -110,7 +110,7 @@ def test_python_types(session: Session) -> None:


@nox.session
def test_python_style(session: Session) -> None:
def test_style(session: Session) -> None:
"""Check that style guidelines are being followed"""
install_requirements_file(session, "check-style")
session.run("flake8", "src/idom", "tests", "docs")
Expand All @@ -126,32 +126,14 @@ def test_python_style(session: Session) -> None:


@nox.session
def test_python_docs(session: Session) -> None:
def test_docs(session: Session) -> None:
"""Verify that the docs build and that doctests pass"""
install_requirements_file(session, "build-docs")
install_idom_dev(session, extras="all")
session.run("sphinx-build", "-b", "html", "docs/source", "docs/build")
session.run("sphinx-build", "-b", "doctest", "docs/source", "docs/build")


@nox.session
def test_javascript(session: Session) -> None:
"""Verify that the docs build and that doctests pass"""
app_dir = HERE / "src" / "idom" / "client" / "app"
session.chdir(str(app_dir))
session.run("npm", "install", external=True)
for package_dir in (app_dir / "packages").glob("*"):
session.run(
"npm",
"--prefix",
str(package_dir.relative_to(app_dir)),
"run",
"test",
external=True,
)
session.chdir(str(HERE))


@nox.session
def commits_since_last_tag(session: Session) -> None:
"""A basic script for outputing changelog info"""
Expand Down
6 changes: 2 additions & 4 deletions src/idom/client/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
"version": "0.1.0",
"author": "Ryan Morshead",
"main": "index.js",
"workspaces": [
"packages/idom-client-react"
],
"workspaces": [ "./packages/*" ],
"license": "MIT",
"repository": {
"type": "git",
Expand All @@ -15,7 +13,7 @@
"scripts": {
"build": "snowpack build",
"format": "prettier --write ./src",
"test": "uvu packages/idom-client-react/tests"
"test": "npm --workspaces test"
},
"devDependencies": {
"prettier": "^2.2.1",
Expand Down

0 comments on commit 5056b7b

Please sign in to comment.