Skip to content

Commit bd0bd0d

Browse files
committed
minor #3000 [CI] Make the Windows CI green (Kocal)
This PR was squashed before being merged into the 2.x branch. Discussion ---------- [CI] Make the Windows CI green | Q | A | ------------- | --- | Bug fix? | no | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Docs? | no <!-- required for new features --> | Issues | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead --> | License | MIT <!-- Replace this notice by a description of your feature/bugfix. This will help reviewers and should be a good start for the documentation. Additionally (see https://symfony.com/releases): - Always add tests and ensure they pass. - For new features, provide some code snippets to help understand usage. - Features and deprecations must be submitted against branch main. - Update/add documentation as required (we can help!) - Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry - Never break backward compatibility (see https://symfony.com/bc). --> Commits ------- e9a2b46 [Toolkit] Fix comptability with Windows 94f1391 [LiveComponent] Exclude unstable tests on Windows with `@transient`-on-windows
2 parents 49a85cc + e9a2b46 commit bd0bd0d

File tree

5 files changed

+27
-10
lines changed

5 files changed

+27
-10
lines changed

.github/workflows/unit-tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ jobs:
6565
echo COLUMNS=120 >> $GITHUB_ENV
6666
echo COMPOSER_MIN_STAB='composer config minimum-stability ${{ matrix.minimum-stability || 'stable' }} --ansi' >> $GITHUB_ENV
6767
echo COMPOSER_UP='composer update ${{ matrix.dependency-version == 'lowest' && '--prefer-lowest' || '' }} --no-progress --no-interaction --ansi' >> $GITHUB_ENV
68-
echo PHPUNIT='vendor/bin/simple-phpunit' >> $GITHUB_ENV
68+
echo PHPUNIT='vendor/bin/simple-phpunit ${{ matrix.os == 'windows-latest' && '--exclude-group transient-on-windows' || '' }}' >> $GITHUB_ENV
6969
[ 'lowest' = '${{ matrix.dependency-version }}' ] && export SYMFONY_DEPRECATIONS_HELPER=weak
7070
7171
# Swup and Typed have no tests, Turbo has its own workflow file

src/LiveComponent/tests/Functional/EventListener/LiveComponentSubscriberTest.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ public function testCanRenderComponentAsHtmlWithAlternateRoute()
9191
;
9292
}
9393

94+
/**
95+
* @group transient-on-windows
96+
*/
9497
public function testCanExecuteComponentActionNormalRoute()
9598
{
9699
$templateName = 'render_embedded_with_blocks.html.twig';
@@ -189,6 +192,9 @@ public function testPreReRenderHookOnlyExecutedDuringAjax()
189192
;
190193
}
191194

195+
/**
196+
* @group transient-on-windows
197+
*/
192198
public function testItAddsEmbeddedTemplateContextToEmbeddedComponents()
193199
{
194200
$templateName = 'render_embedded_with_blocks.html.twig';
@@ -226,6 +232,9 @@ public function testItAddsEmbeddedTemplateContextToEmbeddedComponents()
226232
;
227233
}
228234

235+
/**
236+
* @group transient-on-windows
237+
*/
229238
public function testItWorksWithNamespacedTemplateNamesForEmbeddedComponents()
230239
{
231240
$templateName = 'render_embedded_with_blocks.html.twig';
@@ -239,6 +248,9 @@ public function testItWorksWithNamespacedTemplateNamesForEmbeddedComponents()
239248
;
240249
}
241250

251+
/**
252+
* @group transient-on-windows
253+
*/
242254
public function testItUseBlocksFromEmbeddedContextUsingMultipleComponents()
243255
{
244256
$templateName = 'render_multiple_embedded_with_blocks.html.twig';
@@ -271,6 +283,9 @@ public function testItUseBlocksFromEmbeddedContextUsingMultipleComponents()
271283
;
272284
}
273285

286+
/**
287+
* @group transient-on-windows
288+
*/
274289
public function testItUseBlocksFromEmbeddedContextUsingMultipleComponentsWithNamespacedTemplate()
275290
{
276291
$templateName = 'render_multiple_embedded_with_blocks.html.twig';

src/LiveComponent/tests/Integration/LiveComponentHydratorTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ private function executeHydrationTestCase(callable $testFactory, ?int $minPhpVer
151151
}
152152

153153
/**
154+
* @group transient-on-windows
154155
* @dataProvider provideDehydrationHydrationTests
155156
*/
156157
public function testCanDehydrateAndHydrateComponentWithTestCases(callable $testFactory, ?int $minPhpVersion = null)

src/Toolkit/src/Kit/KitContextRunner.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public function findAnonymousComponentTemplate(string $name): ?string
9292
{
9393
foreach ($this->kit->getRecipes(type: RecipeType::Component) as $recipe) {
9494
foreach ($recipe->getFiles() as $file) {
95-
if (str_ends_with($file->sourceRelativePathName, str_replace(':', \DIRECTORY_SEPARATOR, $name).'.html.twig')) {
95+
if (str_ends_with($file->sourceRelativePathName, str_replace(':', '/', $name).'.html.twig')) {
9696
return $file->sourceRelativePathName;
9797
}
9898
}

src/Toolkit/tests/Command/InstallCommandTest.php

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
1515
use Symfony\Component\Filesystem\Filesystem;
16+
use Symfony\Component\Filesystem\Path;
1617
use Zenstruck\Console\Test\InteractsWithConsole;
1718

1819
class InstallCommandTest extends KernelTestCase
@@ -36,14 +37,14 @@ protected function setUp(): void
3637
public function testShouldAbleToInstallComponentTableAndItsDependencies()
3738
{
3839
$expectedFiles = [
39-
'Table/templates/components/Table.html.twig' => $this->tmpDir.'/templates/components/Table.html.twig',
40-
'Table/templates/components/Table/Body.html.twig' => $this->tmpDir.'/templates/components/Table/Body.html.twig',
41-
'Table/templates/components/Table/Caption.html.twig' => $this->tmpDir.'/templates/components/Table/Caption.html.twig',
42-
'Table/templates/components/Table/Cell.html.twig' => $this->tmpDir.'/templates/components/Table/Cell.html.twig',
43-
'Table/templates/components/Table/Footer.html.twig' => $this->tmpDir.'/templates/components/Table/Footer.html.twig',
44-
'Table/templates/components/Table/Head.html.twig' => $this->tmpDir.'/templates/components/Table/Head.html.twig',
45-
'Table/templates/components/Table/Header.html.twig' => $this->tmpDir.'/templates/components/Table/Header.html.twig',
46-
'Table/templates/components/Table/Row.html.twig' => $this->tmpDir.'/templates/components/Table/Row.html.twig',
40+
'Table/templates/components/Table.html.twig' => Path::normalize($this->tmpDir.'/templates/components/Table.html.twig'),
41+
'Table/templates/components/Table/Body.html.twig' => Path::normalize($this->tmpDir.'/templates/components/Table/Body.html.twig'),
42+
'Table/templates/components/Table/Caption.html.twig' => Path::normalize($this->tmpDir.'/templates/components/Table/Caption.html.twig'),
43+
'Table/templates/components/Table/Cell.html.twig' => Path::normalize($this->tmpDir.'/templates/components/Table/Cell.html.twig'),
44+
'Table/templates/components/Table/Footer.html.twig' => Path::normalize($this->tmpDir.'/templates/components/Table/Footer.html.twig'),
45+
'Table/templates/components/Table/Head.html.twig' => Path::normalize($this->tmpDir.'/templates/components/Table/Head.html.twig'),
46+
'Table/templates/components/Table/Header.html.twig' => Path::normalize($this->tmpDir.'/templates/components/Table/Header.html.twig'),
47+
'Table/templates/components/Table/Row.html.twig' => Path::normalize($this->tmpDir.'/templates/components/Table/Row.html.twig'),
4748
];
4849

4950
foreach ($expectedFiles as $expectedFile) {

0 commit comments

Comments
 (0)