mirror of
https://github.com/googleapis/genai-toolbox.git
synced 2026-05-02 03:00:36 -04:00
ci: Increase unit test coverage (#466)
Add unit test for Tool invoke handler. Exclude config.go from coverage calculation. --------- Co-authored-by: Kurtis Van Gent <31518063+kurtisvg@users.noreply.github.com>
This commit is contained in:
3
.github/workflows/tests.yaml
vendored
3
.github/workflows/tests.yaml
vendored
@@ -86,6 +86,9 @@ jobs:
|
||||
|
||||
- name: Check coverage
|
||||
run: |
|
||||
FILE_TO_EXCLUDE="github.com/googleapis/genai-toolbox/internal/server/"
|
||||
ESCAPED_PATH=$(echo "$FILE_TO_EXCLUDE" | sed 's/\//\\\//g; s/\./\\\./g')
|
||||
sed -i "/^${ESCAPED_PATH}:/d" coverage.out
|
||||
total_coverage=$(go tool cover -func=coverage.out | grep "total:" | awk '{print $3}')
|
||||
echo "Total coverage: $total_coverage"
|
||||
coverage_numeric=$(echo "$total_coverage" | sed 's/%//')
|
||||
|
||||
Reference in New Issue
Block a user