-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Core unit tests are failing if one of the supported qtypes is not in the code base #35
Comments
looks like it fails on other not installed qtypes like oumultiresponse:
|
This should work ... and, github actions runs the tests for this plugin without the otptional qtypes installed. So, why is it failing for you but not github actions? |
I guess this is because CI runs tests in isolation without running core tests. Try to install the plugin into vanilla moodle and run I think everything was explained in #36 that was closed. If you don't want to reorganise the code, then the plugin needs to declare dependencies on all plugins it tires to include files from. Any other ideas about fixing this issue? |
#36 did not explain anything. At least not in a way I could understand. It asserted what it was doing, and what problem it was trying to solve, but it did not explain why that action achieves the goal. (I expect it is clear in your head, having just diagnosed the problem, but I am not telepathic. I am, however, busy and tired, so please make it easy for me.) |
No worries, I'll provide more details. |
So as technically all qtypes renderers could be in any folder as in utils::get_question_renderer method we require a renderer file regardless. I think the easiest fix would be to move file around and make core tests happy. Hope that explains everything now. |
This is still not very clear to me, so I can't jsut simply merge this. The problem with moving stuff around is that we might (probalby do) have chagnes in our local codebase that we have not had time to push to github, and know, i don't have time to synch the two repos right now. Are we sure this is not a bug in test_get_component_classes_in_namespace that should be fixed, rather than us working around it? Or, if we need a work-around, would smoething like https://moodledev.io/docs/devupdate#developer-tip---handling-changes-to-base-class-names-while-supporting-multiple-moodle-versions be a less invasive (but more horrible) work-around? |
I understand your concerns @timhunt The main issue here is that auto-loaded files in output namespace are trying to include render files that potentially do not exist. So basically we auto-load a class that extends another class that potentially is not exist. I don't think that it's a bug in test_get_component_classes_in_namespace as the test calls a core function to return all classes in a given namespace. We can potentially do something like following so all files will remain where they are now. But I'm not sure if it's a good way also.
|
Issue moodleou#35: Workaround when the class does not exist
Running core unit tests in Moodle 4.1 while qtype_combined is not in a code base fails with following error.
The text was updated successfully, but these errors were encountered: