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

[stable19] LDAP: fix inGroup for memberUid type of group memberships #24739

Closed
wants to merge 6 commits into from

Conversation

tofuSCHNITZEL
Copy link
Contributor

backport for stable19 of #24402

blizzz and others added 6 commits December 17, 2020 01:08
Signed-off-by: Tobias Perschon <tobias@perschon.at>
Signed-off-by: Tobias Perschon <tobias@perschon.at>
Signed-off-by: Tobias Perschon <tobias@perschon.at>
- the type check is not necessary anymore for the return type of
  _groupMembers()

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Signed-off-by: Tobias Perschon <tobias@perschon.at>
@tofuSCHNITZEL tofuSCHNITZEL changed the title Backport/24402/stable19 backport - LDAP: fix inGroup for memberUid type of group memberships Dec 17, 2020
@faily-bot
Copy link

faily-bot bot commented Dec 17, 2020

🤖 beep boop beep 🤖

Here are the logs for the failed build:

Status of 557: failure

sqlite

Show full log
There was 1 error:

1) OCA\User_LDAP\Tests\Group_LDAPTest::testCountEmptySearchString
TypeError: Argument 1 passed to Mock_Access_134dd683::fetchListOfUsers() must be of the type string, null given, called in /drone/src/apps/user_ldap/lib/Group_LDAP.php on line 262

/drone/src/apps/user_ldap/lib/Group_LDAP.php:262
/drone/src/apps/user_ldap/lib/Group_LDAP.php:1012
/drone/src/apps/user_ldap/tests/Group_LDAPTest.php:87

--

There were 3 warnings:

1) Test\Files\ViewTest::testRenameFailDeleteTargetKeepSource
Trying to configure method "writeStream" which cannot be configured because it does not exist, has not been specified, is final, or is static

2) Test\Files\ViewTest::testCopyFailDeleteTargetKeepSource
Trying to configure method "writeStream" which cannot be configured because it does not exist, has not been specified, is final, or is static

3) OCA\Files_Sharing\Tests\External\ManagerTest::testAddShare
Cannot stub or mock class or interface "OCA\Files_Sharing\Tests\External\IManager" which does not exist

mariadb10.1-php7.2

Show full log
There was 1 error:

1) OCA\User_LDAP\Tests\Group_LDAPTest::testCountEmptySearchString
TypeError: Argument 1 passed to Mock_Access_02d72d03::fetchListOfUsers() must be of the type string, null given, called in /drone/src/apps/user_ldap/lib/Group_LDAP.php on line 262

/drone/src/apps/user_ldap/lib/Group_LDAP.php:262
/drone/src/apps/user_ldap/lib/Group_LDAP.php:1012
/drone/src/apps/user_ldap/tests/Group_LDAPTest.php:87

--

There were 3 warnings:

1) Test\Files\ViewTest::testRenameFailDeleteTargetKeepSource
Trying to configure method "writeStream" which cannot be configured because it does not exist, has not been specified, is final, or is static

2) Test\Files\ViewTest::testCopyFailDeleteTargetKeepSource
Trying to configure method "writeStream" which cannot be configured because it does not exist, has not been specified, is final, or is static

3) OCA\Files_Sharing\Tests\External\ManagerTest::testAddShare
Cannot stub or mock class or interface "OCA\Files_Sharing\Tests\External\IManager" which does not exist

mariadb10.4-php7.3

Show full log
There was 1 error:

1) OCA\User_LDAP\Tests\Group_LDAPTest::testCountEmptySearchString
TypeError: Argument 1 passed to Mock_Access_ab819b5f::fetchListOfUsers() must be of the type string, null given, called in /drone/src/apps/user_ldap/lib/Group_LDAP.php on line 262

/drone/src/apps/user_ldap/lib/Group_LDAP.php:262
/drone/src/apps/user_ldap/lib/Group_LDAP.php:1012
/drone/src/apps/user_ldap/tests/Group_LDAPTest.php:87

--

There were 3 warnings:

1) Test\Files\ViewTest::testRenameFailDeleteTargetKeepSource
Trying to configure method "writeStream" which cannot be configured because it does not exist, has not been specified, is final, or is static

2) Test\Files\ViewTest::testCopyFailDeleteTargetKeepSource
Trying to configure method "writeStream" which cannot be configured because it does not exist, has not been specified, is final, or is static

3) OCA\Files_Sharing\Tests\External\ManagerTest::testAddShare
Cannot stub or mock class or interface "OCA\Files_Sharing\Tests\External\IManager" which does not exist

mysql8.0-php7.2

Show full log
There was 1 error:

1) OCA\User_LDAP\Tests\Group_LDAPTest::testCountEmptySearchString
TypeError: Argument 1 passed to Mock_Access_13f994b6::fetchListOfUsers() must be of the type string, null given, called in /drone/src/apps/user_ldap/lib/Group_LDAP.php on line 262

/drone/src/apps/user_ldap/lib/Group_LDAP.php:262
/drone/src/apps/user_ldap/lib/Group_LDAP.php:1012
/drone/src/apps/user_ldap/tests/Group_LDAPTest.php:87

--

There were 3 warnings:

1) Test\Files\ViewTest::testRenameFailDeleteTargetKeepSource
Trying to configure method "writeStream" which cannot be configured because it does not exist, has not been specified, is final, or is static

2) Test\Files\ViewTest::testCopyFailDeleteTargetKeepSource
Trying to configure method "writeStream" which cannot be configured because it does not exist, has not been specified, is final, or is static

3) OCA\Files_Sharing\Tests\External\ManagerTest::testAddShare
Cannot stub or mock class or interface "OCA\Files_Sharing\Tests\External\IManager" which does not exist

mysql5.6-php7.2

Show full log
There was 1 error:

1) OCA\User_LDAP\Tests\Group_LDAPTest::testCountEmptySearchString
TypeError: Argument 1 passed to Mock_Access_e03687da::fetchListOfUsers() must be of the type string, null given, called in /drone/src/apps/user_ldap/lib/Group_LDAP.php on line 262

/drone/src/apps/user_ldap/lib/Group_LDAP.php:262
/drone/src/apps/user_ldap/lib/Group_LDAP.php:1012
/drone/src/apps/user_ldap/tests/Group_LDAPTest.php:87

--

There were 3 warnings:

1) Test\Files\ViewTest::testRenameFailDeleteTargetKeepSource
Trying to configure method "writeStream" which cannot be configured because it does not exist, has not been specified, is final, or is static

2) Test\Files\ViewTest::testCopyFailDeleteTargetKeepSource
Trying to configure method "writeStream" which cannot be configured because it does not exist, has not been specified, is final, or is static

3) OCA\Files_Sharing\Tests\External\ManagerTest::testAddShare
Cannot stub or mock class or interface "OCA\Files_Sharing\Tests\External\IManager" which does not exist

postgres9-php7.3

Show full log
There was 1 error:

1) OCA\User_LDAP\Tests\Group_LDAPTest::testCountEmptySearchString
TypeError: Argument 1 passed to Mock_Access_5005fb4a::fetchListOfUsers() must be of the type string, null given, called in /drone/src/apps/user_ldap/lib/Group_LDAP.php on line 262

/drone/src/apps/user_ldap/lib/Group_LDAP.php:262
/drone/src/apps/user_ldap/lib/Group_LDAP.php:1012
/drone/src/apps/user_ldap/tests/Group_LDAPTest.php:87

--

There were 3 warnings:

1) Test\Files\ViewTest::testRenameFailDeleteTargetKeepSource
Trying to configure method "writeStream" which cannot be configured because it does not exist, has not been specified, is final, or is static

2) Test\Files\ViewTest::testCopyFailDeleteTargetKeepSource
Trying to configure method "writeStream" which cannot be configured because it does not exist, has not been specified, is final, or is static

3) OCA\Files_Sharing\Tests\External\ManagerTest::testAddShare
Cannot stub or mock class or interface "OCA\Files_Sharing\Tests\External\IManager" which does not exist

postgres11-php7.2

Show full log
There was 1 error:

1) OCA\User_LDAP\Tests\Group_LDAPTest::testCountEmptySearchString
TypeError: Argument 1 passed to Mock_Access_b159d878::fetchListOfUsers() must be of the type string, null given, called in /drone/src/apps/user_ldap/lib/Group_LDAP.php on line 262

/drone/src/apps/user_ldap/lib/Group_LDAP.php:262
/drone/src/apps/user_ldap/lib/Group_LDAP.php:1012
/drone/src/apps/user_ldap/tests/Group_LDAPTest.php:87

--

There were 3 warnings:

1) Test\Files\ViewTest::testRenameFailDeleteTargetKeepSource
Trying to configure method "writeStream" which cannot be configured because it does not exist, has not been specified, is final, or is static

2) Test\Files\ViewTest::testCopyFailDeleteTargetKeepSource
Trying to configure method "writeStream" which cannot be configured because it does not exist, has not been specified, is final, or is static

3) OCA\Files_Sharing\Tests\External\ManagerTest::testAddShare
Cannot stub or mock class or interface "OCA\Files_Sharing\Tests\External\IManager" which does not exist

@tofuSCHNITZEL
Copy link
Contributor Author

Status of 557: failure

@blizzz to the rescue - I don't really understand whats going on ;) also it seems to affect the files_sharing app not LDAP?

@blizzz blizzz changed the title backport - LDAP: fix inGroup for memberUid type of group memberships [stable19] LDAP: fix inGroup for memberUid type of group memberships Dec 17, 2020
@blizzz
Copy link
Member

blizzz commented Dec 17, 2020

Status of 557: failure

@blizzz to the rescue - I don't really understand whats going on ;) also it seems to affect the files_sharing app not LDAP?

I believe we have here an older phpunit running. The newer one makes the mocks return an empty value based on the return type hint, e.g. an empty array for arrays. The older runs just returns null. So the mocks in the tests needs to be adjusted and any important method that is call has to be made to return what is expected later on.

@tofuSCHNITZEL
Copy link
Contributor Author

I fear I don't understand enough about these tests to fix this....

@DanScharon
Copy link

any chance to get this backport into 19?

@MichaIng
Copy link
Member

MichaIng commented Jul 6, 2021

I mark this as closed, as Nextcloud 19 won't get any further releases.

EDIT ... oh, don't be sad @backportbot-nextcloud 😄.

@MichaIng MichaIng closed this Jul 6, 2021
@MichaIng MichaIng deleted the backport/24402/stable19 branch July 6, 2021 17:52
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.

None yet

4 participants