summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAineopintojen-harjoitustyo-Algoritmit-j <github-hy-tiralabra@v.hix.fi>2024-01-12 08:48:03 +0200
committerAineopintojen-harjoitustyo-Algoritmit-j <github-hy-tiralabra@v.hix.fi>2024-01-12 08:48:03 +0200
commit790534db0d14f36e00395aada28899c43a9e9a5f (patch)
tree560706235b09b45a119ab8fc066ea5a8547d06cc
parent4ec901620ea94e8e89710576b4fc6ad1cf4b01e8 (diff)
Making use of coverage & codecov. Movining doc files to doc folder.
-rw-r--r--.coveragerc8
-rw-r--r--.github/workflows/auto.yml15
-rw-r--r--.gitignore2
-rw-r--r--README.md2
-rw-r--r--doc/muistilista.txt5
-rw-r--r--doc/määrittelydokumentti.pdf (renamed from määrittelydokumentti.pdf)bin25993 -> 25993 bytes
-rw-r--r--pyproject.toml1
-rw-r--r--tui/tui.py2
8 files changed, 31 insertions, 4 deletions
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/määrittelydokumentti.pdf b/doc/määrittelydokumentti.pdf
index 5268088..5268088 100644
--- a/määrittelydokumentti.pdf
+++ b/doc/määrittelydokumentti.pdf
Binary files 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: