XMLWordPrintable

Details

    • Sub-task
    • Resolution: Fixed
    • Major
    • 3.11.5
    • 3.11.4, 4.0
    • Privacy, Unit tests
    • MOODLE_311_STABLE, MOODLE_400_STABLE
    • MOODLE_311_STABLE
    • Hide

      A) General

      1. Verify that complete PHPUnit runs are passing (GHA, ToBiC...) for all branches.

      B) Testing instructions for MOODLE_311_STABLE and master

      1. Install local_codechecker in the site.
      2. Init phpunit: php admin/tool/phpunit/cli/init.php
      3. Run this (see the important note below about the HEAD alternatives and commits):

        git show --pretty="" --name-only HEAD  | \
            xargs local/codechecker/phpcs/bin/phpcs --standard=moodle  --extensions=php  \
            --sniffs=moodle.PHPUnit.TestCaseNames -p && echo "Yay!"
        

      4. Verify that you get 135 (for master) and 133 (for 311_STABLE) dots in the output, without any error and with "Yay!" printed at the end.
      5. Run this (see the important note below about the HEAD alternatives and commits):

        git show --pretty="" --name-only HEAD | \
            xargs -n 1 -I {} bash -c "echo {}; vendor/bin/phpunit {} > /dev/null || echo ERRORs!"
        

      6. Verify that you don't get any "ERRORs!" output, that means that all the tests modified can be run individually.
      7. Run this (see the important note below about the HEAD alternatives and commits):

        git show --pretty="" --name-only HEAD | \
            grep -v '/tests/.*_test.php'
        

      8. Verify that no files are returned. That means that we only have modified _test.php files within tests/ directories.

      Important Note: the HEAD in the above commands assumes that the branches have been integrated without any merge commit. You may need to replace them by the real commits if the issue has been integrated with merge commit. Here there are the commit details:

      • 311_STABLE:
        • HEAD = eac985d755c08bb03dfbf22b73ce45a2464a7319
      • master:
        • HEAD = e4a2d9c1d46b50b3628546abd4da0d50987bb874
      Show
      A) General Verify that complete PHPUnit runs are passing (GHA, ToBiC...) for all branches. B) Testing instructions for MOODLE_311_STABLE and master Install local_codechecker in the site. Init phpunit: php admin/tool/phpunit/cli/init.php Run this (see the important note below about the HEAD alternatives and commits): git show --pretty="" --name-only HEAD | \ xargs local/codechecker/phpcs/bin/phpcs --standard=moodle --extensions=php \ --sniffs=moodle.PHPUnit.TestCaseNames -p && echo "Yay!" Verify that you get 135 (for master) and 133 (for 311_STABLE) dots in the output, without any error and with "Yay!" printed at the end. Run this (see the important note below about the HEAD alternatives and commits): git show --pretty="" --name-only HEAD | \ xargs -n 1 -I {} bash -c "echo {}; vendor/bin/phpunit {} > /dev/null || echo ERRORs!" Verify that you don't get any "ERRORs!" output, that means that all the tests modified can be run individually. Run this (see the important note below about the HEAD alternatives and commits): git show --pretty="" --name-only HEAD | \ grep -v '/tests/.*_test.php' Verify that no files are returned. That means that we only have modified _test.php files within tests/ directories. Important Note : the HEAD in the above commands assumes that the branches have been integrated without any merge commit. You may need to replace them by the real commits if the issue has been integrated with merge commit. Here there are the commit details: 311_STABLE: HEAD = eac985d755c08bb03dfbf22b73ce45a2464a7319 master: HEAD = e4a2d9c1d46b50b3628546abd4da0d50987bb874

    Description

      This corresponds to the progress of point B of MDL-71049.

      In this case, applied to all the occurrences of:

      • privacy_test (72)
      • privacy_provider_test (52)

      Changes include:

      • Add or fix namespaces to be component\privacy.
        • Fixing incorrect use \xxx statements with leading backslash.
        • Changing code to point to global scope when needed / adding new use xxx statements.
      • Change testcase class names to match file name (_test.

      Goals:

      • Verify that there aren't remaining files and classes to be processed.
      • Verify that all the files can be run individually.
      • Verify that complete runs continue passing ok.
      • Apply the changes to both 311 (where PHPUnit was introduced) and master.

      Notes:

      • The changes should be 99.99% contained within phpunit /tests/ files. If something out from there is detected, it will be handled in separate commit, with justifications.

      Attachments

        Issue Links

          Activity

            People

              stronk7 Eloy Lafuente (stronk7)
              stronk7 Eloy Lafuente (stronk7)
              Andrew Lyons Andrew Lyons
              Shamim Rezaie Shamim Rezaie
              Angelia Dela Cruz Angelia Dela Cruz
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 day, 7 hours, 11 minutes
                  1d 7h 11m

                  Clockify

                    Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.