Skip to content
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

Issue #13: Fixed CI/CD unit test failure #15

Merged
merged 1 commit into from
Dec 2, 2024

Conversation

niko-hoogeveen
Copy link
Contributor

Closes Issue #13

Updated provider.php, added required metadata strings and updated provider_test.php.

There were 4 errors:

1) tool_dataprivacy\expired_contexts_test::test_process_course_context_with_override_unexpired_role
Unexpected debugging() call detected.
Debugging: Error reading from database (ERROR:  missing FROM-clause entry for table "g"
LINE 8:                   JOIN phpu_pcast p ON g.id = cm.instance
                                               ^

            SELECT DISTINCT u.id
            FROM phpu_user u
            JOIN (SELECT ge.userid
                  FROM phpu_context c
                  JOIN phpu_course_modules cm ON cm.id = c.instanceid AND c.contextlevel = $1
                  JOIN phpu_modules m ON m.id = cm.module AND m.name = $2
                  JOIN phpu_pcast p ON g.id = cm.instance
                  JOIN phpu_pcast_episodes pe ON pe.pcastid = p.id
                 WHERE c.id = $3) target ON u.id = target.userid
[array (
  0 => 70,
  1 => 'pcast',
  2 => 110001,
)])
* line 293 of /lib/dml/moodle_read_slave_trait.php: call to moodle_database->query_end()
* line 341 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->read_slave_query_end()
* line 1027 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
* line 56 of /privacy/classes/local/request/userlist.php: call to pgsql_native_moodle_database->get_records_sql()
* line 142 of /mod/pcast/classes/privacy/provider.php: call to core_privacy\local\request\userlist->add_from_sql()
* line 8154 of /lib/moodlelib.php: call to mod_pcast\privacy\provider::get_users_in_context()
* line 578 of /privacy/classes/manager.php: call to component_class_callback()
* line 611 of /privacy/classes/manager.php: call to core_privacy\manager::component_class_callback()
* line 285 of /privacy/classes/manager.php: call to core_privacy\manager->handled_component_class_callback()
* line 451 of /admin/tool/dataprivacy/classes/expired_contexts_manager.php: call to core_privacy\manager->get_users_in_context()
* line 388 of /admin/tool/dataprivacy/classes/expired_contexts_manager.php: call to tool_dataprivacy\expired_contexts_manager->delete_expired_context()
* line 946 of /admin/tool/dataprivacy/tests/expired_contexts_test.php: call to tool_dataprivacy\expired_contexts_manager->process_approved_deletions()
* line 1548 of /vendor/phpunit/phpunit/src/Framework/TestCase.php: call to tool_dataprivacy\expired_contexts_test->test_process_course_context_with_override_unexpired_role()
* line 1154 of /vendor/phpunit/phpunit/src/Framework/TestCase.php: call to PHPUnit\Framework\TestCase->runTest()
* line 80 of /lib/phpunit/classes/advanced_testcase.php: call to PHPUnit\Framework\TestCase->runBare()
* line 728 of /vendor/phpunit/phpunit/src/Framework/TestResult.php: call to advanced_testcase->runBare()
* line 904 of /vendor/phpunit/phpunit/src/Framework/TestCase.php: call to PHPUnit\Framework\TestResult->run()
* line 675 of /vendor/phpunit/phpunit/src/Framework/TestSuite.php: call to PHPUnit\Framework\TestCase->run()
* line 653 of /vendor/phpunit/phpunit/src/TextUI/TestRunner.php: call to PHPUnit\Framework\TestSuite->run()
* line 144 of /vendor/phpunit/phpunit/src/TextUI/Command.php: call to PHPUnit\TextUI\TestRunner->run()
* line 97 of /vendor/phpunit/phpunit/src/TextUI/Command.php: call to PHPUnit\TextUI\Command->run()
* line 98 of /vendor/phpunit/phpunit/phpunit: call to PHPUnit\TextUI\Command::main()
* line 122 of /vendor/bin/phpunit: call to include()


/var/www/stfx-main-campus/lib/phpunit/classes/advanced_testcase.php:88
2) tool_dataprivacy\expired_contexts_test::test_process_course_context_with_override_expired_role
Unexpected debugging() call detected.
Debugging: Error reading from database (ERROR:  missing FROM-clause entry for table "g"
LINE 8:                   JOIN phpu_pcast p ON g.id = cm.instance
                                               ^

            SELECT DISTINCT u.id
            FROM phpu_user u
            JOIN (SELECT ge.userid
                  FROM phpu_context c
                  JOIN phpu_course_modules cm ON cm.id = c.instanceid AND c.contextlevel = $1
                  JOIN phpu_modules m ON m.id = cm.module AND m.name = $2
                  JOIN phpu_pcast p ON g.id = cm.instance
                  JOIN phpu_pcast_episodes pe ON pe.pcastid = p.id
                 WHERE c.id = $3) target ON u.id = target.userid
[array (
  0 => 70,
  1 => 'pcast',
  2 => 110001,
)])
* line 293 of /lib/dml/moodle_read_slave_trait.php: call to moodle_database->query_end()
* line 341 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->read_slave_query_end()
* line 1027 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
* line 56 of /privacy/classes/local/request/userlist.php: call to pgsql_native_moodle_database->get_records_sql()
* line 142 of /mod/pcast/classes/privacy/provider.php: call to core_privacy\local\request\userlist->add_from_sql()
* line 8154 of /lib/moodlelib.php: call to mod_pcast\privacy\provider::get_users_in_context()
* line 578 of /privacy/classes/manager.php: call to component_class_callback()
* line 611 of /privacy/classes/manager.php: call to core_privacy\manager::component_class_callback()
* line 285 of /privacy/classes/manager.php: call to core_privacy\manager->handled_component_class_callback()
* line 451 of /admin/tool/dataprivacy/classes/expired_contexts_manager.php: call to core_privacy\manager->get_users_in_context()
* line 388 of /admin/tool/dataprivacy/classes/expired_contexts_manager.php: call to tool_dataprivacy\expired_contexts_manager->delete_expired_context()
* line 1034 of /admin/tool/dataprivacy/tests/expired_contexts_test.php: call to tool_dataprivacy\expired_contexts_manager->process_approved_deletions()
* line 1548 of /vendor/phpunit/phpunit/src/Framework/TestCase.php: call to tool_dataprivacy\expired_contexts_test->test_process_course_context_with_override_expired_role()
* line 1154 of /vendor/phpunit/phpunit/src/Framework/TestCase.php: call to PHPUnit\Framework\TestCase->runTest()
* line 80 of /lib/phpunit/classes/advanced_testcase.php: call to PHPUnit\Framework\TestCase->runBare()
* line 728 of /vendor/phpunit/phpunit/src/Framework/TestResult.php: call to advanced_testcase->runBare()
* line 904 of /vendor/phpunit/phpunit/src/Framework/TestCase.php: call to PHPUnit\Framework\TestResult->run()
* line 675 of /vendor/phpunit/phpunit/src/Framework/TestSuite.php: call to PHPUnit\Framework\TestCase->run()
* line 653 of /vendor/phpunit/phpunit/src/TextUI/TestRunner.php: call to PHPUnit\Framework\TestSuite->run()
* line 144 of /vendor/phpunit/phpunit/src/TextUI/Command.php: call to PHPUnit\TextUI\TestRunner->run()
* line 97 of /vendor/phpunit/phpunit/src/TextUI/Command.php: call to PHPUnit\TextUI\Command->run()
* line 98 of /vendor/phpunit/phpunit/phpunit: call to PHPUnit\TextUI\Command::main()
* line 122 of /vendor/bin/phpunit: call to include()


/var/www/stfx-main-campus/lib/phpunit/classes/advanced_testcase.php:88
3) tool_dataprivacy\expired_contexts_test::test_process_course_context_with_user_in_both_lists
Unexpected debugging() call detected.
Debugging: Error reading from database (ERROR:  missing FROM-clause entry for table "g"
LINE 8:                   JOIN phpu_pcast p ON g.id = cm.instance
                                               ^

            SELECT DISTINCT u.id
            FROM phpu_user u
            JOIN (SELECT ge.userid
                  FROM phpu_context c
                  JOIN phpu_course_modules cm ON cm.id = c.instanceid AND c.contextlevel = $1
                  JOIN phpu_modules m ON m.id = cm.module AND m.name = $2
                  JOIN phpu_pcast p ON g.id = cm.instance
                  JOIN phpu_pcast_episodes pe ON pe.pcastid = p.id
                 WHERE c.id = $3) target ON u.id = target.userid
[array (
  0 => 70,
  1 => 'pcast',
  2 => 110001,
)])
* line 293 of /lib/dml/moodle_read_slave_trait.php: call to moodle_database->query_end()
* line 341 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->read_slave_query_end()
* line 1027 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
* line 56 of /privacy/classes/local/request/userlist.php: call to pgsql_native_moodle_database->get_records_sql()
* line 142 of /mod/pcast/classes/privacy/provider.php: call to core_privacy\local\request\userlist->add_from_sql()
* line 8154 of /lib/moodlelib.php: call to mod_pcast\privacy\provider::get_users_in_context()
* line 578 of /privacy/classes/manager.php: call to component_class_callback()
* line 611 of /privacy/classes/manager.php: call to core_privacy\manager::component_class_callback()
* line 285 of /privacy/classes/manager.php: call to core_privacy\manager->handled_component_class_callback()
* line 451 of /admin/tool/dataprivacy/classes/expired_contexts_manager.php: call to core_privacy\manager->get_users_in_context()
* line 388 of /admin/tool/dataprivacy/classes/expired_contexts_manager.php: call to tool_dataprivacy\expired_contexts_manager->delete_expired_context()
* line 1123 of /admin/tool/dataprivacy/tests/expired_contexts_test.php: call to tool_dataprivacy\expired_contexts_manager->process_approved_deletions()
* line 1548 of /vendor/phpunit/phpunit/src/Framework/TestCase.php: call to tool_dataprivacy\expired_contexts_test->test_process_course_context_with_user_in_both_lists()
* line 1154 of /vendor/phpunit/phpunit/src/Framework/TestCase.php: call to PHPUnit\Framework\TestCase->runTest()
* line 80 of /lib/phpunit/classes/advanced_testcase.php: call to PHPUnit\Framework\TestCase->runBare()
* line 728 of /vendor/phpunit/phpunit/src/Framework/TestResult.php: call to advanced_testcase->runBare()
* line 904 of /vendor/phpunit/phpunit/src/Framework/TestCase.php: call to PHPUnit\Framework\TestResult->run()
* line 675 of /vendor/phpunit/phpunit/src/Framework/TestSuite.php: call to PHPUnit\Framework\TestCase->run()
* line 653 of /vendor/phpunit/phpunit/src/TextUI/TestRunner.php: call to PHPUnit\Framework\TestSuite->run()
* line 144 of /vendor/phpunit/phpunit/src/TextUI/Command.php: call to PHPUnit\TextUI\TestRunner->run()
* line 97 of /vendor/phpunit/phpunit/src/TextUI/Command.php: call to PHPUnit\TextUI\Command->run()
* line 98 of /vendor/phpunit/phpunit/phpunit: call to PHPUnit\TextUI\Command::main()
* line 122 of /vendor/bin/phpunit: call to include()


/var/www/stfx-main-campus/lib/phpunit/classes/advanced_testcase.php:88
4) tool_dataprivacy\expired_contexts_test::test_process_course_context_with_user_in_both_lists_expired
Unexpected debugging() call detected.
Debugging: Error reading from database (ERROR:  missing FROM-clause entry for table "g"
LINE 8:                   JOIN phpu_pcast p ON g.id = cm.instance
                                               ^

            SELECT DISTINCT u.id
            FROM phpu_user u
            JOIN (SELECT ge.userid
                  FROM phpu_context c
                  JOIN phpu_course_modules cm ON cm.id = c.instanceid AND c.contextlevel = $1
                  JOIN phpu_modules m ON m.id = cm.module AND m.name = $2
                  JOIN phpu_pcast p ON g.id = cm.instance
                  JOIN phpu_pcast_episodes pe ON pe.pcastid = p.id
                 WHERE c.id = $3) target ON u.id = target.userid
[array (
  0 => 70,
  1 => 'pcast',
  2 => 110001,
)])
* line 293 of /lib/dml/moodle_read_slave_trait.php: call to moodle_database->query_end()
* line 341 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->read_slave_query_end()
* line 1027 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
* line 56 of /privacy/classes/local/request/userlist.php: call to pgsql_native_moodle_database->get_records_sql()
* line 142 of /mod/pcast/classes/privacy/provider.php: call to core_privacy\local\request\userlist->add_from_sql()
* line 8154 of /lib/moodlelib.php: call to mod_pcast\privacy\provider::get_users_in_context()
* line 578 of /privacy/classes/manager.php: call to component_class_callback()
* line 611 of /privacy/classes/manager.php: call to core_privacy\manager::component_class_callback()
* line 285 of /privacy/classes/manager.php: call to core_privacy\manager->handled_component_class_callback()
* line 451 of /admin/tool/dataprivacy/classes/expired_contexts_manager.php: call to core_privacy\manager->get_users_in_context()
* line 388 of /admin/tool/dataprivacy/classes/expired_contexts_manager.php: call to tool_dataprivacy\expired_contexts_manager->delete_expired_context()
* line 1219 of /admin/tool/dataprivacy/tests/expired_contexts_test.php: call to tool_dataprivacy\expired_contexts_manager->process_approved_deletions()
* line 1548 of /vendor/phpunit/phpunit/src/Framework/TestCase.php: call to tool_dataprivacy\expired_contexts_test->test_process_course_context_with_user_in_both_lists_expired()
* line 1154 of /vendor/phpunit/phpunit/src/Framework/TestCase.php: call to PHPUnit\Framework\TestCase->runTest()
* line 80 of /lib/phpunit/classes/advanced_testcase.php: call to PHPUnit\Framework\TestCase->runBare()
* line 728 of /vendor/phpunit/phpunit/src/Framework/TestResult.php: call to advanced_testcase->runBare()
* line 904 of /vendor/phpunit/phpunit/src/Framework/TestCase.php: call to PHPUnit\Framework\TestResult->run()
* line 675 of /vendor/phpunit/phpunit/src/Framework/TestSuite.php: call to PHPUnit\Framework\TestCase->run()
* line 653 of /vendor/phpunit/phpunit/src/TextUI/TestRunner.php: call to PHPUnit\Framework\TestSuite->run()
* line 144 of /vendor/phpunit/phpunit/src/TextUI/Command.php: call to PHPUnit\TextUI\TestRunner->run()
* line 97 of /vendor/phpunit/phpunit/src/TextUI/Command.php: call to PHPUnit\TextUI\Command->run()
* line 98 of /vendor/phpunit/phpunit/phpunit: call to PHPUnit\TextUI\Command::main()
* line 122 of /vendor/bin/phpunit: call to include()


/var/www/stfx-main-campus/lib/phpunit/classes/advanced_testcase.php:88

@sbourget sbourget merged commit 3a00437 into sbourget:master Dec 2, 2024
2 of 6 checks passed
@sbourget
Copy link
Owner

sbourget commented Dec 2, 2024

Merged, Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants