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

Zip unit tests failing under Windows

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.5
    • Fix Version/s: 2.5
    • Component/s: Unit tests
    • Labels:

      Description

      When running the unit tests under Windows, the tests in lib\filestorage\tests\zip_packer_test.php fail at a specific point, claiming permission problems...

      D:\xampp\htdocs\master_integration>phpunit -v --debug lib\filestorage\tests\zip_
      packer_test.php
      PHPUnit 3.7.9 by Sebastian Bergmann.
       
      Configuration read from D:\xampp\htdocs\master_integration\phpunit.xml
       
       
      Starting test 'zip_packer_testcase::test_get_packer'.
      .
      Starting test 'zip_packer_testcase::test_list_files'.
      .
      Starting test 'zip_packer_testcase::test_archive_to_pathname'.
      .
      Starting test 'zip_packer_testcase::test_archive_to_storage'.
      .
      Starting test 'zip_packer_testcase::test_extract_to_pathname'.
      .
      Starting test 'zip_packer_testcase::test_extract_to_pathname_onlyfiles'.
      .
      Starting test 'zip_packer_testcase::test_extract_to_storage'.
      .
      Starting test 'zip_packer_testcase::test_add_files'.
      ES
      Warning: mkdir(): Permission denied in D:\xampp\htdocs\master_integration\lib\se
      tuplib.php on line 1213
       
      Fatal error: Uncaught exception 'invalid_dataroot_permissions' with message 'Inv
      alid permissions detected in $CFG->dataroot directory, administrator has to fix
      permissions. (D:\xampp\Data\master_integration_MySQL_phpunit/temp/ can not be cr
      eated, check permissions.)' in D:\xampp\htdocs\master_integration\lib\setuplib.p
      hp:1215
      Stack trace:
      #0 D:\xampp\htdocs\master_integration\lib\setuplib.php(1288): make_writable_dire
      ctory('D:\xampp\Data\m...', true)
      #1 D:\xampp\htdocs\master_integration\lib\testing\classes\util.php(599): make_te
      mp_directory('')
      #2 D:\xampp\htdocs\master_integration\lib\phpunit\classes\util.php(195): testing
      _util::reset_dataroot()
      #3 D:\xampp\htdocs\master_integration\lib\phpunit\classes\advanced_testcase.php(
      331): phpunit_util::reset_all_data()
      #4 [internal function]: advanced_testcase::tearDownAfterClass()
      #5 D:\xampp\php\PEAR\PHPUnit\Framework\TestSuite.php(756): call_user_func(Array)
       
      #6 D:\xampp\php\PEAR\PHPUnit\TextUI\TestRunner.php(346): PHPUnit_Framework_TestS
      uite->run(Object(PHPUnit_Framework_Test in D:\xampp\htdocs\master_integration\li
      b\setuplib.php on line 1215
      

      Even though a permission error is reported, I don't believe that is the case. I'm not sure exactly what's going on, but looking at the directory involved, there's no permission stopping this test in the specified directory.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Votes:
                  0 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    14/May/13