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

MoodleNet: PHPUnit failures on Windows environment

    XMLWordPrintable

Details

    • MOODLE_403_STABLE
    • MOODLE_403_STABLE
    • MDL-79381-master
    • Hide

      Automation test:

      Make sure that all PHPUnit tests are passed: 

      vendor/bin/phpunit --filter 'core\\moodlenet' --testdox

      Manual test:

      Initial setup

      1. Set up and run the MoodleNet mock server (https://github.com/HuongNV13/moodlenet_mock/) using branch addDownloadFile and 'moodlenet.test' as the domain.
      2. Log in as admin.
      3. Navigate to Admin > Security > HTTP security and clear the values for "cURL blocked hosts list " and "cURL allowed ports list" so they do not prevent us from reaching the MoodleNet mock server.
      4. Navigate to "Site administration > Development > Experimental".
      5. Enable the "Enable sharing to MoodleNet" setting.
      6. Navigate to Site Administration / Server / OAuth 2 services.
      7. Click on the MoodleNet button.
      8. Change the Service base URL to: moodlenet.test
      9. Change the Name to: MoodleNet Local
      10. Save changes.
      11. Navigate to Site Administration / General / MoodleNet outbound settings.
      12. Select MoodleNet Local in the OAuth 2 service dropdown.
      13. Create a new Course.
      14. Create 3 Assign activities called: Assign 1, Assign 2 and Assign 3.

      Testing for MDL-75785

      1. Create a new Assignment activity inside the created Course. Set the description to "Hello world".
      2. Login as a non-editing teacher/student role.
      3. Navigate to the Assignment activity.
      4. Verify that you will not see the Share to MoodleNet menu in the More menu.
      5. Login as editing teacher/manager role.
      6. Navigate to the Assignment activity.
      7. Click on the More menu.
      8. Verify that you will see Share to MoodleNet.
      9. Click on that menu option.
      10. Verify that you will see the activity name and share type of 'ASSIGNMENT'.
      11. Verify that you will see You are sharing this to MoodleNet as a resource.
      12. Verify that you will see: Sharing to: MoodleNet Local.
      13. Click on the Share button.
      14. Verify that a new popup will be open and ask you to authorize with MoodleNet mock server.
      15. Click the cancel button.
      16. Verify that the popup closes, but that the share to MoodleNet modal is still open on the initial screen in the Moodle LMS.
      17. Click on the Share button again.
      18. Verify that the authorization popup appears again.
      19. This time, click Authorize.
      20. Click Allow button.
      21. Verify that the popup will be closed and the dialogue will show that the system is packaging the activity.
      22. Verify that you will see a successful dialogue say that:  Saved to MoodleNet drafts 
      23. Verify that you will see Almost done! Visit your draft in MoodleNet to finish sharing your content.
      24. Click the "Go to MoodleNet drafts" button at the bottom right of the modal.
      25. Verify that you can download the mbz file.
      26. Try to restore that file.
      27. Verify that you can restore the Assignment activity.

      Testing for MDL-75318

      1. Navigate to the course you previously created.
      2. Click on the More menu and select Share to MoodleNet.
      3. Verify that you will see the course name and share type of 'COURSE'.
      4. Verify that you will see You are sharing this to MoodleNet as a resource.
      5. Verify that you will see: Sharing to: Prototype MoodleNet.
      6. Click on the Share button.
      7. If there is a popup open that asks you to authorize with the MoodleNet site, click Authorize.
      8. Verify that the dialogue in the modal within Moodle LMS shows that the system is packaging the activity.
      9. Verify that you will see a successful dialogue say that:  Saved to MoodleNet drafts.
      10. Click the "Go to MoodleNet drafts" button at the bottom right of the modal.
      11. Verify that you can download the mbz file.
      12. Try to restore that file.
      13. Verify that you can restore the Course that you already shared.
      14. Verify that the content of that backup course is matched with the course being shared.

      Testing for MDL-78267

      Test scenario (Share multiple activities):

      1. Login as editing teacher/manager role.
      2. Navigate to the Course.
      3. Turn on the Edit mode.
      4. Click on the Bulk edit button.
      5. Verify that you will see the Share to MoodleNet button in the footer.
      6. Verify that the button is disabled (Blur).
      7. Click on the checkbox next to Assign 1.
      8. Click on the checkbox next to Assign 2.
      9. Verify that the button is enabled.
      10. Click on the Share to MoodleNet button in the footer.
      11. Verify that you will see the course name and share type of 'COURSE'.
      12. Verify that you will see The selected activities are being shared with MoodleNet as a resource.
      13. Verify that you will see: 2 activities will be included in the course.
      14. Verify that you will see: Sharing to: MoodleNet Local.
      15. Click on the Share button.
      16. If there is a popup open that asks you to authorize with the MoodleNet site, click Authorize/Allow.
      17. Verify that the dialogue will show that the system is packaging the activity.
      18. Verify that you will see a successful dialogue say that: Saved to MoodleNet drafts 
      19. Verify that you will see Almost done! Visit your draft in MoodleNet to finish sharing your content.
      20. Click the Go to MoodleNet drafts button.
      21. Verify that you can download the mbz file.
      22. In the course, navigate to More -> Course reuse -> Restore and upload the downloaded file.
      23. Verify that the backup type is Course.
      24. Try to restore the course.
      25. Verify that the newly restored course only contains Assign 1 and Assign 2 activities.

      Test scenario (Share single activity):

      1. Login as editing teacher/manager role.
      2. Navigate to the Course.
      3. Turn on the Edit mode.
      4. Click on the Bulk edit button.
      5. Verify that you will see Share to MoodleNet button in the footer.
      6. Verify that the button is disabled (Blur).
      7. Click on the checkbox next to Assign 1.
      8. Verify that the button is enabled.
      9. Click on the Share to MoodleNet button in the footer.
      10. Verify that you will see the activity name and share type of 'ASSIGNMENT'.
      11. Verify that you will see This activity is being shared with MoodleNet as a resource.
      12. Verify that you will not see: 1 activities will be included in the course
      13. Verify that you will see: Sharing to: MoodleNet Local.
      14. Click on the Share button.
      15. Verify that a new popup will be open and ask you to authorize with MoodleNet mock server.
      16. Click Allow button.
      17. Verify that the popup will be closed and the dialogue will show that the system is packaging the activity.
      18. Verify that you will see a successful dialogue say that:  Saved to MoodleNet drafts 
      19. Verify that you will see Almost done! Visit your draft in MoodleNet to finish sharing your content.
      20. Click the Go to MoodleNet drafts button.
      21. Verify that you can download the mbz file.
      22. In the course, navigate to More -> Course reuse -> Restore and upload the downloaded file.
      23. Verify that the backup type is Activity.
      24. Try to restore and confirm that you can restore the Assign 1 activity.
      Show
      Automation test: Make sure that all PHPUnit tests are passed:  vendor/bin/phpunit --filter 'core\\moodlenet' --testdox Manual test: Initial setup Set up and run the MoodleNet mock server ( https://github.com/HuongNV13/moodlenet_mock/ ) using branch  addDownloadFile  and 'moodlenet.test' as the domain. Log in as admin. Navigate to Admin > Security > HTTP security and clear the values for "cURL blocked hosts list " and "cURL allowed ports list" so they do not prevent us from reaching the MoodleNet mock server. Navigate to "Site administration > Development > Experimental". Enable the "Enable sharing to MoodleNet" setting. Navigate to Site Administration / Server / OAuth 2 services. Click on the MoodleNet button. Change the Service base URL to: moodlenet.test Change the Name to: MoodleNet Local Save changes. Navigate to Site Administration / General / MoodleNet outbound settings. Select MoodleNet Local in the OAuth 2 service dropdown. Create a new Course. Create 3 Assign activities called: Assign 1, Assign 2 and Assign 3. Testing for  MDL-75785 Create a new Assignment activity inside the created Course. Set the description to "Hello world". Login as a non-editing teacher/student role. Navigate to the Assignment activity. Verify  that you will  not  see the Share to MoodleNet menu in the More menu. Login as editing teacher/manager role. Navigate to the Assignment activity. Click on the More menu. Verify  that you will see Share to MoodleNet. Click on that menu option. Verify that you will see the activity name and share type of 'ASSIGNMENT'. Verify  that you will see You are sharing this to MoodleNet as a resource. Verify  that you will see: Sharing to: MoodleNet Local. Click on the Share button. Verify  that a new popup will be open and ask you to authorize with MoodleNet mock server. Click the cancel button. Verify  that the popup closes, but that the share to MoodleNet modal is still open on the initial screen in the Moodle LMS. Click on the Share button again. Verify  that the authorization popup appears again. This time, click Authorize. Click Allow button. Verify  that the popup will be closed and the dialogue will show that the system is packaging the activity. Verify  that you will see a successful dialogue say that:  Saved to MoodleNet drafts  Verify  that you will see Almost done! Visit your draft in MoodleNet to finish sharing your content. Click the "Go to MoodleNet drafts" button at the bottom right of the modal. Verify that you can download the mbz file. Try to restore that file. Verify that you can restore the Assignment activity. Testing for MDL-75318 Navigate to the course you previously created. Click on the More menu and select Share to MoodleNet. Verify that you will see the course name and share type of 'COURSE'. Verify  that you will see You are sharing this to MoodleNet as a resource. Verify  that you will see: Sharing to: Prototype MoodleNet. Click on the Share button. If there is a popup open that asks you to authorize with the MoodleNet site, click Authorize. Verify that the dialogue in the modal within Moodle LMS shows that the system is packaging the activity. Verify  that you will see a successful dialogue say that:  Saved to MoodleNet drafts. Click the "Go to MoodleNet drafts" button at the bottom right of the modal. Verify that you can download the mbz file. Try to restore that file. Verify that you can restore the Course that you already shared. Verify that the content of that backup course is matched with the course being shared. Testing for MDL-78267 Test scenario (Share multiple activities): Login as editing teacher/manager role. Navigate to the Course. Turn on the Edit mode. Click on the Bulk edit button. Verify that you will see the Share to MoodleNet button in the footer. Verify  that the button is  disabled  (Blur). Click on the checkbox next to Assign 1. Click on the checkbox next to Assign 2. Verify  that the button is  enabled . Click on the Share to MoodleNet button in the footer. Verify that you will see the course name and share type of 'COURSE'. Verify  that you will see  The selected activities are being shared with MoodleNet as a resource . Verify  that you will see:  2 activities will be included in the course. Verify  that you will see: Sharing to: MoodleNet Local. Click on the Share button. If there is a popup open that asks you to authorize with the MoodleNet site, click Authorize/Allow. Verify that the dialogue will show that the system is packaging the activity. Verify  that you will see a successful dialogue say that: Saved to MoodleNet drafts  Verify  that you will see Almost done! Visit your draft in MoodleNet to finish sharing your content. Click the Go to MoodleNet drafts button. Verify  that you can download the mbz file. In the course, navigate to More -> Course reuse -> Restore and upload the downloaded file. Verify  that the backup type is  Course . Try to restore the course. Verify  that the newly restored course only contains Assign 1 and Assign 2 activities. Test scenario (Share single activity): Login as editing teacher/manager role. Navigate to the Course. Turn on the Edit mode. Click on the Bulk edit button. Verify  that you will see Share to MoodleNet button in the footer. Verify  that the button is  disabled  (Blur). Click on the checkbox next to Assign 1. Verify  that the button is  enabled . Click on the Share to MoodleNet button in the footer. Verify that you will see the activity name and share type of 'ASSIGNMENT'. Verify  that you will see  This activity is being shared with MoodleNet as a resource . Verify  that you will  not  see:  1 activities will be included in the course Verify  that you will see: Sharing to: MoodleNet Local. Click on the Share button. Verify  that a new popup will be open and ask you to authorize with MoodleNet mock server. Click Allow button. Verify  that the popup will be closed and the dialogue will show that the system is packaging the activity. Verify  that you will see a successful dialogue say that:  Saved to MoodleNet drafts  Verify  that you will see Almost done! Visit your draft in MoodleNet to finish sharing your content. Click the Go to MoodleNet drafts button. Verify  that you can download the mbz file. In the course, navigate to More -> Course reuse -> Restore and upload the downloaded file. Verify  that the backup type is Activity. Try to restore and  confirm  that you can restore the Assign 1 activity.
    • 1
    • Team Hedgehog 2023 Sprint 3.2, Team Hedgehog 2023 Sprint 3.3

    Description

      Some errors:

      1) core\moodlenet\activity_sender_test::test_get_resource_description
      440rmdir(D:\a\moodle\phpunitdata/temp/backup): Directory not empty
      441
      442D:\a\moodle\moodle\lib\moodlelib.php:10189
      443D:\a\moodle\moodle\lib\moodlelib.php:10178
      444D:\a\moodle\moodle\lib\testing\classes\util.php:792
      445D:\a\moodle\moodle\lib\phpunit\classes\util.php:277
      446D:\a\moodle\moodle\lib\phpunit\classes\advanced_testcase.php:512
      447D:\a\moodle\moodle\lib\phpunit\classes\advanced_testcase.php:128
      448
      4492) core\moodlenet\activity_sender_test::test_share_resource with data set "Success" (GuzzleHttp\Psr7\Response Object (...), array(201, 'https://moodlenet.example.com..._1.mbz'))
      450rmdir(D:\a\moodle\phpunitdata/temp/backup): Directory not empty
      451
      452D:\a\moodle\moodle\lib\moodlelib.php:10189
      453D:\a\moodle\moodle\lib\moodlelib.php:10178
      454D:\a\moodle\moodle\lib\testing\classes\util.php:792
      455D:\a\moodle\moodle\lib\phpunit\classes\util.php:277
      456D:\a\moodle\moodle\lib\phpunit\classes\advanced_testcase.php:512
      457D:\a\moodle\moodle\lib\phpunit\classes\advanced_testcase.php:128 

      Spotted by Eloy: https://github.com/stronk7/moodle/actions/runs/6201489633/job/16850110012

      Attachments

        Issue Links

          Activity

            People

              huongn@moodle.com Huong Nguyen
              huongn@moodle.com Huong Nguyen
              David Woloszyn David Woloszyn
              Jun Pataleta Jun Pataleta
              Jun Pataleta Jun Pataleta
              Votes:
              1 Vote for this issue
              Watchers:
              4 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 - 4 days, 13 minutes
                  4d 13m

                  Clockify

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