Skip to content

Commit b336a3b

Browse files
committed
only use nox for python tests
1 parent 3145363 commit b336a3b

File tree

3 files changed

+19
-42
lines changed

3 files changed

+19
-42
lines changed

.github/workflows/test.yml

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,23 +27,20 @@ jobs:
2727
run: pip install -r requirements/test-run.txt
2828
- name: Run Tests
2929
run: |
30-
nox -s test_python -- pytest[--headless]
30+
nox -s test -- pytest[--headless]
3131
test-javascript:
3232
runs-on: ubuntu-latest
3333
steps:
3434
- uses: actions/checkout@v2
35-
- uses: actions/setup-node@v2-beta
35+
- uses: actions/setup-node@v2
3636
with:
3737
node-version: "14"
38-
- name: Use Latest Python
39-
uses: actions/setup-python@v2
40-
with:
41-
python-version: 3.9
42-
- name: Install Python Dependencies
43-
run: pip install -r requirements/test-run.txt
44-
- name: Run Tests
38+
- name: Test Javascript
39+
working-directory: ./src/idom/client/app
4540
run: |
46-
nox -s test_javascript
41+
npm --version
42+
npm install
43+
npm test
4744
test-python-versions:
4845
runs-on: ${{ matrix.os }}
4946
strategy:
@@ -64,4 +61,4 @@ jobs:
6461
run: pip install -r requirements/test-run.txt
6562
- name: Run Tests
6663
run: |
67-
nox -s test_python -- pytest[--headless,--no-cov]
64+
nox -s test -- pytest[--headless,--no-cov]

noxfile.py

Lines changed: 9 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -75,17 +75,17 @@ def docs_in_docker(session: Session) -> None:
7575

7676

7777
@nox.session
78-
def test_python(session: Session) -> None:
78+
def test(session: Session) -> None:
7979
"""Run the complete test suite"""
8080
session.install("--upgrade", "pip", "setuptools", "wheel")
81-
test_python_suite(session)
82-
test_python_types(session)
83-
test_python_style(session)
84-
test_python_docs(session)
81+
test_suite(session)
82+
test_types(session)
83+
test_style(session)
84+
test_docs(session)
8585

8686

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

102102

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

111111

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

127127

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

136136

137-
@nox.session
138-
def test_javascript(session: Session) -> None:
139-
"""Verify that the docs build and that doctests pass"""
140-
app_dir = HERE / "src" / "idom" / "client" / "app"
141-
session.chdir(str(app_dir))
142-
session.run("npm", "install", external=True)
143-
for package_dir in (app_dir / "packages").glob("*"):
144-
session.run(
145-
"npm",
146-
"--prefix",
147-
str(package_dir.relative_to(app_dir)),
148-
"run",
149-
"test",
150-
external=True,
151-
)
152-
session.chdir(str(HERE))
153-
154-
155137
@nox.session
156138
def commits_since_last_tag(session: Session) -> None:
157139
"""A basic script for outputing changelog info"""

src/idom/client/app/package.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44
"version": "0.1.0",
55
"author": "Ryan Morshead",
66
"main": "index.js",
7-
"workspaces": [
8-
"packages/idom-client-react"
9-
],
7+
"workspaces": [ "./packages/*" ],
108
"license": "MIT",
119
"repository": {
1210
"type": "git",
@@ -15,7 +13,7 @@
1513
"scripts": {
1614
"build": "snowpack build",
1715
"format": "prettier --write ./src",
18-
"test": "uvu packages/idom-client-react/tests"
16+
"test": "npm --workspaces test"
1917
},
2018
"devDependencies": {
2119
"prettier": "^2.2.1",

0 commit comments

Comments
 (0)