Skip to content

Commit

Permalink
[#165] Excluded tests' code from coverage.
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexSkrypnyk committed May 3, 2024
1 parent cbc02e9 commit 297ca2a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-scaffold.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
run: npm --prefix=tests/scaffold ci

- name: Run tests
run: kcov --include-pattern=.sh,.bash --bash-parse-files-in-dir=. --exclude-pattern=vendor,node_modules,.scaffold-coverage-html "$(pwd)"/.scaffold-coverage-html ./tests/scaffold/node_modules/.bin/bats tests/scaffold
run: kcov --include-pattern=.sh,.bash --bash-parse-files-in-dir=. --exclude-pattern=vendor,node_modules,.coverage-html,.scaffold-coverage-html,docs,tests "$(pwd)"/.scaffold-coverage-html ./tests/scaffold/node_modules/.bin/bats tests/scaffold

- name: Upload coverage report as an artifact
uses: actions/upload-artifact@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-shell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:

- name: Run Tests and Code Coverage on Ubuntu
if: matrix.os == 'ubuntu-latest'
run: kcov --clean --include-pattern=.sh,.bash --bash-parse-files-in-dir=. --exclude-path=node_modules,vendor,.coverage-html .coverage-html ./tests/bats/node_modules/.bin/bats tests/bats
run: kcov --clean --include-pattern=.sh,.bash --bash-parse-files-in-dir=. --exclude-path=node_modules,vendor,.coverage-html,docs,tests .coverage-html ./tests/bats/node_modules/.bin/bats tests/bats
shell: bash
continue-on-error: ${{ vars.CI_TEST_IGNORE_FAILURE == '1' }}

Expand Down
4 changes: 4 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
<file>php-script</file>
<!-- #;> !PHP_COMMAND -->
</include>

<exclude>
<directory>tests</directory>
</exclude>
</source>

<coverage includeUncoveredFiles="true"
Expand Down

1 comment on commit 297ca2a

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.