From 5056b7b65c3083950d140d76b8c9d6857689873f Mon Sep 17 00:00:00 2001 From: rmorshea Date: Wed, 19 May 2021 22:50:23 -0700 Subject: [PATCH] only use nox for python tests --- .github/workflows/test.yml | 19 +++++++---------- noxfile.py | 36 ++++++++------------------------ src/idom/client/app/package.json | 6 ++---- 3 files changed, 19 insertions(+), 42 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e757782ff..a07e1fc7e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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: @@ -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] diff --git a/noxfile.py b/noxfile.py index 9bb6b2fd9..e898e8472 100644 --- a/noxfile.py +++ b/noxfile.py @@ -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") @@ -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") @@ -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") @@ -126,7 +126,7 @@ 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") @@ -134,24 +134,6 @@ def test_python_docs(session: Session) -> None: 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""" diff --git a/src/idom/client/app/package.json b/src/idom/client/app/package.json index e55c600ec..6652705fe 100644 --- a/src/idom/client/app/package.json +++ b/src/idom/client/app/package.json @@ -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", @@ -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",