Skip to content

Commit

Permalink
[CI] Narrow tests to single job, as now takes 20 s 🚀 (#4827)
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed Aug 21, 2023
1 parent 45aabab commit c5fab3a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 41 deletions.
24 changes: 5 additions & 19 deletions .github/workflows/tests.yaml
Expand Up @@ -15,35 +15,21 @@ env:
jobs:
tests:
runs-on: ubuntu-latest
timeout-minutes: 10

strategy:
fail-fast: false
matrix:
php: ['8.1']
path:
- "tests"
- "--testsuite php-rules"
- "--testsuite other-rules"
- "--testsuite code-quality-rules"
- "--testsuite dead-code-rules"
- "--testsuite type-declaration-rules"
- "packages-tests"
- "utils-tests"

name: PHP ${{ matrix.php }} tests for ${{ matrix.path }}
timeout-minutes: 3

name: PHP 8.1 tests
steps:
- uses: actions/checkout@v3

-
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
php-version: 8.1
coverage: none
# to display warning when assert() is called, eg: on direct getArgs() on CallLike
# and check against first class callable strlen(...)
ini-values: zend.assertions=1

- uses: "ramsey/composer-install@v2"

- run: vendor/bin/phpunit ${{ matrix.path }} --colors
- run: vendor/bin/phpunit --colors
7 changes: 7 additions & 0 deletions packages-tests/Skipper/Skipper/SkipperRectorRuleTest.php
Expand Up @@ -14,6 +14,13 @@

final class SkipperRectorRuleTest extends AbstractLazyTestCase
{
protected function setUp(): void
{
// reset to make skip free and invoke resolving
self::$rectorConfig = null;
}


protected function tearDown(): void
{
// cleanup configuration
Expand Down
2 changes: 1 addition & 1 deletion packages/Testing/PHPUnit/AbstractLazyTestCase.php
Expand Up @@ -10,7 +10,7 @@

abstract class AbstractLazyTestCase extends TestCase
{
private static ?RectorConfig $rectorConfig = null;
protected static ?RectorConfig $rectorConfig = null;

/**
* @api
Expand Down
21 changes: 0 additions & 21 deletions phpunit.xml
Expand Up @@ -15,27 +15,6 @@
<directory>packages-tests</directory>
<directory>utils-tests</directory>
</testsuite>

<!-- divide the rules-tests roughly in 3 equal sized groups -->
<testsuite name="php-rules">
<directory>rules-tests/Php*</directory>
</testsuite>
<testsuite name="type-declaration-rules">
<directory>rules-tests/TypeDeclaration</directory>
</testsuite>
<testsuite name="code-quality-rules">
<directory>rules-tests/CodeQuality</directory>
</testsuite>
<testsuite name="dead-code-rules">
<directory>rules-tests/DeadCode</directory>
</testsuite>
<testsuite name="other-rules">
<directory>rules-tests/</directory>
<exclude>rules-tests/Php*</exclude>
<exclude>rules-tests/TypeDeclaration</exclude>
<exclude>rules-tests/CodeQuality</exclude>
<exclude>rules-tests/DeadCode</exclude>
</testsuite>
</testsuites>

<extensions>
Expand Down

0 comments on commit c5fab3a

Please sign in to comment.