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

Broken unit tests on Main #91

Open
golenkovm opened this issue Jun 23, 2023 · 2 comments · May be fixed by #93
Open

Broken unit tests on Main #91

golenkovm opened this issue Jun 23, 2023 · 2 comments · May be fixed by #93

Comments

@golenkovm
Copy link

Hi team,

I recently updated the plugin to the latest Main version and found that uni tests cannot be initialised due to the following error:

Moodle 4.1.4+ (Build: 20230616)
Php: 7.4.33, pgsql: 14.8 (Debian 14.8-1.pgdg120+1), OS: Linux 5.15.0-1023-aws x86_64

Warning: require_once(/var/www/site/mod/pdfannotator/tests/privacy/../fixtures/test_indicator_max.php): failed to open stream: No such file or directory in /var/www/site/mod/pdfannotator/tests/privacy/provider_test.php on line 27

This seems to be a regression of dcb9c86

@golenkovm
Copy link
Author

I tried to implement a patch for this issue, please see golenkovm@84e58d7 but was facing more and more issues.

I gave up on the following failure as it looks like privacy provider and/or phpunit setup do not work as expected. It would be good if someone who implemented them took a look and fixed them

root@192a3db3c939:/var/www/site# vendor/bin/phpunit --testsuite='mod_pdfannotator_testsuite'
Moodle 4.1.4+ (Build: 20230629), 3d328eeb123c8d89e24e6ee208ac8aac0a621ee5
Php: 8.0.29, mysqli: 8.0.33, OS: Linux 5.19.0-43-generic x86_64
PHPUnit 9.5.27 by Sebastian Bergmann and contributors.

F                                                                   1 / 1 (100%)

Time: 00:30.179, Memory: 80.50 MB

There was 1 failure:

1) mod_pdfannotator\privacy\provider_test::test_delete_data_for_users
Failed asserting that actual size 0 matches expected size 1.

/var/www/site/mod/pdfannotator/tests/privacy/provider_test.php:128
/var/www/site/lib/phpunit/classes/advanced_testcase.php:80

FAILURES!
Tests: 1, Assertions: 1, Failures: 1.

@golenkovm golenkovm linked a pull request Jul 4, 2023 that will close this issue
@golenkovm
Copy link
Author

golenkovm commented Jul 4, 2023

Spent some more time to implement the patch. However, it still feels like the unit test doesn't really test things properly so feel free to re-write/amend the patch

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 a pull request may close this issue.

1 participant