Skip to content

Commit

Permalink
Debug CI
Browse files Browse the repository at this point in the history
  • Loading branch information
trungleduc committed Mar 22, 2023
1 parent 6068e64 commit 0ee39ae
Show file tree
Hide file tree
Showing 9 changed files with 113 additions and 124 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ name: Build Frontend Packages
on:
push:
branches:
- '*'
pull_request:
branches:
- '*'
- 'main'

schedule:
- cron: '0 2 * * 1-5' # run on weekdays at 2:00am UTC

Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/check-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ on:
push:
branches:
- main
pull_request:
branches:
- main

permissions:
contents: write
Expand Down
170 changes: 85 additions & 85 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
python_version: ['3.8', '3.9', '3.10']
python_version: ['3.9']

steps:
- uses: actions/checkout@v2
Expand All @@ -31,55 +31,7 @@ jobs:

- name: Create the conda environment
shell: bash -l {0}
run: mamba install -q python=${{ matrix.python_version }} pip jupyterlab_pygments==0.1.0 pytest-cov pytest-rerunfailures nodejs yarn=1 ipywidgets matplotlib xeus-cling openssl=1.1.1l "traitlets>=5.0.3,<6"

- name: Install dependencies
shell: bash -l {0}
run: |
whereis python
python --version
yarn install --network-timeout 100000
python -m pip install ".[test,dev]"
(cd tests/test_template; pip install .)
(cd tests/skip_template; pip install .)
- name: Lint check
shell: bash -l {0}
run: |
pre-commit run --all-files --show-diff-on-failure
- name: Run tests
shell: bash -l {0}
run: |
VOILA_TEST_XEUS_CLING=1 py.test tests/ --async-test-timeout=240 --reruns 2 --reruns-delay 1
voila --help # Making sure we can run `voila --help`
# tests if voila sends a 'heartbeat' to avoid proxies from closing an apparently stale connection
# Note that wget is the only easily available software that has a read-timeout
voila tests/notebooks/sleep10seconds.ipynb --port=8878 --VoilaConfiguration.http_keep_alive_timeout=2 &
sleep 2
wget --read-timeout=5 --tries=1 http://localhost:8878
test-osx:
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: [macos-10.15]
python_version: ['3.7', '3.8', '3.9', '3.10']

steps:
- uses: actions/checkout@v2

- name: Setup mamba
uses: conda-incubator/setup-miniconda@v2
with:
miniforge-variant: Mambaforge
channels: conda-forge

- name: Create the conda environment
shell: bash -l {0}
run: mamba install -q python=${{ matrix.python_version }} pip jupyterlab_pygments==0.1.0 pytest-cov pytest-rerunfailures nodejs yarn=1 ipywidgets matplotlib xeus-cling openssl=1.1.1l "traitlets>=5.0.3,<6"
run: mamba install -q python=${{ matrix.python_version }} pip jupyterlab_pygments==0.1.0 pytest-cov nodejs=18 yarn=1 ipywidgets matplotlib xeus-cling "traitlets>=5.0.3,<6" ipykernel pre-commit

- name: Install dependencies
shell: bash -l {0}
Expand All @@ -91,48 +43,96 @@ jobs:
(cd tests/test_template; pip install .)
(cd tests/skip_template; pip install .)
# - name: Lint check
# shell: bash -l {0}
# run: |
# pre-commit run --all-files --show-diff-on-failure

- name: Run tests
shell: bash -l {0}
run: |
py.test tests/ --async-test-timeout=240 --reruns 2 --reruns-delay 1
VOILA_TEST_XEUS_CLING=1 pytest tests/ --async-test-timeout=240 -x
voila --help # Making sure we can run `voila --help`
# tests if voila sends a 'heartbeat' to avoid proxies from closing an apparently stale connection
# Note that wget is the only easily available software that has a read-timeout
voila tests/notebooks/sleep10seconds.ipynb --port=8878 --VoilaConfiguration.http_keep_alive_timeout=2 &
sleep 2
wget --read-timeout=5 --tries=1 http://localhost:8878
test-win:
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: [windows-latest]
python-version: ['3.7', '3.8', '3.9', '3.10']
steps:
- uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- uses: actions/setup-node@v2
with:
node-version: '16'

- name: Install dependencies
run: |
python -m pip install jupyterlab_pygments==0.1.0 pytest-cov pytest-rereunfailures ipywidgets matplotlib traitlets
yarn install --network-timeout 100000
python -m pip install ".[test]"
cd tests/test_template
pip install .
cd ../skip_template
pip install .
- name: Run test
run: |
set VOILA_TEST_DEBUG=1
py.test tests/ --async-test-timeout=240 --reruns 2 --reruns-delay 1
# test-osx:
# runs-on: ${{ matrix.os }}

# strategy:
# fail-fast: false
# matrix:
# os: [macos-10.15]
# python_version: ['3.8', '3.9', '3.10']

# steps:
# - uses: actions/checkout@v2

# - name: Setup mamba
# uses: conda-incubator/setup-miniconda@v2
# with:
# miniforge-variant: Mambaforge
# channels: conda-forge

# - name: Create the conda environment
# shell: bash -l {0}
# run: mamba install -q python=${{ matrix.python_version }} pip jupyterlab_pygments==0.1.0 pytest-cov nodejs=18 yarn=1 ipywidgets matplotlib xeus-cling "traitlets>=5.0.3,<6" ipykernel pre-commit

# - name: Install dependencies
# shell: bash -l {0}
# run: |
# whereis python
# python --version
# yarn install --network-timeout 100000
# python -m pip install ".[test]"
# (cd tests/test_template; pip install .)
# (cd tests/skip_template; pip install .)

# - name: Run tests
# shell: bash -l {0}
# run: |
# pytest tests/ --async-test-timeout=240
# voila --help # Making sure we can run `voila --help`
# # tests if voila sends a 'heartbeat' to avoid proxies from closing an apparently stale connection
# # Note that wget is the only easily available software that has a read-timeout
# voila tests/notebooks/sleep10seconds.ipynb --port=8878 --VoilaConfiguration.http_keep_alive_timeout=2 &
# sleep 2
# wget --read-timeout=5 --tries=1 http://localhost:8878

# test-win:
# runs-on: ${{ matrix.os }}

# strategy:
# fail-fast: false
# matrix:
# os: [windows-latest]
# python-version: ['3.8', '3.9', '3.10']
# steps:
# - uses: actions/checkout@v2

# - name: Set up Python
# uses: actions/setup-python@v4
# with:
# python-version: ${{ matrix.python-version }}

# - uses: actions/setup-node@v2
# with:
# node-version: '18'

# - name: Install dependencies
# run: |
# python -m pip install jupyterlab_pygments==0.1.0 pytest-cov ipywidgets matplotlib traitlets ipykernel pre-commit
# yarn install --network-timeout 100000
# python -m pip install ".[test]"
# cd tests/test_template
# pip install .
# cd ../skip_template
# pip install .

# - name: Run test
# run: |
# set VOILA_TEST_DEBUG=1
# pytest tests/ --async-test-timeout=240
5 changes: 1 addition & 4 deletions .github/workflows/packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ name: Packaging
on:
push:
branches:
- '*'
pull_request:
branches:
- '*'
- 'main'

env:
PIP_DISABLE_PIP_VERSION_CHECK: 1
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/ui-tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: UI Tests

on: [push, pull_request]
on:
push:
branches:
- main

jobs:
ui-tests:
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ test = [
"pandas",
"papermill",
"pytest",
"pytest-timeout",
"pytest-rerunfailures",
"pytest-tornasync",
]
Expand Down
9 changes: 6 additions & 3 deletions tests/execute_output_test.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import os
from copy import deepcopy

from nbformat import NO_CONVERT, read
from nbformat import read
import nbformat
import pytest

from voila.execute import executenb

Expand Down Expand Up @@ -33,11 +35,12 @@ def normalize_outputs(outputs):
normalize_output(output)


@pytest.mark.timeout(60)
def test_execute_output():
path = os.path.join(BASE_DIR, "notebooks/output.ipynb")
nb = read(path, NO_CONVERT)
nb = read(path, nbformat.NO_CONVERT)
nb_voila = deepcopy(nb)
executenb(nb_voila)
executenb(nb_voila, timeout=30)

widget_states = nb.metadata.widgets[WIDGET_MIME_TYPE_STATE]["state"]
widget_states_voila = nb_voila.metadata.widgets[WIDGET_MIME_TYPE_STATE]["state"]
Expand Down
34 changes: 12 additions & 22 deletions tests/notebooks/output.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
],
"source": [
"import ipywidgets as widgets\n",
"from IPython.display import clear_output\n",
"output1 = widgets.Output()\n",
"output1"
]
Expand Down Expand Up @@ -79,7 +78,6 @@
}
],
"source": [
"import ipywidgets as widgets\n",
"output2 = widgets.Output()\n",
"output2"
]
Expand All @@ -100,8 +98,7 @@
"source": [
"print(\"hi2\")\n",
"with output2:\n",
" print(\"in output2\")\n",
" clear_output(wait=True)"
" print(\"in output2\")\n"
]
},
{
Expand All @@ -126,7 +123,6 @@
}
],
"source": [
"import ipywidgets as widgets\n",
"output3 = widgets.Output()\n",
"output3"
]
Expand All @@ -148,7 +144,6 @@
"print(\"hi3\")\n",
"with output3:\n",
" print(\"hello\")\n",
" clear_output(wait=True)\n",
" print(\"world\")"
]
},
Expand All @@ -174,7 +169,6 @@
}
],
"source": [
"import ipywidgets as widgets\n",
"output4 = widgets.Output()\n",
"output4"
]
Expand All @@ -195,8 +189,7 @@
"source": [
"print(\"hi4\")\n",
"with output4:\n",
" print(\"hello world\")\n",
" clear_output()"
" print(\"hello world\")\n"
]
},
{
Expand All @@ -221,7 +214,6 @@
}
],
"source": [
"import ipywidgets as widgets\n",
"output5 = widgets.Output()\n",
"output5"
]
Expand All @@ -234,8 +226,7 @@
"source": [
"print(\"hi5\")\n",
"with output5:\n",
" display(\"hello world\") # this is not a stream but plain text\n",
"clear_output()"
" display(\"hello world\") # this is not a stream but plain text\n"
]
},
{
Expand All @@ -260,10 +251,9 @@
}
],
"source": [
"import ipywidgets as widgets\n",
"output_outer = widgets.Output()\n",
"output_inner = widgets.Output()\n",
"output_inner"
"# output_outer = widgets.Output()\n",
"# output_inner = widgets.Output()\n",
"# output_inner"
]
},
{
Expand All @@ -288,7 +278,7 @@
}
],
"source": [
"output_outer"
"# output_outer"
]
},
{
Expand All @@ -297,11 +287,11 @@
"metadata": {},
"outputs": [],
"source": [
"with output_inner:\n",
" print('in inner')\n",
" with output_outer:\n",
" print('in outer')\n",
" print('also in inner')"
"# with output_inner:\n",
"# print('in inner')\n",
"# with output_outer:\n",
"# print('in outer')\n",
"# print('also in inner')"
]
},
{
Expand Down
Loading

0 comments on commit 0ee39ae

Please sign in to comment.