add: coverage to toml; workflow timeout

This commit is contained in:
dvoraen 2022-12-04 04:05:55 -08:00
parent 702d0e5703
commit 20e7a7fed8
2 changed files with 118 additions and 86 deletions

View file

@ -26,6 +26,12 @@ jobs:
TESTING_DB: "sqlite3" TESTING_DB: "sqlite3"
coverage-test: true coverage-test: true
timeout-minutes: 35
env:
UNIT_TEST_SETTINGS: "--settings=settings --keepdb --parallel 4 --timing"
COVERAGE_TEST_SETTINGS: "--settings=settings --timing"
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
@ -67,12 +73,7 @@ jobs:
if: ${{ ! matrix.coverage-test }} if: ${{ ! matrix.coverage-test }}
working-directory: testing_mygame working-directory: testing_mygame
run: | run: |
evennia test \ evennia test ${{ env.UNIT_TEST_SETTINGS }} evennia
--settings=settings \
--keepdb \
--parallel 4 \
--timing \
evennia
# OBS - it's important to not run the coverage tests with --parallel, it messes up the coverage # OBS - it's important to not run the coverage tests with --parallel, it messes up the coverage
# calculation! # calculation!
@ -80,13 +81,8 @@ jobs:
if: ${{ matrix.coverage-test }} if: ${{ matrix.coverage-test }}
working-directory: testing_mygame working-directory: testing_mygame
run: | run: |
coverage run \ coverage run --rcfile=../pyproject.toml ../bin/unix/evennia test ${{ env.COVERAGE_TEST_SETTINGS }} evennia
--source=evennia \ coverage combine
--omit=*/migrations/*,*/urls.py,*/test*.py,*.sh,*.txt,*.md,*.pyc,*.service \
../bin/unix/evennia test \
--settings=settings \
--timing \
evennia
coverage xml coverage xml
coverage --version coverage --version
coverage report | grep TOTAL coverage report | grep TOTAL

View file

@ -5,17 +5,36 @@ build-backend = "setuptools.build_meta"
[project] [project]
name = "evennia" name = "evennia"
version = "1.0" version = "1.0"
maintainers = [ maintainers = [{ name = "Griatch", email = "griatch@gmail.com" }]
{ name="Griatch", email="griatch@gmail.com" },
]
description = "A full-featured toolkit and server for text-based multiplayer games (MUDs, MU*, etc)." description = "A full-featured toolkit and server for text-based multiplayer games (MUDs, MU*, etc)."
requires-python = ">=3.10" requires-python = ">=3.10"
readme = { file="README.md", content-type="text/markdown" } readme = { file = "README.md", content-type = "text/markdown" }
license = { text="BSD" } license = { text = "BSD" }
keywords = [ keywords = [
"MUD", "MUSH", "MUX", "MMO", "text-only", "multiplayer", "online", "rpg", "game", "engine", "MUD",
"framework", "text", "adventure", "telnet", "websocket", "blind", "accessible", "ascii", "MUSH",
"utf-8", "terminal", "online", "server", "beginner", "tutorials" "MUX",
"MMO",
"text-only",
"multiplayer",
"online",
"rpg",
"game",
"engine",
"framework",
"text",
"adventure",
"telnet",
"websocket",
"blind",
"accessible",
"ascii",
"utf-8",
"terminal",
"online",
"server",
"beginner",
"tutorials",
] ]
classifiers = [ classifiers = [
"Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3 :: Only",
@ -40,7 +59,7 @@ classifiers = [
"Topic :: Games/Entertainment :: Role-Playing", "Topic :: Games/Entertainment :: Role-Playing",
"Topic :: Games/Entertainment :: Simulation", "Topic :: Games/Entertainment :: Simulation",
"Topic :: Software Development :: Libraries :: Application Frameworks", "Topic :: Software Development :: Libraries :: Application Frameworks",
"Topic :: Internet :: WWW/HTTP :: WSGI :: Server" "Topic :: Internet :: WWW/HTTP :: WSGI :: Server",
] ]
dependencies = [ dependencies = [
# core dependencies # core dependencies
@ -95,7 +114,7 @@ extra = [
"scipy == 1.9.3", "scipy == 1.9.3",
# Git contrib # Git contrib
"gitpython >= 3.1.27" "gitpython >= 3.1.27",
] ]
[project.urls] [project.urls]
@ -133,3 +152,20 @@ exclude = '''
) )
''' '''
[tool.coverage]
[tool.coverage.run]
concurrency = ["multiprocessing"]
parallel = true
source = ["evennia"]
omit = [
"*/migrations/*",
"*/urls.py",
"*/test*.py",
"*.sh",
"*.txt",
"*.md",
"*.pyc",
"*.service",
]