Drupal\Tests\examples\Unit\YamlValidationTest contains the following code.
$examples_project_path = realpath(__DIR__ . '/../../..');
$paths = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($examples_project_path, \RecursiveDirectoryIterator::FOLLOW_SYMLINKS));
foreach ($paths as $path) {
$pathname = $path->getPathname();
if (strpos($pathname, '.yml') !== FALSE) {
if (strpos($pathname, '/config/') !== FALSE) {
$yaml_paths[] = [$pathname];
}
}
}
It should retrieve only the files that are part of this project, but it retrieves also files contained in directories added by GitLab CI when its pipelines are executed. That is why the project tests fail with the following errors.
YAML in this file contains a uuid key: /builds/project/examples/web/core/profiles/standard/config/install/system.site.yml Failed asserting that an array does not have the key 'uuid'.
YAML in this file contains a uuid key: /builds/project/examples/web/core/modules/config/tests/config_test/config/install/config_test.validation.yml Failed asserting that an array does not have the key 'uuid'.
It also retrieves files that are not YAML files, as shown by error messages like the following ones.
2) Drupal\Tests\examples\Unit\YamlValidationTest::testNoUuidsInConfig with
data set #1102 ('/builds/project/examples/vend...l.twig')
Symfony\Component\Yaml\Exception\ParseException: Malformed inline YAML
string: "{{machine_name }}" at line 1 (near "{{ machine_name }}.{{
entity_type_id }}_type.*:").
3) Drupal\Tests\examples\Unit\YamlValidationTest::testNoUuidsInConfig with
data set #1104 ('/builds/project/examples/vend...l.twig')
Symfony\Component\Yaml\Exception\ParseException: Malformed inline YAML
string: "{{machine_name }}" at line 5 (near "- {{ machine_name }}").
Issue fork examples-3458387
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
avpadernoI changed the issue summary to reflect what I discovered.
Comment #4
avpadernoComment #5
avpadernoComment #6
avpadernoComment #8
avpaderno