Skip to content

Commit

Permalink
* New test filename exception
Browse files Browse the repository at this point in the history
* Better JaCoco report logging
  • Loading branch information
benedeki committed Jun 25, 2024
1 parent 69e88bf commit 150d23e
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 7 deletions.
39 changes: 33 additions & 6 deletions .github/workflows/jacoco_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,42 @@ jobs:
run: |
echo "Total doobie coverage ${{ steps.jacoco-doobie.outputs.coverage-overall }}"
echo "Changed doobie Files coverage ${{ steps.jacoco-doobie.outputs.coverage-changed-files }}"
- name: Fail PR if changed files coverage is less than ${{ env.COVERAGE_CHANGED_EXPECTATION }}%
if: ${{ steps.jacoco-core.outputs.coverage-changed-files < env.COVERAGE_CHANGED_EXPECTATION || steps.jacoco-slick.outputs.coverage-changed-files < env.COVERAGE_CHANGED_EXPECTATION || steps.jacoco-doobie.outputs.coverage-changed-files < env.COVERAGE_CHANGED_EXPECTATION }}
- name: Fail PR if Core changed files coverage is less than ${{ env.COVERAGE_CHANGED_EXPECTATION }}%
if: ${{ steps.jacoco-core.outputs.coverage-changed-files < env.COVERAGE_CHANGED_EXPECTATION }}
uses: actions/github-script@v6
with:
script: |
core.setFailed('Changed files coverage is ${{ steps.jacoco-core.outputs.coverage-changed-files }}, less than ${{ env.COVERAGE_CHANGED_EXPECTATION }}%!')
- name: Fail PR if total files coverage is less than ${{ env.COVERAGE_OVERALL_EXPECTATION }}%
if: ${{ steps.jacoco-core.outputs.coverage-overall < env.COVERAGE_OVERALL_EXPECTATION || steps.jacoco-slick.outputs.coverage-overall < env.COVERAGE_OVERALL_EXPECTATION || steps.jacoco-doobie.outputs.coverage-overall < env.COVERAGE_OVERALL_EXPECTATION }}
core.setFailed('Core changed files coverage are ${{ steps.jacoco-core.outputs.coverage-changed-files }}%, less than ${{ env.COVERAGE_CHANGED_EXPECTATION }}%!')
- name: Fail PR if Slick changed files coverage is less than ${{ env.COVERAGE_CHANGED_EXPECTATION }}%
if: ${{ steps.jacoco-slick.outputs.coverage-changed-files < env.COVERAGE_CHANGED_EXPECTATION }}
uses: actions/github-script@v6
with:
script: |
core.setFailed('Total files coverage is ${{ steps.jacoco-core.outputs.coverage-overall }}, less than ${{ env.COVERAGE_OVERALL_EXPECTATION }}%!')
core.setFailed('Slick changed files coverage are ${{ steps.jacoco-slick.outputs.coverage-changed-files }}%, less than ${{ env.COVERAGE_CHANGED_EXPECTATION }}%!')
- name: Fail PR if Doobie changed files coverage is less than ${{ env.COVERAGE_CHANGED_EXPECTATION }}%
if: ${{ steps.jacoco-doobie.outputs.coverage-changed-files < env.COVERAGE_CHANGED_EXPECTATION }}
uses: actions/github-script@v6
with:
script: |
core.setFailed('Doobie changed files coverage are ${{ steps.jacoco-core.outputs.coverage-changed-files }}%, less than ${{ env.COVERAGE_CHANGED_EXPECTATION }}%!')
- name: Fail PR if total Core files coverage is less than ${{ env.COVERAGE_OVERALL_EXPECTATION }}%
if: ${{ steps.jacoco-core.outputs.coverage-overall < env.COVERAGE_OVERALL_EXPECTATION }}
uses: actions/github-script@v6
with:
script: |
core.setFailed('Total files coverage is ${{ steps.jacoco-core.outputs.coverage-overall }}%, less than ${{ env.COVERAGE_OVERALL_EXPECTATION }}%!')
- name: Fail PR if total Slick files coverage is less than ${{ env.COVERAGE_OVERALL_EXPECTATION }}%
if: ${{ steps.jacoco-slick.outputs.coverage-overall < env.COVERAGE_OVERALL_EXPECTATION }}
uses: actions/github-script@v6
with:
script: |
core.setFailed('Total files coverage is ${{ steps.jacoco-slick.outputs.coverage-overall }}%, less than ${{ env.COVERAGE_OVERALL_EXPECTATION }}%!')
- name: Fail PR if total Doobie files coverage is less than ${{ env.COVERAGE_OVERALL_EXPECTATION }}%
if: ${{ steps.jacoco-doobie.outputs.coverage-overall < env.COVERAGE_OVERALL_EXPECTATION }}
uses: actions/github-script@v6
with:
script: |
core.setFailed('Total files coverage is ${{ steps.jacoco-doobie.outputs.coverage-overall }}%, less than ${{ env.COVERAGE_OVERALL_EXPECTATION }}%!')
2 changes: 1 addition & 1 deletion .github/workflows/test_filenames_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ jobs:
name-patterns: '*UnitTests.*,*IntegrationTests.*'
paths: '**/src/test/scala/**'
report-format: 'console'
excludes: 'slick/src/test/scala/za/co/absa/fadb/slick/Actor.scala,slick/src/test/scala/za/co/absa/fadb/slick/ActorSlickConverter.scala,slick/src/test/scala/za/co/absa/fadb/slick/SlickTest.scala,doobie/src/test/scala/za/co/absa/fadb/doobie/DoobieTest.scala'
excludes: 'slick/src/test/scala/za/co/absa/fadb/slick/Actor.scala,slick/src/test/scala/za/co/absa/fadb/slick/ActorSlickConverter.scala,slick/src/test/scala/za/co/absa/fadb/slick/SlickTest.scala,doobie/src/test/scala/za/co/absa/fadb/doobie/DoobieTest.scala,slick/src/test/scala/za/co/absa/fadb/slick/OptionalActorSlickConverter.scala'
verbose-logging: 'false'
fail-on-violation: 'true'

0 comments on commit 150d23e

Please sign in to comment.