Skip to content

Commit

Permalink
Adds code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
gurkanindibay committed Oct 30, 2021
1 parent e8e85a1 commit df943f6
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 7 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/code-coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Code coverage

env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
MICROSOFT_EMAIL: [email protected]
USER_NAME: Gurkan Indibay
MAIN_BRANCH: all-citus
DB_USER_NAME: ${{ secrets.STATS_DB_USER_NAME }}
DB_PASSWORD: ${{ secrets.STATS_DB_PASSWORD }}
DB_HOST_AND_PORT: ${{ secrets.STATS_DB_HOST_AND_PORT }}
DB_NAME: ${{ secrets.STATS_DB_NAME }}
PACKAGE_CLOUD_API_TOKEN: ${{ secrets.PACKAGE_CLOUD_API_TOKEN }}
PACKAGE_CLOUD_ADMIN_API_TOKEN: ${{ secrets.PACKAGE_CLOUD_ADMIN_API_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
PACKAGING_PASSPHRASE: ${{ secrets.PACKAGING_PASSPHRASE }}
PLATFORM: el/8
on:
push:
branches:
- "**"

workflow_dispatch:

jobs:
make-install:
runs-on: ubuntu-latest

steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Install all scripts
run: make && sudo make install

code_coverage:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Define git credentials
run: git config --global user.email "${MICROSOFT_EMAIL}"&& git config --global user.name "${USER_NAME}"

- name: Install package dependencies
run: sudo apt-get update && sudo apt-get install libcurl4-openssl-dev libssl-dev python3-testresources

- name: Install python requirements
run: python -m pip install -r packaging_automation/requirements.txt

- name: Run code coverage
run: python -m pytest --cov=packaging_automation packaging_automation/tests/
12 changes: 6 additions & 6 deletions .github/workflows/tool-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,19 @@ jobs:
run: python -m prospector

- name: Unit tests for "Common tools"
run: python -m pytest -q packaging_automation/tests/test_common_tool_methods.py
run: coverage run -m pytest -q packaging_automation/tests/test_common_tool_methods.py

- name: Unit tests for "Update Package Properties"
run: python -m pytest -q packaging_automation/tests/test_update_package_properties.py
run: coverage run --cov-append -m pytest -q packaging_automation/tests/test_update_package_properties.py

- name: Unit tests for "Prepare Release"
run: python -m pytest -q packaging_automation/tests/test_prepare_release.py
run: coverage run --cov-append -m pytest -q packaging_automation/tests/test_prepare_release.py

- name: Unit tests for "Update Docker"
run: python -m pytest -q packaging_automation/tests/test_update_docker.py
run: coverage run --cov-append -m pytest -q packaging_automation/tests/test_update_docker.py

- name: Unit tests for "Update Pgxn"
run: python -m pytest -q packaging_automation/tests/test_update_pgxn.py
run: coverage run --cov-append -m pytest -q packaging_automation/tests/test_update_pgxn.py

- name: Packaging Warning Handler
run: python -m pytest -q packaging_automation/tests/test_packaging_warning_handler.py
run: coverage run --cov-append -m pytest -q packaging_automation/tests/test_packaging_warning_handler.py
1 change: 1 addition & 0 deletions packaging_automation/requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ urllib3
wheel
python-dotenv
prospector[with_everything]
pytest-cov
10 changes: 9 additions & 1 deletion packaging_automation/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ cffi==1.14.5
# via pynacl
chardet==4.0.0
# via requests
coverage[toml]==6.0.2
# via pytest-cov
deprecated==1.2.12
# via pygithub
docker==5.0.0
Expand Down Expand Up @@ -130,8 +132,12 @@ pyparsing==2.4.7
# via packaging
pyroma==3.2
# via prospector
pytest==6.2.4
pytest-cov==3.0.0
# via -r requirements.in
pytest==6.2.4
# via
# -r requirements.in
# pytest-cov
python-dotenv==0.19.0
# via -r requirements.in
python-gnupg==0.4.7
Expand Down Expand Up @@ -173,6 +179,8 @@ toml==0.10.2
# pylint
# pytest
# vulture
tomli==1.2.1
# via coverage
typing-extensions==3.10.0.2
# via mypy
urllib3==1.26.6
Expand Down

0 comments on commit df943f6

Please sign in to comment.