Skip to content
Snippets Groups Projects
Commit f4491ea6 authored by Piotr Maślanka's avatar Piotr Maślanka
Browse files

fix coverage

parent 2e429bec
No related branches found
No related tags found
No related merge requests found
# Auto detect text files and perform LF normalization # Auto detect text files and perform LF normalization
* text=auto * text=auto
*.sh text eol=lf *.sh text eol=lf
*.yml text eol=lf
# Custom for Visual Studio # Custom for Visual Studio
*.cs diff=csharp *.cs diff=csharp
*.sln merge=union *.sln merge=union
......
...@@ -4,6 +4,7 @@ on: [ push ] ...@@ -4,6 +4,7 @@ on: [ push ]
jobs: jobs:
tests: tests:
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
environment: Env1
strategy: strategy:
matrix: matrix:
python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11", "3.12" ] python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11", "3.12" ]
...@@ -12,26 +13,27 @@ jobs: ...@@ -12,26 +13,27 @@ jobs:
- uses: actions/setup-python@main - uses: actions/setup-python@main
with: with:
python-version: ${{ matrix.python-version }} python-version: ${{ matrix.python-version }}
cache: 'pip' cache: pip
- name: Install everything
run: |
sudo apt-get update
sudo apt-get install -y python3-setuptools python3-yaml
pip install -U pip setuptools wheel disttools packaging
pip install -e .[test,dev]
pip install -U pytest-xdist pytest-cov pytest pytest-forked pluggy py opentracing
- name: Before the coverage - name: Before the coverage
run: | run: |
wget https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 wget https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64
chmod ugo+x test-reporter-latest-linux-amd64 chmod ugo+x test-reporter-latest-linux-amd64
./test-reporter-latest-linux-amd64 before-build ./test-reporter-latest-linux-amd64 before-build
env: env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
- name: Install everything
run: |
sudo apt-get update
sudo apt-get install -y python3-setuptools python3-yaml
pip install -U pip setuptools wheel disttools packaging pyproject.toml
- name: Install tools
run: pip install ".[test,dev]"
- name: Test - name: Test
run: pytest -n 8 -vv --cov=satella run: pytest -n 8 -vv --cov=satella
- name: Submit the code coverage - name: Submit the code coverage
run: | run: |
./test-reporter-latest-linux-amd64 after-build coverage xml
./test-reporter-latest-linux-amd64 after-build -t coverage.py
./test-reporter-latest-linux-amd64 format-coverage -t coverage.py -o codeclimate.json ./test-reporter-latest-linux-amd64 format-coverage -t coverage.py -o codeclimate.json
./test-reporter-latest-linux-amd64 upload-coverage -i codeclimate.json ./test-reporter-latest-linux-amd64 upload-coverage -i codeclimate.json
env: env:
...@@ -68,6 +70,7 @@ jobs: ...@@ -68,6 +70,7 @@ jobs:
runs-on: "ubuntu-20.04" runs-on: "ubuntu-20.04"
needs: [ "build-project", "tests" ] needs: [ "build-project", "tests" ]
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
environment: Env1
steps: steps:
- uses: actions/setup-python@main - uses: actions/setup-python@main
name: Setup Python name: Setup Python
......
...@@ -31,11 +31,9 @@ version = { attr = "satella.__version__" } ...@@ -31,11 +31,9 @@ version = { attr = "satella.__version__" }
[project.optional-dependencies] [project.optional-dependencies]
dev = ["pylint", "toml", "requests", "codeclimate-test-reporter", "opentracing"] dev = ["pylint", "toml", "requests", "codeclimate-test-reporter", "opentracing"]
# at most coverage 4.3 can be used because CodeClimate's test reporter is a bit stupid test = ["pytest-cov", "pytest-xdist", "pytest", "pytest-forked", "pluggy", "py", "coverage"]
test = ["pytest-cov", "pytest-xdist<=1.34.0", "pytest", "pytest-forked", "pluggy", "py", "coverage<4.4"]
extras = ["requests", "pyyaml", "toml", "ujson", "cassandra-driver", "opentracing"] extras = ["requests", "pyyaml", "toml", "ujson", "cassandra-driver", "opentracing"]
[build-system] [build-system]
requires = ["setuptools", "setuptools-scm"] requires = ["setuptools", "setuptools-scm"]
build-backend = "setuptools.build_meta" build-backend = "setuptools.build_meta"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment