Skip to content
Snippets Groups Projects
Commit 34e72b15 authored by Ted Bowman's avatar Ted Bowman
Browse files

Issue #3411392: Build tests fail on core merge requests

parent db6979fd
No related branches found
No related tags found
1 merge request!1012Resolve #3411392 "Core mr build tests"
Pipeline #69654 passed
......@@ -270,6 +270,10 @@ END;
// Allow pre-release versions of dependencies.
$this->runComposer('composer config minimum-stability dev', $template_dir);
// CORE_MR_ONLY:// Allow any version of Drupal core as in test using a git clone on Gitlab
// CORE_MR_ONLY:// core will be checked out at a specific commit hash.
// CORE_MR_ONLY:$this->runComposer("composer require --no-update drupal/core:'*'", "composer/Metapackage/CoreRecommended");
// Remove the packages.drupal.org entry (and any other custom repository)
// from the template's repositories section. We have no reliable way of
// knowing the repositories' names in advance, so we get that information
......
......@@ -155,7 +155,15 @@ class ConverterCommand extends Command {
static::info("Applying core patches");
print_r($patches);
foreach ($patches as $file) {
static::executeCommand("patch -d{$this->core_dir} -p1 < $file");
$patch_result = NULL;
$output = [];
// Patch but ignore previously applied patches.
exec("patch -d{$this->core_dir} -p1 -N -r - < $file", $output, $patch_result);
if ($patch_result !== 0) {
if (!str_contains(implode("\n", $output), 'Ignoring previously applied (or reversed) patch.')) {
throw new \Exception("Patch failed: $file");
}
}
}
// Switch to the core directory and require all of the packages there are in
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment