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

Search: Behat mock searching - fix minor bug, use simpledb instead

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      1. Run Behat tests with the @core_search tag and confirm they still pass. (This tag takes about 9 minutes on my new laptop.)
      2. Apply the attached patch file (which adds a silly extra test just to confirm behaviour with 11 search results, checking the bug with mock results) and then run the single added scenario (which has the @frogfrog tag).
      Show
      Run Behat tests with the @core_search tag and confirm they still pass. (This tag takes about 9 minutes on my new laptop.) Apply the attached patch file (which adds a silly extra test just to confirm behaviour with 11 search results, checking the bug with mock results) and then run the single added scenario (which has the @frogfrog tag).
    • Affected Branches:
      MOODLE_35_STABLE, MOODLE_36_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE
    • Fixed Branches:
      MOODLE_35_STABLE, MOODLE_36_STABLE, MOODLE_37_STABLE
    • Pull Master Branch:
      MDL-66132-master

      Description

      I originally filed the issue because of this minor bug:

      When using the Behat step to set fake search results, the 'total count' data is not set correctly. (It gets the real result count from the engine - which, as it hasn't done anything, always returns zero.) This makes it impossible to create Behat tests which involve multiple pages of search results. None of the core Behat tests do this, but third-party tests might need to.

      However, I also realised that in most cases we no longer need the mock search results, because the 'simpledb' search engine has been implemented. Using this will provide more realistic tests.

      Unfortunately there are some cases where simpledb does not support a feature that we are testing the UI for (user search and groups search). For these, the mock search results are still needed, so we are not able to remove/deprecate this step yet.

      This change therefore includes two parts:

      1. Change all possible search Behat scenarios to use simpledb. This includes adding one new Behat step to reindex search. (You can do this in the UI but it's slow and clumsy, so I made a new step.)
      2. Fix the bug with mock search results not having the correct result count.

      Potentially we could backport all parts of this (the bug obviously, + the other changes because they are Behat change).

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              quen Sam Marshall
              Reporter:
              quen Sam Marshall
              Peer reviewer:
              Mark Johnson
              Integrator:
              Eloy Lafuente (stronk7)
              Tester:
              Eloy Lafuente (stronk7)
              Participants:
              Component watchers:
              Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                9/Sep/19

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 50 minutes
                  50m