julien-duponchelle / python-mysql-replication

Pure Python Implementation of MySQL replication protocol build on top of PyMYSQL
2.33k stars 679 forks source link

add code coverage test #541

Closed wannahappyaroundme closed 1 year ago

wannahappyaroundme commented 1 year ago
name: Python Coverage

on: [push, pull_request]

jobs:
  build:

    runs-on: ubuntu-latest

    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 xml

    - name: Upload coverage to Codecov
      uses: codecov/codecov-action@v2
      with:
        token: ${{ secrets.CODECOV_TOKEN }}
        file: ./coverage.xml

create coverage test github actions @BORA040126

wannahappyaroundme commented 1 year ago
name: Python Coverage and Smokeshow Test

on: [push, pull_request]

jobs:
  build:

    runs-on: ubuntu-latest

    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

    - name: Install smokeshow
      run: |
        pip install smokeshow

    - name: Host and test with smokeshow
      run: |
        smokeshow --serve htmlcov/

replace Codecov to smokeshow @BORA040126

soulee-dev commented 1 year ago
name: Python Coverage

on: [push, pull_request]

jobs:
  build:

    runs-on: ubuntu-latest

    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 cli/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 }}
dongwook-chan commented 1 year ago

Great job. This will help us remove dead codes.