Skip to content

Commit

Permalink
Run tests on windows-latest
Browse files Browse the repository at this point in the history
  • Loading branch information
trungleduc committed Oct 25, 2021
1 parent 492a4a3 commit 10ce7a7
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 2 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,38 @@ jobs:
shell: bash -l {0}
run: |
python -m flake8 voila tests setup.py
test-win:

runs-on: ${{ matrix.os }}

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

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

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

- name: Install dependencies
run: |
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
set VOILA_TEST_XEUS_CLING=1
py.test tests/ --async-test-timeout=240
2 changes: 1 addition & 1 deletion tests/app/static_files_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ async def test_static_file_absolute_path(voila_app, app, base_url, http_server_c
response_lab = await http_server_client.fetch(f'{base_url}voila/templates/lab/static/voila.js')
assert response_lab.code == 200
abspath = TemplateStaticFileHandler.get_absolute_path(None, 'lab/static/voila.js')
with open(abspath) as f:
with open(abspath, encoding='utf-8', errors='replace') as f:
content = f.read()
assert response_lab.body.decode('utf-8') == content

Expand Down
2 changes: 1 addition & 1 deletion tests/server/static_files_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ async def test_static_file_absolute_path(app, base_url, http_server_client):
response_lab = await http_server_client.fetch(f'{base_url}voila/templates/lab/static/voila.js')
assert response_lab.code == 200
abspath = TemplateStaticFileHandler.get_absolute_path(None, 'lab/static/voila.js')
with open(abspath) as f:
with open(abspath, encoding='utf-8', errors='replace') as f:
content = f.read()
assert response_lab.body.decode('utf-8') == content

Expand Down

0 comments on commit 10ce7a7

Please sign in to comment.