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

Test re-loading original data, discarding cleanups already performed

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.5.8, 3.6.6, 3.7, 3.8, 3.9
    • 3.5.10, 3.6.8, 3.7.4
    • Unit tests
    • MOODLE_35_STABLE, MOODLE_36_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE
    • MOODLE_35_STABLE, MOODLE_36_STABLE, MOODLE_37_STABLE
    • Hide

      Automated phpunit tests are enough (nothing is broken).

      (you could also change your local git settings and force a checkout using CRLFs or change the fixture to CRLF... to reproduce the problem and verify the fix, but that's already demoed by the travis windows runs linked in the description).

      Show
      Automated phpunit tests are enough (nothing is broken). (you could also change your local git settings and force a checkout using CRLFs or change the fixture to CRLF... to reproduce the problem and verify the fix, but that's already demoed by the travis windows runs linked in the description).

    Description

      First of all, this is not critical at all and, in fact, it has been working ok till now.

      But, recently, I started to play with travis to get unit tests running there for Windows and this issue is 100% breaking the execution.

      Link to code: https://github.com/moodle/moodle/blob/master/lib/tests/messageinbound_test.php#L112-L115

      Basically, we are loading a file, that can have \n or \r\n, depending of the git checkout options... and we correctly normalize the file always, replacing all CRLFs by LFs.

      But, then, instead of using that normalized $content, we load the file again, ultimately heading to a complete phpunit error, because it's in a provider executed early in the phpunit process.

      So this is about to ensure that we use the normalized $content and done. With that, those windows executions having git configured to get CRLFs... will continue working ok. I quick tried here and passed from:

      To:

      Attachments

        Issue Links

          Activity

            People

              stronk7 Eloy Lafuente (stronk7)
              stronk7 Eloy Lafuente (stronk7)
              Tim Hunt Tim Hunt
              Adrian Greeve Adrian Greeve
              CiBoT CiBoT
              Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                13/Jan/20

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 hour, 50 minutes
                  1h 50m