Skip to content
This repository has been archived by the owner on Jan 5, 2023. It is now read-only.

Commit

Permalink
Merge pull request #28 from tominventisbe/add-testsuite-test-count-fo…
Browse files Browse the repository at this point in the history
…r-bitbucket-pipelines

Add testsuite tests count to fix Bitbucket pipelines ignoring output
  • Loading branch information
mavimo committed Aug 11, 2019
2 parents 3110a46 + ffced94 commit 185f8ad
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/JunitErrorFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ public function formatErrors(
}

$testsuite->setAttribute('name', 'phpstan');
$testsuite->setAttribute('tests', (string) $totalErrors);
$testsuite->setAttribute('failures', (string) $totalErrors);
}

Expand Down
10 changes: 5 additions & 5 deletions tests/JunitErrorFormatterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function dataFormatterOutputProvider(): Generator
0,
'<?xml version="1.0" encoding="UTF-8"?>
<testsuites name="static analysis">
<testsuite failures="1" name="phpstan">
<testsuite failures="1" name="phpstan" tests="1">
<testcase errors="0" failures="1" name="folder with unicode &#x1F603;/file name with &quot;spaces&quot; and unicode &#x1F603;.php:4" tests="1">
<failure message="Foo" type="error" />
</testcase>
Expand All @@ -55,7 +55,7 @@ public function dataFormatterOutputProvider(): Generator
1,
'<?xml version="1.0" encoding="UTF-8"?>
<testsuites name="static analysis">
<testsuite failures="1" name="phpstan">
<testsuite failures="1" name="phpstan" tests="1">
<testcase errors="0" failures="1" name="Generic error" tests="1">
<failure message="first generic error" type="error" />
</testcase>
Expand All @@ -71,7 +71,7 @@ public function dataFormatterOutputProvider(): Generator
0,
'<?xml version="1.0" encoding="UTF-8"?>
<testsuites name="static analysis">
<testsuite failures="4" name="phpstan">
<testsuite failures="4" name="phpstan" tests="4">
<testcase errors="0" failures="1" name="folder with unicode &#x1F603;/file name with &quot;spaces&quot; and unicode &#x1F603;.php:2" tests="1">
<failure message="Bar" type="error" />
</testcase>
Expand All @@ -96,7 +96,7 @@ public function dataFormatterOutputProvider(): Generator
2,
'<?xml version="1.0" encoding="UTF-8"?>
<testsuites name="static analysis">
<testsuite failures="2" name="phpstan">
<testsuite failures="2" name="phpstan" tests="2">
<testcase errors="0" failures="1" name="Generic error" tests="1">
<failure message="first generic error" type="error" />
</testcase>
Expand All @@ -115,7 +115,7 @@ public function dataFormatterOutputProvider(): Generator
2,
'<?xml version="1.0" encoding="UTF-8"?>
<testsuites name="static analysis">
<testsuite failures="6" name="phpstan">
<testsuite failures="6" name="phpstan" tests="6">
<testcase errors="0" failures="1" name="folder with unicode &#x1F603;/file name with &quot;spaces&quot; and unicode &#x1F603;.php:2" tests="1">
<failure message="Bar" type="error" />
</testcase>
Expand Down

0 comments on commit 185f8ad

Please sign in to comment.