moodleou / moodle-block_workflow

The OU's workflow block for Moodle.
9 stars 7 forks source link

Unit tests fail because of unmentioned dependency on mod_externalquiz #1

Closed marcusboon closed 6 years ago

marcusboon commented 9 years ago

We have just started using your workflow block and our CI system flagged this issue whilst running unit tests.

1) block_workflow_automatic_step_finisher_test::test_automatic_step_finisher coding_exception: Coding error detected, it must be fixed by a programmer: Component mod_externalquiz does not support generators yet. Missing tests/generator/lib.php.

/home/marcus/workspace/swsi/lib/testing/generator/data_generator.php:121 /home/marcus/workspace/swsi/lib/testing/generator/data_generator.php:465 /home/marcus/workspace/swsi/blocks/workflow/tests/autostepfinisher_test.php:202 /home/marcus/workspace/swsi/lib/phpunit/classes/advanced_testcase.php:80

We cannot seem to find any reference to mod_externalquiz in core moodle or even in the moodle plugins repository.

timhunt commented 9 years ago

Right. That is a private plugin we have to integrate with another OU system. We really should not have used it in the unit tests for this block, but we did without thinking it through properly.

I have an open issue in our internal bug-tracker to fix this, but it has not been a priority until now.

The quick fix is to skip that test if the plugin is not installed. (A bit like we did here for qtype_stack https://github.com/maths/moodle-qtype_stack/blob/master/tests/test_base.php#L53)

The better long-term fix is to rewrite that test to use only core modules.

Sorry for the inconvenience here. I hope you find the workflow system helpful.

danmarsden commented 6 years ago

looks like this was fixed and this can probably be closed - I just ran the unit tests on a 3.3 site and all looked good.

timhunt commented 6 years ago

Thanks Dan.