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

Unit test error in MOODLE_401_STABLE #2540

Closed
CarlosArceLopera opened this issue Mar 27, 2024 · 4 comments · Fixed by #2575, #2576 or #2577
Closed

Unit test error in MOODLE_401_STABLE #2540

CarlosArceLopera opened this issue Mar 27, 2024 · 4 comments · Fixed by #2575, #2576 or #2577
Assignees
Labels
Feature - unittest Issue type - bug Bugs in existing code that needs to be fixed. Plugin - local_o365 Status - PR ready / pending release Dev is done and PR ready. Will be included in the next release.
Milestone

Comments

@CarlosArceLopera
Copy link

Hi,
I am getting this error when using MOODLE_401_STABLE branch.

vendor/bin/phpunit  local/o365/tests/usersync_test.php
Moodle 4.1.9+ (Build: 20240326), 232ca3445eb811071467e892a261b624e371e9d4
Php: 8.1.27, pgsql: 14.0 (Debian 14.0-1.pgdg110+1), OS: Linux 6.5.0-26-generic x86_64
Class usersync_test could not be found in /var/www/m401hq/local/o365/tests/usersync_test.php
root@48fa47c3f169:/var/www/m401hq# vendor/bin/phpunit  local/o365/tests/usersync_test.php
Moodle 4.1.9+ (Build: 20240326), 232ca3445eb811071467e892a261b624e371e9d4
Php: 8.1.27, pgsql: 14.0 (Debian 14.0-1.pgdg110+1), OS: Linux 6.5.0-26-generic x86_64
Class usersync_test could not be found in /var/www/m401hq/local/o365/tests/usersync_test.php
root@48fa47c3f169:/var/www/m401hq# vendor/bin/phpunit  local/o365/tests/usersync_test.php
Moodle 4.1.9+ (Build: 20240326), 232ca3445eb811071467e892a261b624e371e9d4
Php: 8.1.27, pgsql: 14.0 (Debian 14.0-1.pgdg110+1), OS: Linux 6.5.0-26-generic x86_64
PHPUnit 9.5.28 by Sebastian Bergmann and contributors.

....E                                                               5 / 5 (100%)

Time: 00:00.327, Memory: 68.50 MB

There was 1 error:

1) usersync_test::test_sync_users_create
Undefined array key "value"

/var/www/m401hq/local/o365/tests/usersync_test.php:306
/var/www/m401hq/lib/phpunit/classes/advanced_testcase.php:80

ERRORS!
Tests: 5, Assertions: 52, Errors: 1.
CarlosArceLopera pushed a commit to CarlosArceLopera/o365-moodle that referenced this issue Mar 27, 2024
@SYoung3000
Copy link

I feel we might be seeing something similar.

When going to "manage user connections" the user is listed, with "no connection" shown. If we try and match him we get the following. However theres no evidence of this when looking at any other user, unless I'm missing something. The users UPN hasn't changed, none of the usual things that cause problems.

Screenshot 2024-05-17 at 03 50 17

@aspark21
Copy link

This also affects MOODLE_403_STABLE but this is linked to the move from PHP8.0 -> PHP8.1

weilai-irl pushed a commit that referenced this issue Jun 5, 2024
weilai-irl pushed a commit that referenced this issue Jun 5, 2024
weilai-irl pushed a commit that referenced this issue Jun 5, 2024
@weilai-irl weilai-irl linked a pull request Jun 5, 2024 that will close this issue
@weilai-irl weilai-irl self-assigned this Jun 5, 2024
@weilai-irl weilai-irl added Issue type - bug Bugs in existing code that needs to be fixed. Plugin - local_o365 Status - PR ready / pending release Dev is done and PR ready. Will be included in the next release. Feature - unittest labels Jun 5, 2024
@weilai-irl weilai-irl added this to the 2024-06 milestone Jun 5, 2024
This was linked to pull requests Jun 5, 2024
@weilai-irl
Copy link
Collaborator

Hi all.

@CarlosArceLopera Thank you for reporting the issue and submitting the PR. I have reviewed the PR and it looks good to me. I'll include it in the next release.

The error is introduced as part of the attempt to optimise Graph API calls that returns paginated results. All actual calls to such Graph APIs are updated, but calls from unit test was missed.

@SYoung3000 what you experienced could well be a separate issue. Please report it separately and include more details (Moodle/plugin versions, steps to reproduce etc).

@aspark21 I don't think this is related to PHP version either. It would happen in all supported PHP versions.

Regards,
Lai

@weilai-irl
Copy link
Collaborator

Hi @CarlosArceLopera

The fix to the issue has been included in the release 4.1.7, 4.2.6 and 4.3.4 from today. Thank you again for reporting the issue and providing the solution.

I'll mark the issue as closed now.

Regards,
Lai

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature - unittest Issue type - bug Bugs in existing code that needs to be fixed. Plugin - local_o365 Status - PR ready / pending release Dev is done and PR ready. Will be included in the next release.
Projects
None yet
4 participants