Skip to content

Bug/coverage test #550

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 42 additions & 29 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,47 @@
name: Python Coverage

on: [push, pull_request]

on:
push:
pull_request:
workflow_dispatch:
jobs:
build:

runs-on: ubuntu-latest

timeout-minutes: 3

steps:
- name: Check out code
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt

- name: Run coverage
run: |
coverage run -m unittest discover
coverage html

- run: smokeshow upload htmlcov
env:
SMOKESHOW_GITHUB_STATUS_DESCRIPTION: CLI Coverage {coverage-percentage}
SMOKESHOW_GITHUB_COVERAGE_THRESHOLD: 50
SMOKESHOW_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SMOKESHOW_GITHUB_PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
- name: Check out code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Run database server in docker
run: |
docker compose create
docker compose start
echo "wait mysql server"

while :
do
if mysql -h 127.0.0.1 --user=root --execute "SELECT version();" 2>&1 >/dev/null && mysql -h 127.0.0.1 --port=3307 --user=root --execute "SELECT version();" 2>&1 >/dev/null; then
break
fi
sleep 1
done

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .
pip install pytest coverage smokeshow

- name: Run coverage
run: |
coverage run -m pytest -k "not test_no_trailing_rotate_event and not test_end_log_pos and not test_query_event_latin1"
coverage html

- run: smokeshow upload htmlcov
env:
SMOKESHOW_GITHUB_COVERAGE_THRESHOLD: 60