Skip to content
Snippets Groups Projects
Commit 8933cf42 authored by Sascha Grossenbacher's avatar Sascha Grossenbacher
Browse files

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!31Resolve #3433230 "Expand ci testing"
Pipeline #127504 failed
......@@ -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"
......@@ -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 {
......
......@@ -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]']);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment