Commit 264e7437 authored by Dzmitry Kruchko's avatar Dzmitry Kruchko Committed by m4olivei
Browse files

Issue #3306914 by dakruchko: Fix tests

parent c7b423b7
Loading
Loading
Loading
Loading

.circleci/config.yml

deleted100644 → 0
+0 −286
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: quay.io/deviantintegral/drupal_tests:0.6.0-drupal89

    - image: selenium/standalone-chrome-debug:3.141.59-neon

    - image: mariadb:10.4
      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/media_mpx

# 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:
  - v5-dependencies-{{ checksum "composer.json" }}-{{ checksum "../../composer.json" }}
  # fallback to using the latest cache if no exact match is found
  - v5-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: v5-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 Drupal functional tests. This command invokes the test-functional.sh
# hook.
functional_tests: &functional_tests
  <<: *defaults
  steps:
    - attach_workspace:
        at: /var/www/html

    - checkout

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

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

# Run Drupal functional tests. This command invokes the test-functional-js.sh
# hook.
functional_js_tests: &functional_js_tests
  <<: *defaults
  steps:
    - attach_workspace:
        at: /var/www/html

    - checkout

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

    - store_test_results:
        path: /var/www/html/artifacts/phpunit
    - store_artifacts:
        path: /var/www/html/artifacts
    - store_artifacts:
        path: /var/www/html/sites/simpletest/browser_output

# Run Behat tests. This command invokes the behat.sh hook.
behat_tests: &behat_tests
  <<: *defaults
  steps:
    - attach_workspace:
        at: /var/www/html

    - checkout

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

    - 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

deprecated_code_check: &deprecated_code_check
  <<: *defaults
  steps:
    - attach_workspace:
        at: /var/www/html

    - checkout

    - run:
        working_directory: /var/www/html
        command: |
          echo 'memory_limit = 512M' >> /usr/local/etc/php/php.ini
          vendor/bin/drupal-check -d modules/media_mpx

# Declare all of the jobs we should run.
version: 2
jobs:
  update-dependencies:
     <<: *update_dependencies
  run-unit-kernel-tests:
     <<: *unit_kernel_tests
  run-functional-tests:
     <<: *functional_tests
  run-functional-js-tests:
     <<: *functional_js_tests
  run-behat-tests:
     <<: *behat_tests
  run-code-sniffer:
     <<: *code_sniffer
  run-code-coverage:
     <<: *code_coverage
  run-deprecated-code-check:
     <<: *deprecated_code_check

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-functional-tests:
          requires:
            - update-dependencies
      - run-functional-js-tests:
          requires:
            - update-dependencies
      - run-behat-tests:
          requires:
            - update-dependencies
      - run-code-sniffer:
          requires:
            - update-dependencies
      - run-code-coverage:
          requires:
            - update-dependencies
            - run-unit-kernel-tests
      - run-deprecated-code-check:
          requires:
            - update-dependencies

  weekly:
    jobs:
      - update-dependencies
      - run-unit-kernel-tests:
          requires:
            - update-dependencies
      - run-functional-tests:
          requires:
            - update-dependencies
      - run-functional-js-tests:
          requires:
            - update-dependencies
      - run-behat-tests:
          requires:
            - update-dependencies
      - run-code-sniffer:
          requires:
            - update-dependencies
      - run-code-coverage:
          requires:
            - update-dependencies
            - run-unit-kernel-tests
      - run-deprecated-code-check:
          requires:
            - update-dependencies

    triggers:
      - schedule:
          # Run jobs every Monday morning at 12AM
          cron: "0 0 * * 1"
          filters:
            branches:
              only:
                - master

.gitignore

deleted100644 → 0
+0 −1
Original line number Diff line number Diff line
tests/src/Behat/behat.local.yml
+0 −2
Original line number Diff line number Diff line
@@ -21,8 +21,6 @@

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

[![CircleCI](https://circleci.com/gh/Lullabot/media_mpx/tree/8.x-1.x.svg?style=svg)](https://circleci.com/gh/Lullabot/media_mpx/tree/8.x-1.x) [![Maintainability](https://api.codeclimate.com/v1/badges/69160a3010c6788be915/maintainability)](https://codeclimate.com/github/Lullabot/media_mpx/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/69160a3010c6788be915/test_coverage)](https://codeclimate.com/github/Lullabot/media_mpx/test_coverage)

This module integrates [mpx for PHP](https://github.com/Lullabot/mpx-php) with
Drupal 8's Media API.

+1 −9
Original line number Diff line number Diff line
@@ -7,8 +7,6 @@
  ],
  "license": "GPL-2.0+",
  "homepage": "https://www.drupal.org/project/media_mpx",
  "minimum-stability": "dev",
  "prefer-stable": true,
  "support": {
    "issues": "https://www.drupal.org/project/issues/media_mpx",
    "source": "http://cgit.drupalcode.org/media_mpx"
@@ -24,13 +22,7 @@
    "psr/simple-cache": "^1.0"
  },
  "require-dev": {
    "cweagans/composer-patches": "^1.7",
    "behat/mink-extension": "v2.2",
    "drupal/drupal-extension": "^4.0",
    "bex/behat-screenshot": "^2.1",
    "phpmd/phpmd": "^2.10",
    "phpmetrics/phpmetrics": "^2.7",
    "mglaman/drupal-check": "^1.1"
    "drupal/coder": "8.3.13"
  },
  "extra": {
    "drush": {

drupalci.yml

0 → 100644
+17 −0
Original line number Diff line number Diff line
build:
  assessment:
    validate_codebase:
      phplint:
      container_composer:
      phpcs:
        sniff-all-files: true
        halt-on-fail: false
    testing:
      run_tests.standard:
        types: 'PHPUnit-Unit,PHPUnit-Kernel,PHPUnit-Functional'
        testgroups: '--all'
        suppress-deprecations: true
      run_tests.js:
        types: 'PHPUnit-FunctionalJavascript'
        testgroups: '--all'
        suppress-deprecations: true
Loading