diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 795d1845f6..27b1aa42ba 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -339,6 +339,13 @@ Example: for ``` +#### Tests covering code which has OS-specific behaviour + +Most code in PHP_CodeSniffer is operating system agnostic. +However, there are a few places which include OS-specific conditions, most notably for Windows. + +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. + ### Submitting Your Pull Request diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6645cb7f7f..0113b7e8a7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -92,6 +92,11 @@ jobs: 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'] custom_ini: [false] + exclude: + # Installing on Windows with PHP 5.4 runs into all sorts of problems (which are not ours). + - php: '5.4' + os: 'windows-latest' + include: # Skip test runs on builds which are also run in the coverage job. # Note: the tests on PHP 7.2 will still be run as the coverage build uses custom_ini settings for that version. diff --git a/src/Standards/Generic/Tests/Debug/CSSLintUnitTest.php b/src/Standards/Generic/Tests/Debug/CSSLintUnitTest.php index 83f875cb0f..e4afa67b63 100644 --- a/src/Standards/Generic/Tests/Debug/CSSLintUnitTest.php +++ b/src/Standards/Generic/Tests/Debug/CSSLintUnitTest.php @@ -16,6 +16,8 @@ * Unit test class for the CSSLint sniff. * * @covers \PHP_CodeSniffer\Standards\Generic\Sniffs\Debug\CSSLintSniff + * @covers \PHP_CodeSniffer\Config::getExecutablePath + * @group Windows */ final class CSSLintUnitTest extends AbstractSniffUnitTest { diff --git a/tests/Core/Fixer/GenerateDiffTest.php b/tests/Core/Fixer/GenerateDiffTest.php index 9b3f115e40..b7902bbe61 100644 --- a/tests/Core/Fixer/GenerateDiffTest.php +++ b/tests/Core/Fixer/GenerateDiffTest.php @@ -21,6 +21,7 @@ * test running the fixer itself, nor generating a diff based on a fixer run. * * @covers PHP_CodeSniffer\Fixer::generateDiff + * @group Windows */ final class GenerateDiffTest extends TestCase {