Skip to content

Commit

Permalink
Set up pytest node tests (pyodide#1717)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hood Chatham authored Jul 20, 2021
1 parent c8436c3 commit f0bd568
Show file tree
Hide file tree
Showing 31 changed files with 695 additions and 399 deletions.
22 changes: 13 additions & 9 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: 2.1
defaults: &defaults
working_directory: ~/repo
docker:
- image: pyodide/pyodide-env:18
- image: pyodide/pyodide-env:19
environment:
- EMSDK_NUM_CORES: 3
EMCC_CORES: 3
Expand All @@ -26,11 +26,6 @@ jobs:
steps:
- checkout

- run:
name: Install prerequisites
command: |
pip install -r docs/requirements-doc.txt
- run:
name: Test docs
command: |
Expand Down Expand Up @@ -166,7 +161,7 @@ jobs:
- run:
name: stack-size
command: |
pytest -s benchmark/stack_usage.py | sed -n 's/## //pg'
pytest -s benchmark/stack_usage.py | sed -n 's/## //pg' || true
test-emsdk:
<<: *defaults
Expand All @@ -188,11 +183,10 @@ jobs:
name: test
command: |
mkdir test-results
pip install ruamel.yaml
pytest \
--junitxml=test-results/junit.xml \
--verbose \
-k 'not (chrome or firefox)' \
-k 'not (chrome or firefox or node)' \
--cov=pyodide_build --cov=pyodide \
src pyodide-build packages/micropip/
Expand Down Expand Up @@ -313,6 +307,11 @@ workflows:
test-params: -k firefox src packages/micropip
requires:
- build-core
- test-main:
name: test-core-node
test-params: -k node src packages/micropip
requires:
- build-core
- test-main:
name: test-packages-chrome
test-params: -k chrome packages/test* packages/*/test*
Expand All @@ -323,6 +322,11 @@ workflows:
test-params: -k firefox packages/test* packages/*/test*
requires:
- build-packages
- test-main:
name: test-packages-node
test-params: -k "node and not numpy" packages/test* packages/*/test*
requires:
- build-packages
- test-emsdk:
requires:
- build-core
Expand Down
32 changes: 4 additions & 28 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,34 +12,10 @@ RUN apt-get update \
libgconf-2-4 "chromium=90.*" \
&& rm -rf /var/lib/apt/lists/*

RUN pip3 --no-cache-dir install \
black \
"cython<3.0" \
packaging \
flake8 \
hypothesis \
"mypy==0.812" \
pytest \
pytest-asyncio \
pytest-cov \
pytest-httpserver \
pytest-instafail \
pytest-rerunfailures \
pytest-xdist \
pyyaml \
"selenium==4.0.0.b3" \
# Docs requirements
sphinx \
sphinx_book_theme \
myst-parser==0.13.3 \
sphinxcontrib-napoleon \
packaging \
sphinx-js==3.1 \
autodocsumm \
docutils==0.16 \
sphinx-argparse-cli~=1.6.0 \
sphinx-version-warning~=1.1.2 \
sphinx-issues
ADD docs/requirements-doc.txt requirements.txt /

RUN pip3 --no-cache-dir install -r /requirements.txt \
&& pip3 --no-cache-dir install -r /requirements-doc.txt

# Get firefox 70.0.1 and geckodriver
RUN wget -qO- https://ftp.mozilla.org/pub/firefox/releases/87.0/linux-x86_64/en-US/firefox-87.0.tar.bz2 | tar jx \
Expand Down
Loading

0 comments on commit f0bd568

Please sign in to comment.