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

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

    XMLWordPrintable

Details

    • MOODLE_35_STABLE, MOODLE_36_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE
    • MOODLE_35_STABLE, MOODLE_36_STABLE, MOODLE_37_STABLE
    • MDL-66132-master
    • 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).

    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

              quen Sam Marshall
              quen Sam Marshall
              Mark Johnson Mark Johnson
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                9/Sep/19

                Time Tracking

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