Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
automatic_updates-3285491
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
automatic_updates-3285491
Commits
097004b2
Commit
097004b2
authored
5 years ago
by
Lucas Hedding
Committed by
Lucas Hedding
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3104073
by heddn, herrzhull, drumm, hestenet, ressa: 8.8.0 tarball => 8.8.1 fails update
parent
835bf788
No related branches found
Branches containing commit
Tags
8.x-1.1
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/ProjectInfoTrait.php
+6
-0
6 additions, 0 deletions
src/ProjectInfoTrait.php
tests/src/Build/InPlaceUpdateTest.php
+30
-16
30 additions, 16 deletions
tests/src/Build/InPlaceUpdateTest.php
with
36 additions
and
16 deletions
src/ProjectInfoTrait.php
+
6
−
0
View file @
097004b2
...
...
@@ -51,6 +51,12 @@ trait ProjectInfoTrait {
},
ARRAY_FILTER_USE_BOTH
);
if
(
$system
)
{
$infos
[
'drupal'
]
=
$system
;
// From 8.8.0 onward, always use packaged for core because non-packaged
// will no longer make any sense.
if
(
version_compare
(
\Drupal
::
VERSION
,
'8.8.0'
,
'>='
))
{
$infos
[
'drupal'
][
'packaged'
]
=
TRUE
;
}
}
return
$infos
;
}
...
...
This diff is collapsed.
Click to expand it.
tests/src/Build/InPlaceUpdateTest.php
+
30
−
16
View file @
097004b2
...
...
@@ -4,6 +4,7 @@ namespace Drupal\Tests\automatic_updates\Build;
use
Drupal\automatic_updates
\Services\InPlaceUpdate
;
use
Drupal\Component\FileSystem\FileSystem
as
DrupalFilesystem
;
use
Drupal\Core\Archiver\Zip
;
use
Drupal\Tests\automatic_updates
\Build\QuickStart\QuickStartTestBase
;
use
Drupal\Tests\automatic_updates
\Traits\InstallTestTrait
;
use
GuzzleHttp\Client
;
...
...
@@ -147,7 +148,7 @@ class InPlaceUpdateTest extends QuickStartTestBase {
* @see automatic_updates_cron()
*/
public
function
testCronCoreUpdate
()
{
$this
->
installCore
(
'8.
7.6
'
);
$this
->
installCore
(
'8.
8.0
'
);
$filesystem
=
new
SymfonyFilesystem
();
$filesystem
->
chmod
(
$this
->
getWorkspaceDirectory
()
.
'/sites/default'
,
0750
);
$settings_php
=
$this
->
getWorkspaceDirectory
()
.
'/sites/default/settings.php'
;
...
...
@@ -161,9 +162,9 @@ class InPlaceUpdateTest extends QuickStartTestBase {
$this
->
assertDrupalVisit
();
$finder
=
new
Finder
();
$finder
->
files
()
->
in
(
$this
->
getWorkspaceDirectory
())
->
path
(
'core/lib/Drupal.php'
);
$finder
->
notContains
(
"/const VERSION = '8.
7.6
'/"
);
$finder
->
contains
(
"/const VERSION = '8.
7
./"
);
$this
->
assertTrue
(
$finder
->
hasResults
(),
"Expected version 8.
7
.
{
x
}
does not exist in
{
$this
->
getWorkspaceDirectory
()
}
/core/lib/Drupal.php"
);
$finder
->
notContains
(
"/const VERSION = '8.
8.0
'/"
);
$finder
->
contains
(
"/const VERSION = '8.
8
./"
);
$this
->
assertTrue
(
$finder
->
hasResults
(),
"Expected version 8.
8
.
{
x
}
does not exist in
{
$this
->
getWorkspaceDirectory
()
}
/core/lib/Drupal.php"
);
}
/**
...
...
@@ -173,20 +174,33 @@ class InPlaceUpdateTest extends QuickStartTestBase {
* The starting version.
*/
protected
function
installCore
(
$starting_version
)
{
$this
->
copyCodebase
();
// We have to fetch the tags for this shallow repo. It might not be a
// shallow clone, therefore we use executeCommand instead of assertCommand.
$this
->
executeCommand
(
'git fetch --unshallow --tags'
);
$this
->
executeCommand
(
'git reset HEAD --hard'
);
$this
->
assertCommandSuccessful
();
$this
->
executeCommand
(
"git checkout
$starting_version
-f"
);
$this
->
assertCommandSuccessful
();
$this
->
executeCommand
(
'git reset HEAD --hard'
);
$this
->
assertCommandSuccessful
();
// Get tarball of drupal core.
$drupal_tarball
=
"drupal-
$starting_version
.zip"
;
$destination
=
DrupalFileSystem
::
getOsTemporaryDirectory
()
.
DIRECTORY_SEPARATOR
.
'drupal-'
.
random_int
(
10000
,
99999
)
.
microtime
(
TRUE
);
$fs
=
new
SymfonyFilesystem
();
$fs
->
mkdir
(
$destination
);
$http_client
=
new
Client
();
$http_client
->
get
(
"https://ftp.drupal.org/files/projects/
$drupal_tarball
"
,
[
'sink'
=>
$destination
.
DIRECTORY_SEPARATOR
.
$drupal_tarball
]);
$zip
=
new
Zip
(
$destination
.
DIRECTORY_SEPARATOR
.
$drupal_tarball
);
$zip
->
extract
(
$destination
);
// Move the tarball codebase over to the test workspace.
$finder
=
new
Finder
();
$finder
->
files
()
->
ignoreUnreadableDirs
()
->
ignoreDotFiles
(
FALSE
)
->
in
(
"
$destination
/drupal-
$starting_version
"
);
$options
=
[
'override'
=>
TRUE
,
'delete'
=>
FALSE
];
$fs
->
mirror
(
"
$destination
/drupal-
$starting_version
"
,
$this
->
getWorkingPath
(),
$finder
->
getIterator
(),
$options
);
$fs
->
remove
(
"
$destination
/drupal-
$starting_version
"
);
// Copy in this module from the original code base.
$finder
=
new
Finder
();
$finder
->
files
()
->
ignoreUnreadableDirs
()
->
in
(
$this
->
getDrupalRoot
())
->
path
(
'automatic_updates'
);
$this
->
copyCodebase
(
$finder
->
getIterator
());
$fs
->
chmod
(
$this
->
getWorkspaceDirectory
()
.
'/sites/default'
,
0700
);
$this
->
executeCommand
(
'COMPOSER_DISCARD_CHANGES=true composer install --no-dev --no-interaction'
);
$this
->
assertErrorOutputContains
(
'Generating autoload files'
);
$this
->
installQuickStart
(
'minimal'
);
// Currently, this test has to use extension_discovery_scan_tests so we can
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment