Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
redis
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
redis
Commits
8933cf42
Commit
8933cf42
authored
Mar 24, 2024
by
Sascha Grossenbacher
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3433230
: Expand CI testing to next minor/major, fix tests on 10.2
parent
905fbd8b
No related branches found
No related tags found
1 merge request
!31
Resolve #3433230 "Expand ci testing"
Pipeline
#127504
failed
Mar 24, 2024
Stage: build
Stage: validate
Stage: test
Changes
3
Pipelines
2
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitlab-ci.yml
+29
-14
29 additions, 14 deletions
.gitlab-ci.yml
src/Cache/CacheBase.php
+7
-1
7 additions, 1 deletion
src/Cache/CacheBase.php
tests/src/Functional/WebTest.php
+6
-6
6 additions, 6 deletions
tests/src/Functional/WebTest.php
with
42 additions
and
21 deletions
.gitlab-ci.yml
+
29
−
14
View file @
8933cf42
...
...
@@ -10,34 +10,49 @@ include:
# Start custom overrides.
#
.setup-extension
:
&setup-extension
# https://docs.gitlab.com/ee/ci/jobs/index.html#pre-collapse-sections
-
echo -e "\e[0Ksection_start:`date +%s`:my_first_section[collapsed=true]\r\e[0KInstall PHP Extensions"
-
>
if [ "$REDIS_INTERFACE" == "PhpRedis" ]; then
apt-get update
apt-get install -y --no-install-recommends $PHPIZE_DEPS
pecl install redis && docker-php-ext-enable redis
fi
-
>
if [ "$REDIS_INTERFACE" == "Relay" ]; then
apt-get update
apt-get install -y --no-install-recommends $PHPIZE_DEPS
if [ ! -f /usr/src/php.tar.xz ]; then
PHP_URL="https://www.php.net/distributions/php-`php -r "echo phpversion();"`.tar.xz"
curl -fsSL -o /usr/src/php.tar.xz "$PHP_URL"
fi
curl -sSLf -o /usr/local/bin/install-php-extensions https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions
chmod +x /usr/local/bin/install-php-extensions
PHPIZE_DEPS="autoconf dpkg-dev dpkg file g++ gcc libc-dev make pkgconf re2c" PHP_INI_DIR="/usr/local/etc/php" install-php-extensions relay
fi
-
echo -e "\e[0Ksection_end:`date +%s`:my_first_section\r\e[0K"
variables
:
_SHOW_ENVIRONMENT_VARIABLES
:
1
REDIS_HOST
:
redis
REDIS_INTERFACE
:
PhpRedis
OPT_IN_TEST_PREVIOUS_MINOR
:
1
composer
:
.
composer
-base
:
before_script
:
-
composer require --dev predis/predis --no-update
phpunit
:
.
phpunit
-base
:
parallel
:
matrix
:
-
REDIS_INTERFACE
:
-
PhpRedis
-
Predis
-
Relay
before_script
:
-
*setup-extension
services
:
-
!reference
[
.with-database
]
-
!reference
[
.with-chrome
]
-
name
:
redis:6
before_script
:
# https://docs.gitlab.com/ee/ci/jobs/index.html#pre-collapse-sections
-
echo -e "\e[0Ksection_start:`date +%s`:my_first_section[collapsed=true]\r\e[0KInstall PHP Extensions"
-
sudo sed -i 's/zend.assertions = -1/zend.assertions = 1/g' /usr/local/etc/php/php.ini
-
pecl install redis && docker-php-ext-enable redis
-
>
if [ "$REDIS_INTERFACE" == "Relay" ]; then
sudo curl -sSLf -o /usr/local/bin/install-php-extensions https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions
sudo chmod +x /usr/local/bin/install-php-extensions
sudo PHPIZE_DEPS="autoconf dpkg-dev dpkg file g++ gcc libc-dev make pkgconf re2c" PHP_INI_DIR="/usr/local/etc/php" install-php-extensions relay
fi
-
echo -e "\e[0Ksection_end:`date +%s`:my_first_section\r\e[0K"
This diff is collapsed.
Click to expand it.
src/Cache/CacheBase.php
+
7
−
1
View file @
8933cf42
...
...
@@ -158,8 +158,14 @@ abstract class CacheBase implements CacheBackendInterface {
$in_transaction
=
\Drupal
::
database
()
->
inTransaction
();
if
(
$in_transaction
)
{
if
(
empty
(
$this
->
delayedDeletions
))
{
if
(
method_exists
(
\Drupal
::
database
(),
'transactionManager'
))
{
\Drupal
::
database
()
->
transactionManager
()
->
addPostTransactionCallback
([
$this
,
'postRootTransactionCommit'
]);
}
else
{
/** @phpstan-ignore-next-line */
\Drupal
::
database
()
->
addRootTransactionEndCallback
([
$this
,
'postRootTransactionCommit'
]);
}
}
$this
->
delayedDeletions
=
array_unique
(
array_merge
(
$this
->
delayedDeletions
,
$cids
));
}
else
{
...
...
This diff is collapsed.
Click to expand it.
tests/src/Functional/WebTest.php
+
6
−
6
View file @
8933cf42
...
...
@@ -138,14 +138,14 @@ class WebTest extends BrowserTestBase {
$edit
[
"modules[field_ui][enable]"
]
=
TRUE
;
$edit
[
"modules[text][enable]"
]
=
TRUE
;
$this
->
drupalGet
(
'admin/modules'
);
$this
->
submitForm
(
$edit
,
t
(
'Install'
)
)
;
$this
->
submitForm
([],
t
(
'Continue'
)
)
;
$this
->
submitForm
(
$edit
,
'Install'
);
$this
->
submitForm
([],
'Continue'
);
$assert
=
$this
->
assertSession
();
// The order of the modules is not guaranteed, so just assert that they are
// all listed.
$assert
->
elementTextContains
(
'css'
,
'.messages--status'
,
'6 modules have been
enabled
'
);
$assert
->
elementTextContains
(
'css'
,
'.messages--status'
,
'6 modules have been'
);
$assert
->
elementTextContains
(
'css'
,
'.messages--status'
,
'Field UI'
);
$assert
->
elementTextContains
(
'css'
,
'.messages--status'
,
'Node'
);
$assert
->
elementTextContains
(
'css'
,
'.messages--status'
,
'Text'
);
...
...
@@ -160,7 +160,7 @@ class WebTest extends BrowserTestBase {
'type'
=>
$node_type
=
mb_strtolower
(
$this
->
randomMachineName
()),
];
$this
->
drupalGet
(
'admin/structure/types/add'
);
$this
->
submitForm
(
$edit
,
t
(
'Save and manage fields'
)
)
;
$this
->
submitForm
(
$edit
,
'Save and manage fields'
);
$field_name
=
mb_strtolower
(
$this
->
randomMachineName
());
$this
->
fieldUIAddNewField
(
'admin/structure/types/manage/'
.
$node_type
,
$field_name
,
NULL
,
'text'
);
...
...
@@ -171,7 +171,7 @@ class WebTest extends BrowserTestBase {
'field_'
.
$field_name
.
'[0][value]'
=>
$this
->
randomMachineName
(),
];
$this
->
drupalGet
(
'node/add/'
.
$node_type
);
$this
->
submitForm
(
$edit
,
t
(
'Save'
)
)
;
$this
->
submitForm
(
$edit
,
'Save'
);
// Test the output as anonymous user.
$this
->
drupalLogout
();
...
...
@@ -186,7 +186,7 @@ class WebTest extends BrowserTestBase {
$update
=
[
'title[0][value]'
=>
$this
->
randomMachineName
(),
];
$this
->
submitForm
(
$update
,
t
(
'Save'
)
)
;
$this
->
submitForm
(
$update
,
'Save'
);
$this
->
assertSession
()
->
responseContains
(
$update
[
'title[0][value]'
]);
$this
->
drupalGet
(
'node'
);
$this
->
assertSession
()
->
responseContains
(
$update
[
'title[0][value]'
]);
...
...
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