Skip to content
Snippets Groups Projects
Verified Commit 3e550838 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3439937 by alexpott: Fix core tests that fail when applying the recipes API to core

(cherry picked from commit c1d7a87031c860b3ee1d03f28a999d0c93154d59)
parent d12c3304
No related branches found
No related tags found
1 merge request!7908Recipes API on 10.3.x
......@@ -136,13 +136,61 @@ test:
- chown www-data junit-reports
- mkdir -p $BROWSERTEST_OUTPUT_DIRECTORY
- chown www-data $BROWSERTEST_OUTPUT_DIRECTORY
- REAL_EXIT_CODE=0
- |
for TEST_DIRECTORY in $TEST_DIRECTORIES
do
REPORT="${TEST_DIRECTORY//[\/]/-}-test-report.xml"
sudo --preserve-env=SIMPLETEST_DB,SIMPLETEST_BASE_URL,BROWSERTEST_OUTPUT_DIRECTORY,BROWSERTEST_OUTPUT_FILE,MINK_DRIVER_ARGS_WEBDRIVER -u www-data vendor/bin/phpunit -v -c core/phpunit.xml.dist --log-junit junit-reports/${REPORT} ${TEST_DIRECTORY}
sudo --preserve-env=SIMPLETEST_DB,SIMPLETEST_BASE_URL,BROWSERTEST_OUTPUT_DIRECTORY,BROWSERTEST_OUTPUT_FILE,MINK_DRIVER_ARGS_WEBDRIVER -u www-data vendor/bin/phpunit -v -c core/phpunit.xml.dist --log-junit junit-reports/${REPORT} ${TEST_DIRECTORY} || EXIT_CODE=$?
if [ -n "$EXIT_CODE" ]; then
REAL_EXIT_CODE=$EXIT_CODE
fi
done
- ls -lah junit-reports
- exit $REAL_EXIT_CODE
artifacts:
when: always
reports:
junit: "junit-reports/*"
core-tests:
stage: test
needs: [ build ]
dependencies:
- build
services:
- name: $_CONFIG_DOCKERHUB_ROOT/$_TARGET_DB:production
alias: database
variables:
SIMPLETEST_DB: "mysql://$MYSQL_USER:$MYSQL_PASSWORD@database/$MYSQL_DATABASE?module=mysql"
SIMPLETEST_BASE_URL: "http://localhost/subdirectory"
BROWSERTEST_OUTPUT_DIRECTORY: "sites/simpletest/browser_output"
BROWSERTEST_OUTPUT_FILE: "test-output.html"
MINK_DRIVER_ARGS_WEBDRIVER: '["chrome", {"chromeOptions": { "args": [ "--disable-gpu", "--headless" ] } }, "http://127.0.0.1:4444/wd/hub" ]'
CORE_TESTS: "core/modules/config/tests/src/Functional/ConfigImportUITest.php core/modules/jsonapi/tests/src/Functional/ConfigTestTest.php core/tests/Drupal/KernelTests/Core/Entity/ConfigEntityAdapterTest.php core/tests/Drupal/KernelTests/Core/Config/ConfigImporterTest.php core/tests/Drupal/KernelTests/Core/DependencyInjection/AutowireTest.php core/tests/Drupal/KernelTests/Core/DependencyInjection/AutoconfigurationTest.php core/tests/Drupal/KernelTests/Config/TypedConfigTest.php"
# SYMFONY_DEPRECATIONS_HELPER: "max[self]=0"
before_script:
- ln -s $CI_PROJECT_DIR /var/www/html/subdirectory
- sudo service apache2 start
script:
- mkdir sites/simpletest
- chown www-data sites/simpletest
- mkdir junit-reports
- chown www-data junit-reports
- mkdir -p $BROWSERTEST_OUTPUT_DIRECTORY
- chown www-data $BROWSERTEST_OUTPUT_DIRECTORY
- REAL_EXIT_CODE=0
- |
for CORE_TEST in $CORE_TESTS
do
REPORT="${CORE_TEST//[\/]/-}-test-report.xml"
sudo --preserve-env=SIMPLETEST_DB,SIMPLETEST_BASE_URL,BROWSERTEST_OUTPUT_DIRECTORY,BROWSERTEST_OUTPUT_FILE,MINK_DRIVER_ARGS_WEBDRIVER -u www-data vendor/bin/phpunit -v -c core/phpunit.xml.dist --log-junit junit-reports/${REPORT} ${CORE_TEST} || EXIT_CODE=$?
if [ -n "$EXIT_CODE" ]; then
REAL_EXIT_CODE=$EXIT_CODE
fi
done
- ls -lah junit-reports
- exit $REAL_EXIT_CODE
artifacts:
when: always
reports:
......
......@@ -394,11 +394,11 @@ services:
config.storage.checkpoint:
class: Drupal\Core\Config\Checkpoint\CheckpointStorage
arguments: [ '@config.storage', '@config.checkpoints', '@keyvalue' ]
tags:
- { name: event_subscriber }
Drupal\Core\Config\Checkpoint\CheckpointStorageInterface: '@config.storage.checkpoint'
config.checkpoints:
class: Drupal\Core\Config\Checkpoint\LinearHistory
arguments: [ '@state', '@datetime.time' ]
Drupal\Core\Config\Checkpoint\CheckpointListInterface: '@config.checkpoints'
config.import_transformer:
class: Drupal\Core\Config\ImportStorageTransformer
arguments: ['@event_dispatcher', '@database', '@lock', '@lock.persistent']
......
......@@ -324,4 +324,16 @@ public function setArray(array $value): static {
return $this;
}
/**
* {@inheritdoc}
*/
public function toArray() {
$properties = parent::toArray();
// Only export the 'array_property' is there is data.
if (empty($properties['array_property'])) {
unset($properties['array_property']);
}
return $properties;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment