Skip to content

Commit

Permalink
Fix codecov + xdist
Browse files Browse the repository at this point in the history
  • Loading branch information
lexicalunit committed May 3, 2024
1 parent aa54c72 commit f340ac2
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 18 deletions.
2 changes: 2 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
[run]
branch = True
concurrency = multiprocessing
parallel = true
source = .
omit =
src/spellbot/_version.py
Expand Down
24 changes: 11 additions & 13 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,33 +75,31 @@ jobs:
- name: Checkout Source
uses: actions/checkout@v3

- name: Install Poetry
id: install-poetry
run: pipx install poetry

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'poetry'

- name: Install Dependencies
run: |
git --version
python --version
python -m pip install --upgrade pip
pip --version
pip install poetry
poetry --version
poetry install
- name: Install Packages
run: poetry install

- name: Run Tests
run: |
poetry run pytest -n auto -vv --cov --cov-report=html --cov-report=xml
run: poetry run pytest -n auto -vv --cov --cov-report=html --cov-report=xml
env:
DATABASE_URL: ${{ matrix.database-url }}

- name: Send Reports to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
env:
PYTHON: ${{ matrix.python-version }}
POSTGRES: ${{ matrix.postgres-version }}
DB_URL: ${{ matrix.database-url }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

with:
env_vars: PYTHON,POSTGRES,DB_URL
6 changes: 3 additions & 3 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ safe_licenses = [

[tool.pytest.ini_options]
addopts = """
-W ignore::DeprecationWarning --no-header --cov --cov-report=html -vv
-W ignore::DeprecationWarning --no-header --cov --cov-append --cov-report xml:coverage.xml --cov-report=html -vv
"""

[tool.poetry]
Expand Down Expand Up @@ -210,4 +210,4 @@ virtualenv = "^20"

[build-system]
build-backend = "poetry.core.masonry.api"
requires = ["poetry-core>=1.0.8"]
requires = ["poetry-core>=1.9.0"]
7 changes: 7 additions & 0 deletions tests/models/test_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ def test_user(self, factories: Factories) -> None:
assert player1.points(game2.id) == (play1.points, False)
assert player2.points(game2.id) == (play2.points, False)

def test_pending_games(self, factories: Factories) -> None:
guild = factories.guild.create()
channel = factories.channel.create(guild=guild)
game = factories.game.create(guild=guild, channel=channel)
user = factories.user.create(game=game)
assert user.pending_games() == 1


class TestModelUserWaiting:
def test_happy_path(self, factories: Factories) -> None:
Expand Down

0 comments on commit f340ac2

Please sign in to comment.