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

Behat check_server_status can provide better information.

XMLWordPrintable

    • MOODLE_403_STABLE
    • MOODLE_401_STABLE, MOODLE_402_STABLE, MOODLE_403_STABLE, MOODLE_404_STABLE
    • MDL-80972-401
    • MDL-80972-403
    • MDL-80972-404
    • MDL-80972-main
    • Hide
      1. Configure Behat (if you haven't yet) by running: mdk behat
      2. Run one Behat test, for example:
        vendor/bin/behat --config /home/YOURUSERNAME/moodles/stable_master/moodledata_behat/behatrun/behat/behat.yml --name="User accounts display default fields"
      3. Ensure you do not see any errors.
      4. Simulate a failed curl request to http://127.0.0.1/YOURSITE/admin/tool/behat/tests/behat/fixtures/environment.php by renaming admin/tool/behat/tests/behat/fixtures/environment.php to something else (can be anything).
      5. Run the same test again.
      6. Verify now the error message displays the environment info (PHP, database and OS):

        Behat requirement not satisfied: http://127.0.0.1/stable_master is not available, ensure you specified correct url and that the server is set up and started.
         More info in https://moodledev.io/general/development/tools/behat
        Moodle 4.5dev (Build: 20240503), 67b2c43225285ddc63ee17fa05b03e4f339cf2af
        --> Php: 8.1.27, pgsql: 14.11 (Ubuntu 14.11-0ubuntu0.22.04.1), OS: Linux 5.15.0-105-generic x86_64
        

         

      Show
      Configure Behat (if you haven't yet) by running: mdk behat Run one Behat test, for example: vendor/bin/behat --config /home/YOURUSERNAME/moodles/stable_master/moodledata_behat/behatrun/behat/behat.yml --name="User accounts display default fields" Ensure you do not see any errors. Simulate a failed curl request to http://127.0.0.1/YOURSITE/admin/tool/behat/tests/behat/fixtures/environment.php by renaming admin/tool/behat/tests/behat/fixtures/environment.php to something else (can be anything). Run the same test again. Verify now the error message displays the environment info (PHP, database and OS): Behat requirement not satisfied: http://127.0.0.1/stable_master is not available, ensure you specified correct url and that the server is set up and started. More info in https://moodledev.io/general/development/tools/behat Moodle 4.5dev (Build: 20240503), 67b2c43225285ddc63ee17fa05b03e4f339cf2af --> Php: 8.1.27, pgsql: 14.11 (Ubuntu 14.11-0ubuntu0.22.04.1), OS: Linux 5.15.0-105-generic x86_64  

      The Behat check_server_status function only shows 'Behat requirement not satisfied'.

      When additional information is available in the $result variable (sample : "Behat config error: $CFG->behat_dataroot in config.php must point to an existing writable directory"), this information is not displayed.

            rdebleu Renaat Debleu
            rdebleu Renaat Debleu
            Angelia Dela Cruz Angelia Dela Cruz
            Simey Lameze Simey Lameze
            Simey Lameze Simey Lameze
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours, 6 minutes
                2h 6m

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