Skip to content

Commit

Permalink
Updated requirements
Browse files Browse the repository at this point in the history
Moved development requirements into dedicated file
Updated compile/test Workflows so that pytest does not return 1 when tests fail
  • Loading branch information
albertogeniola committed Sep 13, 2021
1 parent 77eadbd commit 4522d68
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 23 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/build-0.4.x.x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,11 @@ jobs:
MEROSS_PASSWORD: ${{ secrets.MEROSS_PASSWORD }}
run: |
pip install .
pip install -r requirements-dev.txt
# Set credentials into memory
TOKEN=$(meross_api_cli auth login --email $MEROSS_EMAIL --password "$MEROSS_PASSWORD" | base64 -w0)
# Run test
__MEROSS_CREDS=$TOKEN pytest tests --json-report --doctest-modules --junitxml=junit/test-results.xml --cov=. --cov-report=xml --cov-report=html --html=junit/test-results.html --self-contained-html
__MEROSS_CREDS=$TOKEN pytest tests --suppress-tests-failed-exit-code --json-report --doctest-modules --junitxml=junit/test-results.xml --cov=. --cov-report=xml --cov-report=html --html=junit/test-results.html --self-contained-html
# Invalidate token
__MEROSS_CREDS=$TOKEN meross_api_cli auth logout
# Parse test outcomes
Expand All @@ -114,27 +115,26 @@ jobs:
echo "::set-output name=$pythonv::$success_rate"
echo "Python ${{ matrix.python_version }}: $success_rate %" > results-${{ matrix.python_version }}.txt
continue-on-error: true
- name: Upload pytest test results
- name: Upload pytest test TXT results
uses: actions/upload-artifact@v2
with:
name: test-report-${{ matrix.python_version }}
path: results-${{ matrix.python_version }}.txt
# Use always() to always run this step to publish test results when there are test failures
if: ${{ always() }}
- name: Upload pytest test results
- name: Upload pytest test RAW results
uses: actions/upload-artifact@v2
with:
name: pytest-results-${{ matrix.python_version }}
path: junit/
# Use always() to always run this step to publish test results when there are test failures
if: ${{ always() }}

- name: Upload pytest test results
- name: Upload pytest HTML test results
uses: actions/upload-artifact@v2
with:
name: pytest-results-html-${{ matrix.python_version }}
path: htmlcov/
- name: Upload pytest test json results
- name: Upload pytest JSON test json results
uses: actions/upload-artifact@v2
with:
name: pytest-results-json-${{ matrix.python_version }}
Expand Down
8 changes: 2 additions & 6 deletions .github/workflows/build-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest --upgrade
pip install pytest-html --upgrade
pip install pytest-cov --upgrade
pip install pytest-json-report --upgrade
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi
- name: Wait a bit before running tests
run: |
echo "Waiting 120 seconds before starting..."
Expand All @@ -101,7 +97,7 @@ jobs:
# Set credentials into memory
TOKEN=$(meross_api_cli auth login --email $MEROSS_EMAIL --password "$MEROSS_PASSWORD" | base64 -w0)
# Run test
__MEROSS_CREDS=$TOKEN pytest tests --json-report --doctest-modules --junitxml=junit/test-results.xml --cov=. --cov-report=xml --cov-report=html --html=junit/test-results.html --self-contained-html
__MEROSS_CREDS=$TOKEN pytest tests --suppress-tests-failed-exit-code --json-report --doctest-modules --junitxml=junit/test-results.xml --cov=. --cov-report=xml --cov-report=html --html=junit/test-results.html --self-contained-html
# Invalidate token
__MEROSS_CREDS=$TOKEN meross_api_cli auth logout
# Parse test outcomes
Expand Down
11 changes: 11 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
paho-mqtt>=1.5.0
requests>=2.19.1
aiohttp[speedups]>=3.7.4.post0
pytest==6.2.5
pytest-html==3.1.1
pytest-cov==2.12.1
pytest-json-report==1.4.0
pytest-aiohttp==0.3.0
pytest-custom_exit_code==0.3.0
proxy.py==2.3.1
pysocks==1.7.1
4 changes: 0 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
paho-mqtt>=1.5.0
requests>=2.19.1
retrying>=1.3.3
coverage==4.5.4
aiohttp[speedups]>=3.7.4.post0
pytest-aiohttp
proxy.py
pysocks
8 changes: 1 addition & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,9 @@
'Tracker': 'https://github.com/albertogeniola/MerossIot/issues',
},
install_requires=[
'retrying>=1.3.3',
'paho-mqtt>=1.5.0',
'requests>=2.19.1',
'retrying>=1.3.3',
'aiohttp[speedups]>=3.7.4.post0',
#'coverage==4.5.4',
#'pytest-aiohttp',
#'proxy.py',
#'pysocks'
'aiohttp[speedups]>=3.7.4.post0'
],
python_requires='>=3.7',
test_suite='tests',
Expand Down

0 comments on commit 4522d68

Please sign in to comment.