From 474837a959a0937eea7db1db8adecac4d4dd7c71 Mon Sep 17 00:00:00 2001 From: Stefan Kairinos Date: Wed, 17 Apr 2024 14:12:11 +0100 Subject: [PATCH 1/2] fix: polish tests (#111) * fix: add test coverage * use xml * rename codecov yaml * add yml path * ignore codeforlife test helpers * reset pipeline * reset pipeline --- .github/workflows/main.yml | 2 +- Pipfile | 1 + Pipfile.lock | 76 ++++++++++++++++++++++++++++++++++++-- codecov.yml | 10 +++++ pyproject.toml | 5 +++ 5 files changed, 90 insertions(+), 4 deletions(-) create mode 100644 codecov.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 89db26b..3de418f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -33,7 +33,7 @@ jobs: fetch-depth: 0 - name: 🐍 Set up Python ${{ env.PYTHON_VERSION }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ env.PYTHON_VERSION }} diff --git a/Pipfile b/Pipfile index f702c0e..ae7bb08 100644 --- a/Pipfile +++ b/Pipfile @@ -26,6 +26,7 @@ phonenumbers = "==8.12.12" # TODO: remove [dev-packages] black = "==23.1.0" pytest = "==7.2.1" +pytest-cov = "==5.0.0" pytest-env = "==0.8.1" pytest-xdist = {version = "==3.5.0", extras = ["psutil"]} pytest-django = "==4.5.2" diff --git a/Pipfile.lock b/Pipfile.lock index e0e310f..19ef38b 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "bde2bbcff41e1dfa67036ae9cc505d55d74f65295182ca7c981d8de42e6ae512" + "sha256": "55cb731b36164d9e37ceb359e02999bf7c2eb83d0c77d613e8822d7d0224d83a" }, "pipfile-spec": 6, "requires": { @@ -856,7 +856,7 @@ "sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3", "sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427" ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2'", + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", "version": "==2.9.0.post0" }, "pytz": { @@ -1005,7 +1005,7 @@ "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926", "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254" ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2'", + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", "version": "==1.16.0" }, "sortedcontainers": { @@ -1270,6 +1270,67 @@ "markers": "python_version >= '3.7'", "version": "==8.1.7" }, + "coverage": { + "extras": [ + "toml" + ], + "hashes": [ + "sha256:00838a35b882694afda09f85e469c96367daa3f3f2b097d846a7216993d37f4c", + "sha256:0513b9508b93da4e1716744ef6ebc507aff016ba115ffe8ecff744d1322a7b63", + "sha256:09c3255458533cb76ef55da8cc49ffab9e33f083739c8bd4f58e79fecfe288f7", + "sha256:09ef9199ed6653989ebbcaacc9b62b514bb63ea2f90256e71fea3ed74bd8ff6f", + "sha256:09fa497a8ab37784fbb20ab699c246053ac294d13fc7eb40ec007a5043ec91f8", + "sha256:0f9f50e7ef2a71e2fae92774c99170eb8304e3fdf9c8c3c7ae9bab3e7229c5cf", + "sha256:137eb07173141545e07403cca94ab625cc1cc6bc4c1e97b6e3846270e7e1fea0", + "sha256:1f384c3cc76aeedce208643697fb3e8437604b512255de6d18dae3f27655a384", + "sha256:201bef2eea65e0e9c56343115ba3814e896afe6d36ffd37bab783261db430f76", + "sha256:38dd60d7bf242c4ed5b38e094baf6401faa114fc09e9e6632374388a404f98e7", + "sha256:3b799445b9f7ee8bf299cfaed6f5b226c0037b74886a4e11515e569b36fe310d", + "sha256:3ea79bb50e805cd6ac058dfa3b5c8f6c040cb87fe83de10845857f5535d1db70", + "sha256:40209e141059b9370a2657c9b15607815359ab3ef9918f0196b6fccce8d3230f", + "sha256:41c9c5f3de16b903b610d09650e5e27adbfa7f500302718c9ffd1c12cf9d6818", + "sha256:54eb8d1bf7cacfbf2a3186019bcf01d11c666bd495ed18717162f7eb1e9dd00b", + "sha256:598825b51b81c808cb6f078dcb972f96af96b078faa47af7dfcdf282835baa8d", + "sha256:5fc1de20b2d4a061b3df27ab9b7c7111e9a710f10dc2b84d33a4ab25065994ec", + "sha256:623512f8ba53c422fcfb2ce68362c97945095b864cda94a92edbaf5994201083", + "sha256:690db6517f09336559dc0b5f55342df62370a48f5469fabf502db2c6d1cffcd2", + "sha256:69eb372f7e2ece89f14751fbcbe470295d73ed41ecd37ca36ed2eb47512a6ab9", + "sha256:73bfb9c09951125d06ee473bed216e2c3742f530fc5acc1383883125de76d9cd", + "sha256:742a76a12aa45b44d236815d282b03cfb1de3b4323f3e4ec933acfae08e54ade", + "sha256:7c95949560050d04d46b919301826525597f07b33beba6187d04fa64d47ac82e", + "sha256:8130a2aa2acb8788e0b56938786c33c7c98562697bf9f4c7d6e8e5e3a0501e4a", + "sha256:8a2b2b78c78293782fd3767d53e6474582f62443d0504b1554370bde86cc8227", + "sha256:8ce1415194b4a6bd0cdcc3a1dfbf58b63f910dcb7330fe15bdff542c56949f87", + "sha256:9ca28a302acb19b6af89e90f33ee3e1906961f94b54ea37de6737b7ca9d8827c", + "sha256:a4cdc86d54b5da0df6d3d3a2f0b710949286094c3a6700c21e9015932b81447e", + "sha256:aa5b1c1bfc28384f1f53b69a023d789f72b2e0ab1b3787aae16992a7ca21056c", + "sha256:aadacf9a2f407a4688d700e4ebab33a7e2e408f2ca04dbf4aef17585389eff3e", + "sha256:ae71e7ddb7a413dd60052e90528f2f65270aad4b509563af6d03d53e979feafd", + "sha256:b14706df8b2de49869ae03a5ccbc211f4041750cd4a66f698df89d44f4bd30ec", + "sha256:b1a93009cb80730c9bca5d6d4665494b725b6e8e157c1cb7f2db5b4b122ea562", + "sha256:b2991665420a803495e0b90a79233c1433d6ed77ef282e8e152a324bbbc5e0c8", + "sha256:b2c5edc4ac10a7ef6605a966c58929ec6c1bd0917fb8c15cb3363f65aa40e677", + "sha256:b4d33f418f46362995f1e9d4f3a35a1b6322cb959c31d88ae56b0298e1c22357", + "sha256:b91cbc4b195444e7e258ba27ac33769c41b94967919f10037e6355e998af255c", + "sha256:c74880fc64d4958159fbd537a091d2a585448a8f8508bf248d72112723974cbd", + "sha256:c901df83d097649e257e803be22592aedfd5182f07b3cc87d640bbb9afd50f49", + "sha256:cac99918c7bba15302a2d81f0312c08054a3359eaa1929c7e4b26ebe41e9b286", + "sha256:cc4f1358cb0c78edef3ed237ef2c86056206bb8d9140e73b6b89fbcfcbdd40e1", + "sha256:ccd341521be3d1b3daeb41960ae94a5e87abe2f46f17224ba5d6f2b8398016cf", + "sha256:ce4b94265ca988c3f8e479e741693d143026632672e3ff924f25fab50518dd51", + "sha256:cf271892d13e43bc2b51e6908ec9a6a5094a4df1d8af0bfc360088ee6c684409", + "sha256:d5ae728ff3b5401cc320d792866987e7e7e880e6ebd24433b70a33b643bb0384", + "sha256:d71eec7d83298f1af3326ce0ff1d0ea83c7cb98f72b577097f9083b20bdaf05e", + "sha256:d898fe162d26929b5960e4e138651f7427048e72c853607f2b200909794ed978", + "sha256:d89d7b2974cae412400e88f35d86af72208e1ede1a541954af5d944a8ba46c57", + "sha256:dfa8fe35a0bb90382837b238fff375de15f0dcdb9ae68ff85f7a63649c98527e", + "sha256:e0be5efd5127542ef31f165de269f77560d6cdef525fffa446de6f7e9186cfb2", + "sha256:fdfafb32984684eb03c2d83e1e51f64f0906b11e64482df3c5db936ce3839d48", + "sha256:ff7687ca3d7028d8a5f0ebae95a6e4827c5616b31a4ee1192bdfde697db110d4" + ], + "markers": "python_version >= '3.8'", + "version": "==7.4.4" + }, "dill": { "hashes": [ "sha256:3ebe3c479ad625c4553aca177444d89b486b1d84982eeacded644afc0cf797ca", @@ -1523,6 +1584,15 @@ "markers": "python_version >= '3.7'", "version": "==7.2.1" }, + "pytest-cov": { + "hashes": [ + "sha256:4f0764a1219df53214206bf1feea4633c3b558a2925c8b59f144f682861ce652", + "sha256:5837b58e9f6ebd335b0f8060eecce69b662415b16dc503883a02f45dfeb14857" + ], + "index": "pypi", + "markers": "python_version >= '3.8'", + "version": "==5.0.0" + }, "pytest-django": { "hashes": [ "sha256:c60834861933773109334fe5a53e83d1ef4828f2203a1d6a0fa9972f4f75ab3e", diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000..e5d28c1 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,10 @@ +coverage: + precision: 2 + round: down + range: 90...90 + status: + patch: + default: + target: 90% + +comment: false diff --git a/pyproject.toml b/pyproject.toml index dd932e4..1a3c55f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,6 +11,7 @@ extend-exclude = ".*/migrations/.*py" [tool.pytest.ini_options] env = ["DJANGO_SETTINGS_MODULE=manage"] +addopts = "--cov --cov-report=xml" [tool.mypy] plugins = ["mypy_django_plugin.main", "mypy_drf_plugin.main"] @@ -34,3 +35,7 @@ load-plugins = "pylint_django" profile = "black" line_length = 80 skip_glob = ["**/migrations/*.py"] + +[tool.coverage.run] +include = ["codeforlife/*"] +omit = ["*/test_*.py", "*/*_test.py", "codeforlife/tests/*"] From 7afecd7e217c9c8d3887e4635a5a895bab732c59 Mon Sep 17 00:00:00 2001 From: semantic-release Date: Wed, 17 Apr 2024 13:14:32 +0000 Subject: [PATCH 2/2] 0.16.3 Automatically generated by python-semantic-release --- CHANGELOG.md | 6 ++++++ codeforlife/version.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d23933..61e8352 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ +## v0.16.3 (2024-04-17) + +### Fix + +* Polish tests ([#111](https://github.com/ocadotechnology/codeforlife-package-python/issues/111)) ([`474837a`](https://github.com/ocadotechnology/codeforlife-package-python/commit/474837a959a0937eea7db1db8adecac4d4dd7c71)) + ## v0.16.2 (2024-04-16) ### Fix diff --git a/codeforlife/version.py b/codeforlife/version.py index 58cddca..591c818 100644 --- a/codeforlife/version.py +++ b/codeforlife/version.py @@ -5,4 +5,4 @@ # Do NOT set manually! # This is auto-updated by python-semantic-release in the pipeline. -__version__ = "0.16.2" +__version__ = "0.16.3"