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

Commit 185f8ad

Browse files
authored
Merge pull request #28 from tominventisbe/add-testsuite-test-count-for-bitbucket-pipelines
Add testsuite tests count to fix Bitbucket pipelines ignoring output
2 parents 3110a46 + ffced94 commit 185f8ad

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/JunitErrorFormatter.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ public function formatErrors(
8989
}
9090

9191
$testsuite->setAttribute('name', 'phpstan');
92+
$testsuite->setAttribute('tests', (string) $totalErrors);
9293
$testsuite->setAttribute('failures', (string) $totalErrors);
9394
}
9495

tests/JunitErrorFormatterTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function dataFormatterOutputProvider(): Generator
3939
0,
4040
'<?xml version="1.0" encoding="UTF-8"?>
4141
<testsuites name="static analysis">
42-
<testsuite failures="1" name="phpstan">
42+
<testsuite failures="1" name="phpstan" tests="1">
4343
<testcase errors="0" failures="1" name="folder with unicode &#x1F603;/file name with &quot;spaces&quot; and unicode &#x1F603;.php:4" tests="1">
4444
<failure message="Foo" type="error" />
4545
</testcase>
@@ -55,7 +55,7 @@ public function dataFormatterOutputProvider(): Generator
5555
1,
5656
'<?xml version="1.0" encoding="UTF-8"?>
5757
<testsuites name="static analysis">
58-
<testsuite failures="1" name="phpstan">
58+
<testsuite failures="1" name="phpstan" tests="1">
5959
<testcase errors="0" failures="1" name="Generic error" tests="1">
6060
<failure message="first generic error" type="error" />
6161
</testcase>
@@ -71,7 +71,7 @@ public function dataFormatterOutputProvider(): Generator
7171
0,
7272
'<?xml version="1.0" encoding="UTF-8"?>
7373
<testsuites name="static analysis">
74-
<testsuite failures="4" name="phpstan">
74+
<testsuite failures="4" name="phpstan" tests="4">
7575
<testcase errors="0" failures="1" name="folder with unicode &#x1F603;/file name with &quot;spaces&quot; and unicode &#x1F603;.php:2" tests="1">
7676
<failure message="Bar" type="error" />
7777
</testcase>
@@ -96,7 +96,7 @@ public function dataFormatterOutputProvider(): Generator
9696
2,
9797
'<?xml version="1.0" encoding="UTF-8"?>
9898
<testsuites name="static analysis">
99-
<testsuite failures="2" name="phpstan">
99+
<testsuite failures="2" name="phpstan" tests="2">
100100
<testcase errors="0" failures="1" name="Generic error" tests="1">
101101
<failure message="first generic error" type="error" />
102102
</testcase>
@@ -115,7 +115,7 @@ public function dataFormatterOutputProvider(): Generator
115115
2,
116116
'<?xml version="1.0" encoding="UTF-8"?>
117117
<testsuites name="static analysis">
118-
<testsuite failures="6" name="phpstan">
118+
<testsuite failures="6" name="phpstan" tests="6">
119119
<testcase errors="0" failures="1" name="folder with unicode &#x1F603;/file name with &quot;spaces&quot; and unicode &#x1F603;.php:2" tests="1">
120120
<failure message="Bar" type="error" />
121121
</testcase>

0 commit comments

Comments
 (0)