-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'add-test-framework' of https://github.com/Pyhass/Pyhiveapi
- Loading branch information
Showing
58 changed files
with
1,555 additions
and
1,420 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,5 @@ | ||
[run] | ||
source = src | ||
omit = | ||
*/__init__.py | ||
*/debugger.py |
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 |
---|---|---|
|
@@ -35,19 +35,19 @@ jobs: | |
key: >- | ||
${{ env.CACHE_VERSION}}-${{ runner.os }}-base-venv-${{ | ||
steps.python.outputs.python-version }}-${{ | ||
hashFiles('requirements.txt') }}-${{ | ||
hashFiles('requirements_test.txt') }} | ||
hashFiles('requirements_all.txt') }}-${{ | ||
hashFiles('requirements_test_all.txt') }} | ||
restore-keys: | | ||
${{ env.CACHE_VERSION}}-${{ runner.os }}-base-venv-${{ steps.python.outputs.python-version }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements_test.txt') }}- | ||
${{ env.CACHE_VERSION}}-${{ runner.os }}-base-venv-${{ steps.python.outputs.python-version }}-${{ hashFiles('requirements.txt') }} | ||
${{ env.CACHE_VERSION}}-${{ runner.os }}-base-venv-${{ steps.python.outputs.python-version }}-${{ hashFiles('requirements_all.txt') }}-${{ hashFiles('requirements_test_all.txt') }}- | ||
${{ env.CACHE_VERSION}}-${{ runner.os }}-base-venv-${{ steps.python.outputs.python-version }}-${{ hashFiles('requirements_all.txt') }} | ||
${{ env.CACHE_VERSION}}-${{ runner.os }}-base-venv-${{ steps.python.outputs.python-version }}- | ||
- name: Create Python virtual environment | ||
if: steps.cache-venv.outputs.cache-hit != 'true' | ||
run: | | ||
python -m venv venv | ||
. venv/bin/activate | ||
pip install -U "pip<20.3" setuptools | ||
pip install -r requirements.txt -r requirements_test.txt | ||
pip install -r requirements_all.txt -r requirements_test_all.txt | ||
- name: Restore pre-commit environment from cache | ||
id: cache-precommit | ||
uses: actions/[email protected] | ||
|
@@ -83,8 +83,8 @@ jobs: | |
key: >- | ||
${{ env.CACHE_VERSION}}-${{ runner.os }}-base-venv-${{ | ||
steps.python.outputs.python-version }}-${{ | ||
hashFiles('requirements.txt') }}-${{ | ||
hashFiles('requirements_test.txt') }} | ||
hashFiles('requirements_all.txt') }}-${{ | ||
hashFiles('requirements_test_all.txt') }} | ||
- name: Fail job if Python cache restore failed | ||
if: steps.cache-venv.outputs.cache-hit != 'true' | ||
run: | | ||
|
@@ -127,8 +127,8 @@ jobs: | |
key: >- | ||
${{ env.CACHE_VERSION}}-${{ runner.os }}-base-venv-${{ | ||
steps.python.outputs.python-version }}-${{ | ||
hashFiles('requirements.txt') }}-${{ | ||
hashFiles('requirements_test.txt') }} | ||
hashFiles('requirements_all.txt') }}-${{ | ||
hashFiles('requirements_test_all.txt') }} | ||
- name: Fail job if Python cache restore failed | ||
if: steps.cache-venv.outputs.cache-hit != 'true' | ||
run: | | ||
|
@@ -171,8 +171,8 @@ jobs: | |
key: >- | ||
${{ env.CACHE_VERSION}}-${{ runner.os }}-base-venv-${{ | ||
steps.python.outputs.python-version }}-${{ | ||
hashFiles('requirements.txt') }}-${{ | ||
hashFiles('requirements_test.txt') }} | ||
hashFiles('requirements_all.txt') }}-${{ | ||
hashFiles('requirements_test_all.txt') }} | ||
- name: Fail job if Python cache restore failed | ||
if: steps.cache-venv.outputs.cache-hit != 'true' | ||
run: | | ||
|
@@ -218,8 +218,8 @@ jobs: | |
key: >- | ||
${{ env.CACHE_VERSION}}-${{ runner.os }}-base-venv-${{ | ||
steps.python.outputs.python-version }}-${{ | ||
hashFiles('requirements.txt') }}-${{ | ||
hashFiles('requirements_test.txt') }} | ||
hashFiles('requirements_all.txt') }}-${{ | ||
hashFiles('requirements_test_all.txt') }} | ||
- name: Fail job if Python cache restore failed | ||
if: steps.cache-venv.outputs.cache-hit != 'true' | ||
run: | | ||
|
@@ -265,8 +265,8 @@ jobs: | |
key: >- | ||
${{ env.CACHE_VERSION}}-${{ runner.os }}-base-venv-${{ | ||
steps.python.outputs.python-version }}-${{ | ||
hashFiles('requirements.txt') }}-${{ | ||
hashFiles('requirements_test.txt') }} | ||
hashFiles('requirements_all.txt') }}-${{ | ||
hashFiles('requirements_test_all.txt') }} | ||
- name: Fail job if Python cache restore failed | ||
if: steps.cache-venv.outputs.cache-hit != 'true' | ||
run: | | ||
|
@@ -312,8 +312,8 @@ jobs: | |
key: >- | ||
${{ env.CACHE_VERSION}}-${{ runner.os }}-base-venv-${{ | ||
steps.python.outputs.python-version }}-${{ | ||
hashFiles('requirements.txt') }}-${{ | ||
hashFiles('requirements_test.txt') }} | ||
hashFiles('requirements_all.txt') }}-${{ | ||
hashFiles('requirements_test_all.txt') }} | ||
- name: Fail job if Python cache restore failed | ||
if: steps.cache-venv.outputs.cache-hit != 'true' | ||
run: | | ||
|
@@ -356,8 +356,8 @@ jobs: | |
key: >- | ||
${{ env.CACHE_VERSION}}-${{ runner.os }}-base-venv-${{ | ||
steps.python.outputs.python-version }}-${{ | ||
hashFiles('requirements.txt') }}-${{ | ||
hashFiles('requirements_test.txt') }} | ||
hashFiles('requirements_all.txt') }}-${{ | ||
hashFiles('requirements_test_all.txt') }} | ||
- name: Fail job if Python cache restore failed | ||
if: steps.cache-venv.outputs.cache-hit != 'true' | ||
run: | | ||
|
@@ -403,8 +403,8 @@ jobs: | |
key: >- | ||
${{ env.CACHE_VERSION}}-${{ runner.os }}-base-venv-${{ | ||
steps.python.outputs.python-version }}-${{ | ||
hashFiles('requirements.txt') }}-${{ | ||
hashFiles('requirements_test.txt') }} | ||
hashFiles('requirements_all.txt') }}-${{ | ||
hashFiles('requirements_test_all.txt') }} | ||
- name: Fail job if Python cache restore failed | ||
if: steps.cache-venv.outputs.cache-hit != 'true' | ||
run: | | ||
|
@@ -447,8 +447,8 @@ jobs: | |
key: >- | ||
${{ env.CACHE_VERSION}}-${{ runner.os }}-base-venv-${{ | ||
steps.python.outputs.python-version }}-${{ | ||
hashFiles('requirements.txt') }}-${{ | ||
hashFiles('requirements_test.txt') }} | ||
hashFiles('requirements_all.txt') }}-${{ | ||
hashFiles('requirements_test_all.txt') }} | ||
- name: Fail job if Python cache restore failed | ||
if: steps.cache-venv.outputs.cache-hit != 'true' | ||
run: | | ||
|
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
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,5 +1,9 @@ | ||
{ | ||
"python.testing.pytestArgs": [], | ||
"python.testing.pytestArgs": ["--disable-warnings"], | ||
"python.testing.unittestEnabled": false, | ||
"python.testing.pytestEnabled": true | ||
"python.testing.pytestEnabled": true, | ||
"[python]": { | ||
"editor.showUnused": false, | ||
}, | ||
"python.formatting.provider": "black", | ||
} |
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,115 @@ | ||
{ | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"label": "Pytest", | ||
"detail": "Execute pytest tests for pyhiveapi/apyhiveapi", | ||
"type": "shell", | ||
"command": "pytest --timeout=10 tests", | ||
"dependsOn": ["Install all Test Requirements", "Install Package Locally"], | ||
"group": { | ||
"kind": "test", | ||
"isDefault": true | ||
}, | ||
"presentation": { | ||
"reveal": "always", | ||
"panel": "new" | ||
}, | ||
"problemMatcher": [] | ||
}, | ||
{ | ||
"label": "Flake8", | ||
"detail": "Run flake8 checks on the libary", | ||
"type": "shell", | ||
"command": "pre-commit run flake8 --all-files", | ||
"group": { | ||
"kind": "test", | ||
"isDefault": true | ||
}, | ||
"presentation": { | ||
"reveal": "always", | ||
"panel": "new" | ||
}, | ||
"problemMatcher": [] | ||
}, | ||
{ | ||
"label": "Pylint", | ||
"detail": "Run pylint checks on the libary", | ||
"type": "shell", | ||
"command": "pylint src", | ||
"dependsOn": ["Install all Requirements"], | ||
"group": { | ||
"kind": "test", | ||
"isDefault": true | ||
}, | ||
"presentation": { | ||
"reveal": "always", | ||
"panel": "new" | ||
}, | ||
"problemMatcher": [] | ||
}, | ||
{ | ||
"label": "Code Coverage", | ||
"detail": "Generate local code coverage report.", | ||
"type": "shell", | ||
"command": "pytest --cov-report html --cov=apyhiveapi tests/apyhiveapi && pytest --cov-report html --cov=pyhiveapi --cov-append tests/pyhiveapi", | ||
"dependsOn": ["Install all Test Requirements", "Install Package Locally"], | ||
"group": { | ||
"kind": "test", | ||
"isDefault": true | ||
}, | ||
"presentation": { | ||
"reveal": "always", | ||
"panel": "new" | ||
}, | ||
"problemMatcher": [] | ||
}, | ||
{ | ||
"label": "Install all Requirements", | ||
"detail": "Install all requirements needed to run pyhiveapi/apyihiveapi ", | ||
"type": "shell", | ||
"command": "pip3 install --use-deprecated=legacy-resolver -r requirements_all.txt", | ||
"group": { | ||
"kind": "build", | ||
"isDefault": true | ||
}, | ||
"presentation": { | ||
"reveal": "always", | ||
"panel": "new" | ||
}, | ||
"problemMatcher": [] | ||
}, | ||
{ | ||
"label": "Install all Test Requirements", | ||
"detail": "Install all test requirement for pytest.", | ||
"type": "shell", | ||
"command": "pip3 install --use-deprecated=legacy-resolver -r requirements_test_all.txt", | ||
"group": { | ||
"kind": "build", | ||
"isDefault": true | ||
}, | ||
"presentation": { | ||
"reveal": "always", | ||
"panel": "new" | ||
}, | ||
"problemMatcher": [] | ||
}, | ||
{ | ||
"label": "Install Package Locally", | ||
"detail": "Install pyhiveapi/apyhiveapi locally.", | ||
"type": "shell", | ||
"command": "pip3 install --upgrade --use-deprecated=legacy-resolver .", | ||
"group": { | ||
"kind": "build", | ||
"isDefault": true | ||
}, | ||
"presentation": { | ||
"reveal": "always", | ||
"panel": "new" | ||
}, | ||
"problemMatcher": [] | ||
}, | ||
], | ||
"inputs": [] | ||
} | ||
|
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,4 +1,4 @@ | ||
recursive-include pyhiveapi * | ||
include requirements.txt | ||
include requirements_test.txt | ||
recursive-include src * | ||
include requirements_all.txt | ||
include requirements_test_all.txt | ||
recursive-include data * |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.