Commit 36c2da78 authored by Project Update Bot's avatar Project Update Bot Committed by Dave Reid
Browse files

Issue #3289328 by Project Update Bot: Automated Drupal 10 compatibility fixes

parent 8bf4767f
Loading
Loading
Loading
Loading

.circleci/config.yml

deleted100644 → 0
+0 −161
Original line number Diff line number Diff line
# Default configuration file for Drupal modules.
#
# Use setup.sh to automate setting this up. Otherwise, to use this in a new
# module:
#   1. Copy config.yml to the module's .circleci directory.
#   2. Change 'latest' in the image tag to the latest tag.
#   3. Update the working_directory key.
#   4. Connect CircleCI to the repository through the Circle UI.
#   5. Set the COMPOSER_AUTH environment variable in Circle to grant access to
#      any private repositories.
#   6. Create a status badge embed code in Circle and add it to the README.md.
#
# Check https://circleci.com/docs/2.0/language-php/ for more details
#

defaults: &defaults
  docker:
    # specify the version you desire here (avoid latest except for testing)
    - image: andrewberry/drupal_tests:0.3.4

    # Use our fork until https://github.com/wernight/docker-phantomjs/pull/3 is
    # merged.
    # - image: wernight/phantomjs:2.1.1
    - image: selenium/standalone-chrome-debug:3.7.1-beryllium

    - image: mariadb:10.3
      environment:
        MYSQL_ALLOW_EMPTY_PASSWORD: 1

    # Specify service dependencies here if necessary
    # CircleCI maintains a library of pre-built images
    # documented at https://circleci.com/docs/2.0/circleci-images/
    # - image: circleci/mysql:9.4

  # 'checkout' supports a path key, but not on locals where you test with the
  # circleci CLI tool.
  # https://discuss.circleci.com/t/bug-circleci-build-command-ignores-checkout-path-config/13004
  working_directory: /var/www/html/modules/representative_image

# YAML does not support merging of lists. That means we can't have a default
# 'steps' configuration, though we can have defaults for individual step
# properties.

# We use the composer.json as a way to determine if we can cache our build.
restore_cache: &restore_cache
  keys:
  - v4-dependencies-{{ checksum "composer.json" }}-{{ checksum "../../composer.json" }}
  # fallback to using the latest cache if no exact match is found
  - v4-dependencies-

# If composer.json hasn't changed, restore the Composer cache directory. We
# don't restore the lock file so we ensure we get updated dependencies.
save_cache: &save_cache
  paths:
    - /root/.composer/cache/files
  key: v4-dependencies-{{ checksum "composer.json" }}-{{ checksum "../../composer.json" }}

# Install composer dependencies into the workspace to share with all jobs.
update_dependencies: &update_dependencies
  <<: *defaults
  steps:
    - checkout

    - restore_cache: *restore_cache

    - run:
        working_directory: /var/www/html
        command: |
          ./update-dependencies.sh $CIRCLE_PROJECT_REPONAME

    - save_cache: *save_cache

    - persist_to_workspace:
        root: /var/www/html
        paths:
          - .

# Run Drupal unit and kernel tests as one job. This command invokes the test.sh
# hook.
unit_kernel_tests: &unit_kernel_tests
  <<: *defaults
  steps:
    - attach_workspace:
        at: /var/www/html

    - checkout

    - run:
        working_directory: /var/www/html
        command: |
          ./test.sh $CIRCLE_PROJECT_REPONAME

    - store_test_results:
        path: /var/www/html/artifacts/phpunit
    - store_artifacts:
        path: /var/www/html/artifacts

# Run code quality tests. This invokes code-sniffer.sh.
code_sniffer: &code_sniffer
  <<: *defaults
  steps:
    - attach_workspace:
        at: /var/www/html

    - checkout

    - run:
        working_directory: /var/www/html
        command: |
          ./code-sniffer.sh $CIRCLE_PROJECT_REPONAME

    - store_test_results:
        path: /var/www/html/artifacts/phpcs
    - store_artifacts:
        path: /var/www/html/artifacts

# Run code coverage tests. This invokes code-coverage-stats.sh.
code_coverage: &code_coverage
  <<: *defaults
  steps:
    - attach_workspace:
        at: /var/www/html

    - checkout

    - run:
        working_directory: /var/www/html
        command: |
          ./code-coverage-stats.sh $CIRCLE_PROJECT_REPONAME
    - store_artifacts:
        path: /var/www/html/artifacts

# Declare all of the jobs we should run.
version: 2
jobs:
  update-dependencies:
     <<: *update_dependencies
  run-unit-kernel-tests:
     <<: *unit_kernel_tests
  run-code-sniffer:
     <<: *code_sniffer
  run-code-coverage:
     <<: *code_coverage

workflows:
  version: 2

  # Declare a workflow that runs all of our jobs in parallel.
  test_and_lint:
    jobs:
      - update-dependencies
      - run-unit-kernel-tests:
          requires:
            - update-dependencies
      - run-code-sniffer:
          requires:
            - update-dependencies
      - run-code-coverage:
          requires:
            - update-dependencies
            - run-unit-kernel-tests

.gitignore

deleted100644 → 0
+0 −1
Original line number Diff line number Diff line
tests/src/Behat/behat.local.yml

composer.json

deleted100644 → 0
+0 −19
Original line number Diff line number Diff line
{
    "name": "drupal/representative_image",
    "description": "Allows you to define a representative image per node type and make it available in a token",
    "type": "drupal-module",
    "homepage": "https://drupal.org/project/representative_image",
    "support": {
        "issues": "https://drupal.org/project/issues/representative_image",
        "irc": "irc://irc.freenode.org/drupal-contribute",
        "source": "https://cgit.drupalcode.org/representative_image"
    },
    "license": "GPL-2.0+",
    "minimum-stability": "dev",
    "require-dev": {
        "cweagans/composer-patches": "^1.6",
        "drupal/coder": "^8.2",
        "phpmd/phpmd": "dev-master",
        "phpmetrics/phpmetrics": "dev-master"
    }
}

phpunit.core.xml.dist

deleted100644 → 0
+0 −75
Original line number Diff line number Diff line
<?xml version="1.0" encoding="UTF-8"?>

<!-- This based on Drupal's core phpunit.xml.dist. -->
<!-- TODO set checkForUnintentionallyCoveredCode="true" once https://www.drupal.org/node/2626832 is resolved. -->
<!-- PHPUnit expects functional tests to be run with either a privileged user
 or your current system user. See core/tests/README.md and
 https://www.drupal.org/node/2116263 for details.
-->
<phpunit bootstrap="tests/bootstrap.php" colors="true"
         beStrictAboutTestsThatDoNotTestAnything="true"
         beStrictAboutOutputDuringTests="true"
         beStrictAboutChangesToGlobalState="true">
<!-- TODO set printerClass="\Drupal\Tests\Listeners\HtmlOutputPrinter" once
 https://youtrack.jetbrains.com/issue/WI-24808 is resolved. Drupal provides a
 result printer that links to the html output results for functional tests.
 Unfortunately, this breaks the output of PHPStorm's PHPUnit runner. However, if
 using the command line you can add
 - -printer="\Drupal\Tests\Listeners\HtmlOutputPrinter" to use it (note there
 should be no spaces between the hyphens).
-->
  <php>
    <!-- Set error reporting to E_ALL. -->
    <ini name="error_reporting" value="32767"/>
    <!-- Do not limit the amount of memory tests take to run. -->
    <ini name="memory_limit" value="-1"/>
    <!-- Example SIMPLETEST_BASE_URL value: http://localhost -->
    <env name="SIMPLETEST_BASE_URL" value=""/>
    <!-- Example SIMPLETEST_DB value: mysql://username:password@localhost/databasename#table_prefix -->
    <env name="SIMPLETEST_DB" value=""/>
    <!-- Example BROWSERTEST_OUTPUT_DIRECTORY value: /path/to/webroot/sites/simpletest/browser_output -->
    <env name="BROWSERTEST_OUTPUT_DIRECTORY" value=""/>
    <!-- To disable deprecation testing uncomment the next line. -->
    <env name="SYMFONY_DEPRECATIONS_HELPER" value="weak_vendors"/>
    <!-- Example for changing the driver class for mink tests MINK_DRIVER_CLASS value: 'Drupal\FunctionalJavascriptTests\DrupalSelenium2Driver' -->
    <!-- Example for changing the driver args to mink tests MINK_DRIVER_ARGS value: '["http://127.0.0.1:8510"]' -->
    <!-- Example for changing the driver args to phantomjs tests MINK_DRIVER_ARGS_PHANTOMJS value: '["http://127.0.0.1:8510"]' -->
    <!-- Example for changing the driver args to webdriver tests MINK_DRIVER_ARGS_WEBDRIVER value: '["firefox", null, "http://localhost:4444/wd/hub"]' -->
  </php>
  <testsuites>
    <testsuite name="unit">
      <file>./tests/TestSuites/UnitTestSuite.php</file>
    </testsuite>
    <testsuite name="kernel">
      <file>./tests/TestSuites/KernelTestSuite.php</file>
    </testsuite>
    <testsuite name="functional">
      <file>./tests/TestSuites/FunctionalTestSuite.php</file>
    </testsuite>
    <testsuite name="nonfunctional">
      <file>./tests/TestSuites/UnitTestSuite.php</file>
      <file>./tests/TestSuites/KernelTestSuite.php</file>
    </testsuite>
    <testsuite name="functional-javascript">
      <file>./tests/TestSuites/FunctionalJavascriptTestSuite.php</file>
    </testsuite>
  </testsuites>
  <listeners>
    <listener class="\Drupal\Tests\Listeners\DrupalListener">
    </listener>
    <!-- The Symfony deprecation listener has to come after the Drupal listener -->
    <listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener">
    </listener>
  </listeners>
  <!-- Filter for coverage reports. -->
  <filter>
    <whitelist processUncoveredFilesFromWhitelist="true">
      <directory>../modules/representative_image</directory>
      <!-- By definition test classes have no tests. -->
      <exclude>
        <directory>../modules/representative_image/tests</directory>
        <directory>../modules/representative_image/test_modules</directory>
      </exclude>
    </whitelist>
  </filter>
</phpunit>
+1 −2
Original line number Diff line number Diff line
@@ -2,5 +2,4 @@ name: Representative Image
type: module
description: Allows you to define a representative image per node type and make it available in a token
package: Media
core: 8.x
core_version_requirement: ^8 || ^9
core_version_requirement: ^9.3 || ^10
Loading