From 790534db0d14f36e00395aada28899c43a9e9a5f Mon Sep 17 00:00:00 2001 From: Aineopintojen-harjoitustyo-Algoritmit-j Date: Fri, 12 Jan 2024 08:48:03 +0200 Subject: Making use of coverage & codecov. Movining doc files to doc folder. --- .coveragerc | 8 ++++++++ .github/workflows/auto.yml | 15 +++++++++++++-- .gitignore | 2 ++ README.md | 2 +- doc/muistilista.txt | 5 +++++ "doc/m\303\244\303\244rittelydokumentti.pdf" | Bin 0 -> 25993 bytes "m\303\244\303\244rittelydokumentti.pdf" | Bin 25993 -> 0 bytes pyproject.toml | 1 + tui/tui.py | 2 +- 9 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 .coveragerc create mode 100644 doc/muistilista.txt create mode 100644 "doc/m\303\244\303\244rittelydokumentti.pdf" delete mode 100644 "m\303\244\303\244rittelydokumentti.pdf" diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 0000000..7b967e8 --- /dev/null +++ b/.coveragerc @@ -0,0 +1,8 @@ +[run] +branch = True +omit = tests/* + +[report] +exclude_lines = + if __name__ == .__main__.: + diff --git a/.github/workflows/auto.yml b/.github/workflows/auto.yml index d4c744b..b360e1c 100644 --- a/.github/workflows/auto.yml +++ b/.github/workflows/auto.yml @@ -34,5 +34,16 @@ jobs: run: poetry install # Run unittests - - name: Run unittests - run: poetry run python3 -m pytest -v + - name: Run unittests with coverage + run: poetry run python3 -m coverage run --branch -m pytest -v + + # coverage -> xml + - name: Generate coverage report + run: poetry run python3 -m coverage xml + + # xml -> codecov + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v3 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + diff --git a/.gitignore b/.gitignore index b955cfc..cb985f3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ *~ poetry.lock __pycache__ +.coverage +coverage.xml diff --git a/README.md b/README.md index 087cde2..356adb1 100644 --- a/README.md +++ b/README.md @@ -3,5 +3,5 @@ Miinaharava ratkaisijalla ## Dokumentit: -- [määrittelydokumentti](m%C3%A4%C3%A4rittelydokumentti.pdf) +- [määrittelydokumentti](doc/m%C3%A4%C3%A4rittelydokumentti.pdf) diff --git a/doc/muistilista.txt b/doc/muistilista.txt new file mode 100644 index 0000000..e6b8a2b --- /dev/null +++ b/doc/muistilista.txt @@ -0,0 +1,5 @@ +MUISTILISTA! + +Generoi haarakattavuusraportti: +poetry run python3 -m coverage run --branch -m pytest && poetry run python3 -m coverage html && firefox htmlcov/index.html + diff --git "a/doc/m\303\244\303\244rittelydokumentti.pdf" "b/doc/m\303\244\303\244rittelydokumentti.pdf" new file mode 100644 index 0000000..5268088 Binary files /dev/null and "b/doc/m\303\244\303\244rittelydokumentti.pdf" differ diff --git "a/m\303\244\303\244rittelydokumentti.pdf" "b/m\303\244\303\244rittelydokumentti.pdf" deleted file mode 100644 index 5268088..0000000 Binary files "a/m\303\244\303\244rittelydokumentti.pdf" and /dev/null differ diff --git a/pyproject.toml b/pyproject.toml index 2b936e4..90d7851 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,6 +11,7 @@ python = "^3.10" [tool.poetry.group.dev.dependencies] pytest = "^7.4.4" +coverage = "^7.4.0" [build-system] requires = ["poetry-core"] diff --git a/tui/tui.py b/tui/tui.py index 1672d7d..ed997a4 100644 --- a/tui/tui.py +++ b/tui/tui.py @@ -42,7 +42,7 @@ class Tui(): (' ', 7, 0), ('1', 10, 0), ('2', 12, 0), ('3', 11, 0), ('4', 9, 0), ('5', 9, 0), ('6', 9, 0), ('7', 9, 0), ('8', 9, 0), - ('9', 15, 1), ('#', 8, 7) + ('¤', 15, 1), ('#', 8, 7) ) if hilighted: -- cgit v1.2.3