-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve tests and run tests on Windows (#58)
* Run CI on Windows * Use sakee
- Loading branch information
1 parent
10fd89b
commit 391c0a6
Showing
37 changed files
with
232 additions
and
1,267 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
ADDON_USERNAME= | ||
ADDON_PASSWORD= | ||
ADDON_PROFILE= | ||
|
||
KODI_HOME=tests/home | ||
KODI_INTERACTIVE=0 | ||
KODI_STUB_VERBOSE=1 | ||
KODI_STUB_RPC_RESPONSES=tests/rpc | ||
|
||
#HTTP_PROXY= | ||
#HTTPS_PROXY= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,67 @@ | ||
name: CI | ||
on: | ||
- pull_request | ||
- push | ||
# Run action when pushed to master, or for commits in a pull request. | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
jobs: | ||
tests: | ||
name: Add-on testing | ||
runs-on: ubuntu-latest | ||
env: | ||
PYTHONIOENCODING: utf-8 | ||
PYTHONPATH: ${{ github.workspace }}/resources/lib:${{ github.workspace }}/tests | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: [2.7, 3.6, 3.7, 3.8, 3.9] | ||
os: [ ubuntu-latest ] | ||
python-version: [ 2.7, 3.5, 3.6, 3.7, 3.8, 3.9 ] | ||
include: | ||
# Kodi Leia on Windows uses a bundled Python 2.7. | ||
- os: windows-latest | ||
python-version: 2.7 | ||
|
||
# Kodi Matrix on Windows uses a bundled Python 3.8, but we test 3.9 also to be sure. | ||
- os: windows-latest | ||
python-version: 3.8 | ||
- os: windows-latest | ||
python-version: 3.9 | ||
steps: | ||
- name: Check out ${{ github.sha }} from repository ${{ github.repository }} | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install dependencies | ||
run: | | ||
sudo apt-get install gettext | ||
sudo pip install coverage --install-option="--install-scripts=/usr/bin" | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
run: pip install -r requirements.txt | ||
|
||
- name: Run pylint | ||
run: make check-pylint | ||
- name: Run tox | ||
run: make check-tox | ||
|
||
- name: Check translations | ||
run: make check-translations | ||
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.9' | ||
run: sudo apt-get install gettext && make check-translations | ||
|
||
- name: Run unit tests | ||
run: coverage run -m unittest discover | ||
- name: Run addon service | ||
run: coverage run -a service.py | ||
env: | ||
ADDON_USERNAME: ${{ secrets.ADDON_USERNAME }} | ||
ADDON_PASSWORD: ${{ secrets.ADDON_PASSWORD }} | ||
PYTHONIOENCODING: utf-8 | ||
KODI_HOME: ${{ github.workspace }}/tests/home | ||
KODI_INTERACTIVE: 0 | ||
KODI_STUB_RPC_RESPONSES: ${{ github.workspace }}/tests/rpc | ||
HTTP_PROXY: ${{ secrets.HTTP_PROXY }} | ||
run: pytest -v --cov=./ --cov-report=xml tests | ||
|
||
- name: Upload code coverage to CodeCov | ||
uses: codecov/codecov-action@v1 | ||
continue-on-error: true | ||
env: | ||
OS: ${{ matrix.os }} | ||
PYTHON: ${{ matrix.python-version }} | ||
with: | ||
flags: unittests | ||
env_vars: OS,PYTHON |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,21 @@ | ||
# Temporary files | ||
*.pyc | ||
*.pyo | ||
.DS* | ||
Thumbs.db | ||
*~ | ||
.cache | ||
|
||
# Files related to development | ||
.pylint_rc | ||
/.idea | ||
/.project | ||
/.pydevproject | ||
/.settings | ||
/Pipfile | ||
/Pipfile.lock | ||
|
||
# Files related to testing | ||
Thumbs.db | ||
*~ | ||
.cache | ||
.coverage | ||
.tox/ | ||
coverage.xml | ||
|
||
# Testing | ||
tests/home/userdata/addon_data/service.iptv.manager/playlist.m3u8 | ||
tests/home/userdata/addon_data/service.iptv.manager/epg.xml | ||
.env | ||
|
||
# IPTV Manager output | ||
tests/userdata/playlist.m3u8 | ||
tests/userdata/epg.xml | ||
tests/userdata/channels.json | ||
Pipfile | ||
Pipfile.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
coverage | ||
lxml | ||
polib | ||
pylint | ||
pytest | ||
pytest-cov | ||
pytest-timeout | ||
python-dateutil | ||
tox | ||
mock | ||
mock | ||
#sakee | ||
git+git://github.com/michaelarnauts/kodi.emulator.ascii.git@jsonrpc-addons#egg=sakee |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.