Skip to content

Commit 26ddb35

Browse files
authored
Merge pull request #678 from PHPCSStandards/feature/tests-add-windows-group-to-more-tests
Tests: add `@group Windows` to more tests + mention in CONTRIBUTING
2 parents d27d3b0 + eca6b24 commit 26ddb35

File tree

4 files changed

+15
-0
lines changed

4 files changed

+15
-0
lines changed

.github/CONTRIBUTING.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,13 @@ Example:
339339
for
340340
```
341341

342+
#### Tests covering code which has OS-specific behaviour
343+
344+
Most code in PHP_CodeSniffer is operating system agnostic.
345+
However, there are a few places which include OS-specific conditions, most notably for Windows.
346+
347+
Tests which cover code which have Windows specific conditions should be marked with a `@group Windows` annotation to allow for running those tests separately/selectively in CI.
348+
342349

343350
### Submitting Your Pull Request
344351

.github/workflows/test.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,11 @@ jobs:
9292
php: ['5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5']
9393
custom_ini: [false]
9494

95+
exclude:
96+
# Installing on Windows with PHP 5.4 runs into all sorts of problems (which are not ours).
97+
- php: '5.4'
98+
os: 'windows-latest'
99+
95100
include:
96101
# Skip test runs on builds which are also run in the coverage job.
97102
# Note: the tests on PHP 7.2 will still be run as the coverage build uses custom_ini settings for that version.

src/Standards/Generic/Tests/Debug/CSSLintUnitTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
* Unit test class for the CSSLint sniff.
1717
*
1818
* @covers \PHP_CodeSniffer\Standards\Generic\Sniffs\Debug\CSSLintSniff
19+
* @covers \PHP_CodeSniffer\Config::getExecutablePath
20+
* @group Windows
1921
*/
2022
final class CSSLintUnitTest extends AbstractSniffUnitTest
2123
{

tests/Core/Fixer/GenerateDiffTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
* test running the fixer itself, nor generating a diff based on a fixer run.
2222
*
2323
* @covers PHP_CodeSniffer\Fixer::generateDiff
24+
* @group Windows
2425
*/
2526
final class GenerateDiffTest extends TestCase
2627
{

0 commit comments

Comments
 (0)