Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix test reporter workflow for PRs #103

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 5 additions & 17 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: test
name: Test

on:

Expand Down Expand Up @@ -27,10 +27,7 @@ jobs:
matrix:
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]

runs-on: "ubuntu-latest"

env:
test_results_dir: test-results-${{ matrix.python-version }}
runs-on: 'ubuntu-latest'

steps:
- name: Set up Python
Expand All @@ -52,19 +49,10 @@ jobs:
- name: Test
run: |
cd src
mkdir -p ../$test_results_dir
python3 -m pytest --junitxml=../$test_results_dir/junit.xml -o junit_family=legacy
python3 -m pytest --junitxml=../${{matrix.python-version}}-junit.xml -o junit_family=legacy
- name: Upload test results
uses: actions/upload-artifact@v3
if: success() || failure()
with:
name: ${{ env.test_results_dir }}
path: ${{ env.test_results_dir }}

- name: Report tests
uses: dorny/test-reporter@v1
if: success() || failure()
with:
name: Results on Python ${{ matrix.python-version }}
path: "${{env.test_results_dir }}/junit.xml"
reporter: java-junit
name: test-results-${{matrix.python-version}}
path: ${{matrix.python-version}}-junit.xml
20 changes: 20 additions & 0 deletions .github/workflows/test_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: 'Test Report'
on:
workflow_run:
workflows: ['test']
types:
- completed
permissions:
contents: read
actions: read
checks: write
jobs:
report:
runs-on: ubuntu-latest
steps:
- uses: dorny/test-reporter@v1.7.0
with:
artifact: /test-results-(.*)/
name: 'Tests Results - $1'
path: '*junit.xml'
reporter: java-junit
4 changes: 2 additions & 2 deletions src/dinglehopper/align.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import math
import unicodedata
from math import ceil
from typing import Optional
from typing import Union

from rapidfuzz.distance import Levenshtein

Expand All @@ -15,7 +15,7 @@ def align(t1, t2):
return seq_align(s1, s2)


def score_hint(er: float, n: int) -> Optional[int]:
sadra-barikbin marked this conversation as resolved.
Show resolved Hide resolved
def score_hint(er: float, n: int) -> Union[int, None]:
"""Calculate RapidFuzz score hint for a given error rate and count.

Gives the score hint for the distance functions (= expected distance) or None if
Expand Down
2 changes: 1 addition & 1 deletion src/dinglehopper/character_error_rate.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import unicodedata
from typing import Tuple, List
from typing import List, Tuple
mikegerber marked this conversation as resolved.
Show resolved Hide resolved

from multimethod import multimethod
from uniseg.graphemecluster import grapheme_clusters
Expand Down