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

auth_ldap Unit Test failures

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      Unit tests
      1. Run full unit test suite (including LDAP tests)
        Note: These are currently not run by CI Infrastructure so you MUST DIY.
        I make use of the osixia/openldap docker image, and the following configuration:

        define('TEST_AUTH_LDAP_HOST_URL', 'ldap://localhost:3389');
        define('TEST_AUTH_LDAP_BIND_DN', 'cn=admin,dc=example,dc=org');
        define('TEST_AUTH_LDAP_BIND_PW', 'admin');
        define('TEST_AUTH_LDAP_DOMAIN', 'dc=example,dc=org');
         
        define('TEST_LDAPLIB_HOST_URL', 'ldap://localhost:3389');
        define('TEST_LDAPLIB_BIND_DN', 'cn=admin,dc=example,dc=org');
        define('TEST_LDAPLIB_BIND_PW', 'admin');
        define('TEST_LDAPLIB_DOMAIN', 'dc=example,dc=org’);
         
        define('TEST_ENROL_LDAP_HOST_URL', 'ldap://localhost:3389');
        define('TEST_ENROL_LDAP_BIND_DN', 'cn=admin,dc=example,dc=org');
        define('TEST_ENROL_LDAP_BIND_PW', 'admin');
        define('TEST_ENROL_LDAP_DOMAIN', 'dc=example,dc=org');
        

      Test preparation
      1. Run the supplied testldap.php script
      2. Run the User sync:

        php admin/tool/task/cli/schedule_task.php --execute="\auth_ldap\task\sync_task"
        

      3. Check the list of users in Moodle:
        1. Confirm that there are 5 users synced via LDAP
        2. Go to Site administration > Users > Permissions > Assign system roles and Confirm that the first two have the Course creator role
      Show
      Unit tests Run full unit test suite (including LDAP tests) Note: These are currently not run by CI Infrastructure so you MUST DIY. I make use of the osixia/openldap docker image, and the following configuration: define('TEST_AUTH_LDAP_HOST_URL', 'ldap://localhost:3389'); define('TEST_AUTH_LDAP_BIND_DN', 'cn=admin,dc=example,dc=org'); define('TEST_AUTH_LDAP_BIND_PW', 'admin'); define('TEST_AUTH_LDAP_DOMAIN', 'dc=example,dc=org');   define('TEST_LDAPLIB_HOST_URL', 'ldap://localhost:3389'); define('TEST_LDAPLIB_BIND_DN', 'cn=admin,dc=example,dc=org'); define('TEST_LDAPLIB_BIND_PW', 'admin'); define('TEST_LDAPLIB_DOMAIN', 'dc=example,dc=org’);   define('TEST_ENROL_LDAP_HOST_URL', 'ldap://localhost:3389'); define('TEST_ENROL_LDAP_BIND_DN', 'cn=admin,dc=example,dc=org'); define('TEST_ENROL_LDAP_BIND_PW', 'admin'); define('TEST_ENROL_LDAP_DOMAIN', 'dc=example,dc=org'); Test preparation Run the supplied testldap.php script Run the User sync: php admin/tool/task/cli/schedule_task.php --execute="\auth_ldap\task\sync_task" Check the list of users in Moodle: Confirm that there are 5 users synced via LDAP Go to Site administration > Users > Permissions > Assign system roles and Confirm that the first two have the Course creator role
    • Affected Branches:
      MOODLE_34_STABLE
    • Fixed Branches:
      MOODLE_34_STABLE
    • Pull Master Branch:
      MDL-59734-master

      Description

      Looks like MDL-30634 caused some unit test failures:

      2000 sm:master> ./vendor/bin/phpunit --filter test_auth_ldap --debug --verbose
       
       
       
      Moodle 3.4dev (Build: 20170804), 8146b1f06de51d1ca6b4043bc524ed2fe26aaa72
      Php: 7.0.20, pgsql: 9.6.3, OS: Darwin 16.7.0 x86_64
      PHPUnit 5.5.7 by Sebastian Bergmann and contributors.
       
      Runtime:       PHP 7.0.20 with Xdebug 2.5.5
      Configuration: /Users/nicols/Sites/moodles/sm/moodle/phpunit.xml
       
       
      Starting test 'auth_ldap_plugin_testcase::test_auth_ldap'.
      F                                                                   1 / 1 (100%)
       
      Time: 10.16 seconds, Memory: 180.00MB
       
      There was 1 failure:
       
      1) auth_ldap_plugin_testcase::test_auth_ldap
      Failed asserting that actual size 5 matches expected size 7.
       
      /Users/nicols/Sites/moodles/sm/moodle/auth/ldap/tests/plugin_test.php:146
      /Users/nicols/Sites/moodles/sm/moodle/lib/phpunit/classes/advanced_testcase.php:80
       
      To re-run:
       vendor/bin/phpunit --debug --verbose auth_ldap_plugin_testcase auth/ldap/tests/plugin_test.php
       
      FAILURES!
      Tests: 1, Assertions: 4, Failures: 1.
      

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  13/Nov/17