Skip to content

Commit 58e7624

Browse files
authored
[scoped] Run e2e parallel, suck in existing tests (#16)
* run e2e in parallel * [build] run e2e test in parlalel, explicit test list and merge with existing
1 parent 8de10f6 commit 58e7624

18 files changed

Lines changed: 54 additions & 100 deletions

File tree

build/target-repository/.github/workflows/rector_run.yaml renamed to build/target-repository/.github/workflows/along_other_packages.yaml

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Rector Run
1+
name: Along Other Packages
22

33
on:
44
pull_request: null
@@ -7,30 +7,26 @@ on:
77
- main
88

99
jobs:
10-
rector_run:
10+
along_other_packages:
1111
runs-on: ubuntu-latest
1212

1313
strategy:
1414
fail-fast: false
1515
matrix:
1616
php_version: ['7.1', '7.2', '7.3', '7.4', '8.0']
1717
commands:
18-
-
19-
name: 'Finalize Entity'
20-
install: composer require doctrine/orm
21-
run: vendor/bin/rector process ../tests/fixture-finalize --config ../ci/rector-finalize.php --ansi
22-
2318
-
2419
name: 'Composer Dependency'
25-
install: composer require symfony/console 2.8
20+
install: composer require symfony/console:2.8 --ansi
2621
run: vendor/bin/rector list --debug --ansi
2722

23+
-
24+
name: 'PHP Parser 3.1'
25+
install: composer require nikic/php-parser:^3.1 --ansi
26+
2827
-
2928
name: 'Along PHPStan'
3029
install: composer require phpstan/phpstan:0.12.86 --dev --ansi
31-
run: |
32-
vendor/bin/rector list --ansi
33-
vendor/bin/phpstan -h --ansi
3430

3531
name: "PHP ${{ matrix.php_version }}"
3632

@@ -42,19 +38,19 @@ jobs:
4238
php-version: ${{ matrix.php_version }}
4339
coverage: none
4440

41+
# wait for deploy to packagist
42+
- run: sleep 70
43+
4544
- run: |
4645
mkdir standalone
4746
cd standalone
48-
# wait for deploy to packagist
49-
sleep 70
5047
5148
- run: |
52-
cd standalone
5349
# run
5450
composer require rector/rector:dev-main --dev --ansi
5551
${{ matrix.commands.install }}
52+
working-directory: standalone
5653
5754
-
58-
run: |
59-
cd standalone
60-
${{ matrix.commands.run }}
55+
run: vendor/bin/rector list --ansi
56+
working-directory: standalone
Lines changed: 20 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# This workflow runs system tests: Use the Rector application from the source
2+
# checkout to process "fixture" projects in tests/system-tests
3+
# to see if those can be processed successfully
14
name: End to End tests
25

36
on:
@@ -12,39 +15,28 @@ jobs:
1215
strategy:
1316
fail-fast: false
1417
matrix:
15-
php: ['7.4', '8.0']
18+
php_version: ['7.1', '7.2', '7.3', '7.4', '8.0']
19+
directory:
20+
- 'e2e/attributes'
21+
- 'e2e/dont-execute-code'
22+
- 'e2e/finalize'
23+
- 'e2e/parse-php7-code'
24+
- 'e2e/parse-php8-code'
25+
26+
name: End to end test - ${{ matrix.directory }}
1627

17-
name: PHP ${{ matrix.php }} system tests
1828
steps:
1929
- uses: actions/checkout@v2
2030

2131
- uses: shivammathur/setup-php@v2
2232
with:
23-
php-version: ${{ matrix.php }}
24-
coverage: none # disable xdebug, pcov
25-
26-
# This workflow runs system tests: Use the Rector application from the source
27-
# checkout to process "fixture" projects in tests/system-tests
28-
# to see if those can be processed successfully
29-
30-
- name: Generate Composer autoloaders in fixture directories
31-
run: |
32-
for FIXTURE in `find e2e -mindepth 1 -maxdepth 1 -type d`; do
33-
(cd $FIXTURE; composer install --no-progress --ansi)
34-
done
35-
36-
- name: Run system tests
37-
run: |
38-
HAS_FAILURES=0
33+
php-version: ${{ matrix.php_version }}
34+
coverage: none
3935

40-
for FIXTURE in `find e2e -mindepth 1 -maxdepth 1 -type d`; do
41-
echo "-----> Running $FIXTURE <-----"
42-
if (cd $FIXTURE; ../../bin/rector process --dry-run --clear-cache); then
43-
echo "-----> Result: OK <-----"
44-
else
45-
echo "-----> Result: FAILED <-----"
46-
HAS_FAILURES=1
47-
fi
48-
done
36+
-
37+
run: composer install --ansi
38+
working-directory: ${{ matrix.directory }}
4939

50-
exit $HAS_FAILURES
40+
-
41+
run: ../../bin/rector process --dry-run --ansi
42+
working-directory: ${{ matrix.directory }}

build/target-repository/.github/workflows/php8_attributes.yaml

Lines changed: 0 additions & 21 deletions
This file was deleted.

build/target-repository/.github/workflows/php_parser_3.yaml

Lines changed: 0 additions & 25 deletions
This file was deleted.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"autoload-dev": {
3+
"directories": ["stubs"]
4+
}
5+
}

build/target-repository/ci/rector-attributes.php renamed to build/target-repository/e2e/attributes/rector.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,10 @@
77
use Rector\Symfony\Set\SymfonySetList;
88
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
99

10-
// route class must exist and be loaded, as annotation parser uses dynamic reflection
11-
require_once __DIR__ . '/../stubs/Symfony/Component/Routing/Annotation/Route.php';
12-
1310
return static function (ContainerConfigurator $containerConfigurator): void {
1411
$containerConfigurator->import(SymfonySetList::SYMFONY_52);
1512

1613
$parameters = $containerConfigurator->parameters();
1714
$parameters->set(Option::PHP_VERSION_FEATURES, PhpVersion::PHP_80);
15+
$parameters->set(Option::SOURCE, [__DIR__ . '/src']);
1816
};

build/target-repository/tests/fixture-php8-attributes/route.php renamed to build/target-repository/e2e/attributes/src/route.php

File renamed without changes.

build/target-repository/stubs/Symfony/Component/Routing/Annotation/Route.php renamed to build/target-repository/e2e/attributes/stubs/Symfony/Component/Routing/Annotation/Route.php

File renamed without changes.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"autoload": {
3+
"psr-4": {
4+
"Rector\\e2e\\": "src"
5+
}
6+
},
7+
"require-dev": {
8+
"doctrine/orm": "^2.7"
9+
}
10+
}

build/target-repository/ci/rector-finalize.php renamed to build/target-repository/e2e/finalize/rector.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
declare(strict_types=1);
44

5-
use Rector\Core\Configuration\Option;
65
use Rector\Privatization\Rector\Class_\FinalizeClassesWithoutChildrenRector;
76
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
87

0 commit comments

Comments
 (0)