Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-56308

Ensure APCu tests skip when enable_cli=0, instead of crash.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.2
    • Fix Version/s: 3.2
    • Component/s: Caching
    • Labels:
    • Testing Instructions:
      Hide

      Ensure APCu is installed on your computer;

      $ brew install php70-apcu
      # apt-get install php-apcu
      

      Enable profiling of the APCu plugin in the GUI of Moodle:

      http://localhost/moodle/admin/settings.php?section=cachestore_apcu_settings
      

      For each of the combinations in the table below;
      1. Load http://localhost/moodle/cache/testperformance.php and confirm that APCu producing the correct result.
      2. Run vendor/bin/phpunit vendor/bin/phpunit cache/stores/apcu/tests/apcu_test.php

      apc.enabled apc.enable_cli GUI Response PHPUnit Response
      0 0 Invalid Plugin Skipped (S)
      0 1 Invalid Plugin Skipped (S)
      1 0 Tested Skipped (S)
      1 1 Tested Tests Run (.)
      Show
      Ensure APCu is installed on your computer; $ brew install php70-apcu # apt-get install php-apcu Enable profiling of the APCu plugin in the GUI of Moodle: http://localhost/moodle/admin/settings.php?section=cachestore_apcu_settings For each of the combinations in the table below; 1. Load http://localhost/moodle/cache/testperformance.php and confirm that APCu producing the correct result. 2. Run vendor/bin/phpunit vendor/bin/phpunit cache/stores/apcu/tests/apcu_test.php apc.enabled apc.enable_cli GUI Response PHPUnit Response 0 0 Invalid Plugin Skipped (S) 0 1 Invalid Plugin Skipped (S) 1 0 Tested Skipped (S) 1 1 Tested Tests Run (.)
    • Affected Branches:
      MOODLE_32_STABLE
    • Fixed Branches:
      MOODLE_32_STABLE
    • Pull Master Branch:

      Description

      When the new APCu configuration looks like;

      apc.enabled=1
      apc.enable_cli=0
      

      Then

      vendor/bin/phpunit cache/stores/apcu/tests/apcu_test.php
      

      crashes PHPUnit rather than marking the tests as skipped.

      The above is the presented case. It's also possible that running CLI commands with APCu configured as a cachestore will crash the script.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                mr-russ Russell Smith
                Reporter:
                mr-russ Russell Smith
                Peer reviewer:
                Rajesh Taneja
                Integrator:
                Eloy Lafuente (stronk7)
                Tester:
                Jake Dallimore
                Participants:
                Component watchers:
                Matteo Scaramuccia, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
              • Votes:
                1 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  5/Dec/16