Fix packages CI workflow and CoreBundle tests (#18587)

Fixes broken packages CI workflow.

Changes:
- Fix `ci_packages.yaml`: use shell variable instead of `xargs` pipe to
preserve JSON quotes
- Move `ShippingMethodRepositoryTest` from CoreBundle to root
`tests/Functional/Repository/` where it can run with full Sylius schema

The workflow regression was introduced in #18512 where `-0` flag was
removed from `xargs`. Without proper quoting, `xargs` strips JSON
quotes, causing `json_decode()` to return `null`.

Ref:
https://github.com/Sylius/Sylius/actions/runs/19752465908/job/56597855870
This commit is contained in:
Karol 2025-11-28 16:15:13 +01:00 committed by GitHub
commit ed16d2e369
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 5 additions and 10 deletions

View file

@ -98,4 +98,6 @@ jobs:
chmod +x robo.phar && sudo mv robo.phar /tmp/robo
- name: "Run pipeline"
run: find src/Sylius -mindepth 3 -maxdepth 3 -type f -name composer.json -exec dirname '{}' \; | sed -e 's/src\/Sylius\///g' | sort | jq --raw-input . | jq --slurp . | jq -c . | xargs /tmp/robo ci:packages
run: |
PACKAGES=$(find src/Sylius -mindepth 3 -maxdepth 3 -type f -name composer.json -exec dirname '{}' \; | sed -e 's/src\/Sylius\///g' | sort | jq --raw-input . | jq --slurp . | jq -c .)
/tmp/robo ci:packages "$PACKAGES"

View file

@ -11,10 +11,8 @@
declare(strict_types=1);
namespace Tests\Sylius\Bundle\CoreBundle\Doctrine\ORM;
namespace Sylius\Tests\Functional\Repository;
use Doctrine\Common\DataFixtures\Purger\ORMPurger;
use Doctrine\ORM\EntityManagerInterface;
use Fidry\AliceDataFixtures\LoaderInterface;
use Fidry\AliceDataFixtures\Persistence\PurgeMode;
use PHPUnit\Framework\Attributes\Test;
@ -88,13 +86,8 @@ final class ShippingMethodRepositoryTest extends KernelTestCase
/** @var LoaderInterface $fixtureLoader */
$fixtureLoader = self::getContainer()->get('fidry_alice_data_fixtures.loader.doctrine');
/** @var EntityManagerInterface $manager */
$manager = self::getContainer()->get('doctrine.orm.default_entity_manager');
(new ORMPurger($manager))->purge();
$fixtureLoader->load([
__DIR__ . '/ShippingMethodRepositoryTest/fixtures.yaml',
__DIR__ . '/../../DataFixtures/ORM/resources/shipping_methods_with_channel_config.yml',
], [], [], PurgeMode::createDeleteMode());
}
}