diff --git a/.github/workflows/python-platform-test.yml b/.github/workflows/python-platform-test.yml index e28737d..19ec336 100644 --- a/.github/workflows/python-platform-test.yml +++ b/.github/workflows/python-platform-test.yml @@ -35,9 +35,9 @@ jobs: - name: Poodle example project run : | cd example - poodle + poodle --report summary --report not_found --report json --report html - name: Poodle example flat project run : | cd example2 - poodle + poodle --report summary --report not_found --report json --report html \ No newline at end of file diff --git a/.github/workflows/update-coverage.yml b/.github/workflows/update-coverage.yml index 5852479..36f09cd 100644 --- a/.github/workflows/update-coverage.yml +++ b/.github/workflows/update-coverage.yml @@ -23,21 +23,22 @@ jobs: pip install -r requirements.txt --upgrade pip install --editable . - name: pytest - run: pytest --cov=src --cov-context=test --cov-report=json:code-coverage.json || true + run: pytest --cov=src --cov-context=test --cov-report=json:code-coverage.json - name: commit-json-report - if: ${{ github.ref_name == 'main' }} + if: ${{ always() && github.ref_name == 'main' }} uses: EndBug/add-and-commit@v9 with: add: "code-coverage.json" pull: "--rebase=true --autostash" message: ':robot: Update Coverage Report' - name: artifact-html-report + if: ${{ always() }} uses: actions/upload-artifact@v3 with: name: Coverage Report path: cov-html - name: Poodle - run: poodle --report json || true + run: poodle --report json --report html - name: Upload Report HTML if: ${{ always() }} uses: actions/upload-artifact@v3 @@ -45,7 +46,7 @@ jobs: name: Mutation testing report HTML path: mutation_reports - name: save-json-report - if: ${{ github.ref_name == 'main' }} + if: ${{ always() && github.ref_name == 'main' }} uses: EndBug/add-and-commit@v9 with: add: "mutation-testing-report.json" diff --git a/README.md b/README.md index 24d4e85..6f74cd4 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ [![Homepage](https://img.shields.io/badge/Homepage-github-white?logo=github)](https://github.com/WiredNerd/poodle) -[![python>=3.9](https://img.shields.io/badge/python->=3.9-orange?logo=python&logoColor=green)](https://pypi.org/project/poodle) +[![python 3.9 - 3.12](https://img.shields.io/badge/python-3.9%20to%203.12-orange?logo=python&logoColor=green)](https://pypi.org/project/poodle) [![PyPI - Version](https://img.shields.io/pypi/v/poodle?logo=pypi&logoColor=white)](https://pypi.org/project/poodle) [![PyPI - Downloads](https://img.shields.io/pypi/dm/poodle)](https://pypistats.org/packages/poodle) [![PyPI - License](https://img.shields.io/pypi/l/poodle)](https://github.com/WiredNerd/poodle/blob/main/LICENSE) @@ -26,6 +26,7 @@ The goal of Poodle is to be highly efficient, configurable, and extendable. * Multi-Threaded execution * Highly Configurable (toml and py) * Plug in custom code +* Output reports in Text, HTML, and JSON ## Quick Start diff --git a/pyproject.toml b/pyproject.toml index ea682f4..92bdcde 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta" [project] name = "poodle" description = "Mutation Testing Tool" -version = "1.2.0" +version = "1.2.1" license = { file = "LICENSE" } keywords = [ "test", @@ -45,6 +45,12 @@ poodle = "poodle.cli:main" [tool.setuptools] +[tool.setuptools.packages.find] +where = ["src"] + +[tool.setuptools.package-data] +"poodle.templates" = ["*.*"] + [tool.pytest.ini_options] pythonpath = ["src"] testpaths = ["tests"] diff --git a/src/poodle/__init__.py b/src/poodle/__init__.py index afc4e82..0707c7a 100644 --- a/src/poodle/__init__.py +++ b/src/poodle/__init__.py @@ -8,7 +8,7 @@ from pathlib import Path from typing import Any -__version__ = "1.2.0" +__version__ = "1.2.1" class PoodleInputError(ValueError): diff --git a/src/poodle/reporters/html.py b/src/poodle/reporters/html.py index 08b7b77..91732b5 100644 --- a/src/poodle/reporters/html.py +++ b/src/poodle/reporters/html.py @@ -54,12 +54,12 @@ def report_html(config: PoodleConfig, echo: Callable, testing_results: TestingRe index_template = env.get_template("html-report-index.html.jinja") index_page = index_template.render(total=testing_results.summary, modules=modules, **common_vars) index_file = report_folder / "index.html" - index_file.write_text(index_page.strip()) + index_file.write_text(index_page.strip(), encoding="utf-8") module_template = env.get_template("html-report-module.html.jinja") for source_file, module in modules.items(): module_page = module_template.render(source_file=source_file, module=module, **common_vars) - (report_folder / module["report_file"]).write_text(module_page.strip()) + (report_folder / module["report_file"]).write_text(module_page.strip(), encoding="utf-8") echo(f"HTML Report Generated at {index_file.resolve()}") diff --git a/tests/reporters/test_html.py b/tests/reporters/test_html.py index 93b6175..570c61d 100644 --- a/tests/reporters/test_html.py +++ b/tests/reporters/test_html.py @@ -378,9 +378,15 @@ def test_report_html_output( report_folder.__truediv__.assert_has_calls( [ mock.call("index.html"), - mock.call().write_text(env.get_template.return_value.render.return_value.strip.return_value), + mock.call().write_text( + env.get_template.return_value.render.return_value.strip.return_value, + encoding="utf-8", + ), mock.call(module["report_file"]), - mock.call().write_text(env.get_template.return_value.render.return_value.strip.return_value), + mock.call().write_text( + env.get_template.return_value.render.return_value.strip.return_value, + encoding="utf-8", + ), ] )