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

lib/private/User: always pass old value to 'triggerChange' in User class, do not change user properties if value has not changed #14566

Conversation

leonklingele-work
Copy link

No description provided.

@MorrisJobke MorrisJobke added bug 3. to review Waiting for reviews labels Mar 6, 2019
@MorrisJobke MorrisJobke added this to the Nextcloud 16 milestone Mar 6, 2019
@@ -365,7 +365,8 @@ public function setEnabled(bool $enabled = true) {
$oldStatus = $this->isEnabled();
$this->enabled = $enabled;
if ($oldStatus !== $this->enabled) {
$this->triggerChange('enabled', $enabled);
// TODO: First change the value, then trigger the event as done for all other properties.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with moving it one line to the bottom to be after the change was made. 👍 Could you make this change?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, this will change behavior: Everyone currently rejecting an changeUser event where enabled is modified by throwing an exception would need to revert the change to enabled (as enabled will then be updated even though the exception is thrown).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was never meant for this and doing this is also not the way to handle such stuff. It's highly recommended to not manipulate data via this mechanism. This is also documented and communicated like this.

Also I couldn't find any code that does it like that. Do you know any app that does this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also those events are pure one way only events.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is also documented and communicated like this.

Oh, where?

Do you know any app that does this?

Our (Struktur-proprietary) app needs to reject modifications to a user under certain conditions, throwing an exception from a changeUser-hook callback works great.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is also documented and communicated like this.

Oh, where?

I thought it was - but https://docs.nextcloud.com/server/stable/developer_manual/app/hooks.html doesn't has it. Maybe it was only on Github and never made it into the docs 😢.

Do you know any app that does this?

Our (Struktur-proprietary) app needs to reject modifications to a user under certain conditions, throwing an exception from a changeUser-hook callback works great.

If at all then there needs to be a pre event to differentiate between the use cases.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, see #14565.

Copy link
Member

@MorrisJobke MorrisJobke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code in general looks good 👍

$result = $this->backend->setDisplayName($this->uid, $displayName);
if ($result) {
$this->displayName = $displayName;
$this->triggerChange('displayName', $displayName);
$this->triggerChange('displayName', $displayName, $oldDisplayName);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check the other places where this hook is triggered:

  • lib/private/User/User.php (remove or adapt?)

Also there is

  • apps/user_ldap/lib/User/User.php

because it is not called externally, but when changes in LDAP were discovered. This cannot be removed, should be adopted. It should not intervene with User:setDisplayName.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

@MorrisJobke MorrisJobke mentioned this pull request Mar 6, 2019
9 tasks
@leonklingele-work leonklingele-work force-pushed the lib-private-user-trigger-pass-old branch from fcfa7de to 1f00338 Compare March 11, 2019 09:23
@MorrisJobke
Copy link
Member

@rullzer @nickvergessen @blizzz Mind to review this one?

Copy link
Member

@rullzer rullzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure... 🐘

@MorrisJobke
Copy link
Member

@leonklingele-work @leonklingele Mind to add the sign-off messages like described in https://github.com/nextcloud/server/pull/14566/checks?check_run_id=75870774 ? Then this one can go in. While doing this please also rebase on latest master - there we fixed the failing tests.

@blizzz
Copy link
Member

blizzz commented Mar 20, 2019

Some tests are failing and need adjustments. Others (LDAP integration) as well, but this does not seem to be due to this changes → a rebase would be nice.

@MorrisJobke MorrisJobke added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels Mar 20, 2019
@MorrisJobke
Copy link
Member

@leonklingele-work 🏓

@MorrisJobke
Copy link
Member

Rebased version to check CI: #14788

@MorrisJobke MorrisJobke added 2. developing Work in progress and removed 4. to release Ready to be released and/or waiting for tests to finish labels Mar 21, 2019
@rullzer rullzer mentioned this pull request Mar 26, 2019
9 tasks
@MorrisJobke
Copy link
Member

@leonklingele-work Mind to check out the failing unit tests?

@leonklingele-work leonklingele-work force-pushed the lib-private-user-trigger-pass-old branch from 1b128be to fe9f121 Compare April 1, 2019 12:44
@MorrisJobke MorrisJobke added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Apr 1, 2019
@MorrisJobke
Copy link
Member

Still failing tests:

Status of 17446: failure

ENABLE_REDIS=true, TESTS=db-codecov

Show full log
There were 3 failures:

1) OCA\Files_Sharing\Tests\CacheTest::testGetFolderContentsInRoot
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'User One'
+'test-share-user1'

/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:472
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:456
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:359

2) OCA\Files_Sharing\Tests\CacheTest::testGetFolderContentsInSubdir
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'User One'
+'test-share-user1'

/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:472
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:456
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:390

3) OCA\Files_Sharing\Tests\CacheTest::testGetFolderContentsWhenSubSubdirShared
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'User One'
+'test-share-user1'

/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:472
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:456
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:436

--

There was 1 risky test:

1) OCA\TwoFactorBackupCodes\Tests\Db\BackupCodeMapperTest::testInsertArgonEncryptedCodes
This test did not perform any assertions

DB=sqlite, ENABLE_REDIS=true, PHP=7.1

Show full log
There were 3 failures:

1) OCA\Files_Sharing\Tests\CacheTest::testGetFolderContentsInRoot
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'User One'
+'test-share-user1'

/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:472
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:456
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:359

2) OCA\Files_Sharing\Tests\CacheTest::testGetFolderContentsInSubdir
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'User One'
+'test-share-user1'

/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:472
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:456
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:390

3) OCA\Files_Sharing\Tests\CacheTest::testGetFolderContentsWhenSubSubdirShared
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'User One'
+'test-share-user1'

/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:472
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:456
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:436

--

There was 1 risky test:

1) OCA\TwoFactorBackupCodes\Tests\Db\BackupCodeMapperTest::testInsertArgonEncryptedCodes
This test did not perform any assertions

DB=sqlite, ENABLE_REDIS=false, PHP=7.2

Show full log
There were 3 failures:

1) OCA\Files_Sharing\Tests\CacheTest::testGetFolderContentsInRoot
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'User One'
+'test-share-user1'

/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:472
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:456
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:359

2) OCA\Files_Sharing\Tests\CacheTest::testGetFolderContentsInSubdir
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'User One'
+'test-share-user1'

/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:472
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:456
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:390

3) OCA\Files_Sharing\Tests\CacheTest::testGetFolderContentsWhenSubSubdirShared
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'User One'
+'test-share-user1'

/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:472
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:456
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:436

--

There was 1 risky test:

1) OCA\TwoFactorBackupCodes\Tests\Db\BackupCodeMapperTest::testInsertArgonEncryptedCodes
This test did not perform any assertions

DB=sqlite, ENABLE_REDIS=false, PHP=7.3

Show full log
There were 3 failures:

1) OCA\Files_Sharing\Tests\CacheTest::testGetFolderContentsInRoot
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'User One'
+'test-share-user1'

/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:472
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:456
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:340

2) OCA\Files_Sharing\Tests\CacheTest::testGetFolderContentsInSubdir
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'User One'
+'test-share-user1'

/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:472
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:456
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:369

3) OCA\Files_Sharing\Tests\CacheTest::testGetFolderContentsWhenSubSubdirShared
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'User One'
+'test-share-user1'

/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:472
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:456
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:415

--

There was 1 risky test:

1) OCA\TwoFactorBackupCodes\Tests\Db\BackupCodeMapperTest::testInsertArgonEncryptedCodes
This test did not perform any assertions

DB=mysql, ENABLE_REDIS=true, PHP=7.1

Show full log
There were 3 failures:

1) OCA\Files_Sharing\Tests\CacheTest::testGetFolderContentsInRoot
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'User One'
+'test-share-user1'

/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:472
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:456
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:359

2) OCA\Files_Sharing\Tests\CacheTest::testGetFolderContentsInSubdir
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'User One'
+'test-share-user1'

/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:472
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:456
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:390

3) OCA\Files_Sharing\Tests\CacheTest::testGetFolderContentsWhenSubSubdirShared
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'User One'
+'test-share-user1'

/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:472
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:456
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:436

--

There was 1 risky test:

1) OCA\TwoFactorBackupCodes\Tests\Db\BackupCodeMapperTest::testInsertArgonEncryptedCodes
This test did not perform any assertions

DB=mysql, ENABLE_REDIS=false, PHP=7.2

Show full log
There were 3 failures:

1) OCA\Files_Sharing\Tests\CacheTest::testGetFolderContentsInRoot
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'User One'
+'test-share-user1'

/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:472
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:456
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:359

2) OCA\Files_Sharing\Tests\CacheTest::testGetFolderContentsInSubdir
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'User One'
+'test-share-user1'

/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:472
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:456
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:390

3) OCA\Files_Sharing\Tests\CacheTest::testGetFolderContentsWhenSubSubdirShared
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'User One'
+'test-share-user1'

/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:472
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:456
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:436

--

There was 1 risky test:

1) OCA\TwoFactorBackupCodes\Tests\Db\BackupCodeMapperTest::testInsertArgonEncryptedCodes
This test did not perform any assertions

DB=mysql, ENABLE_REDIS=false, PHP=7.3

Show full log
There were 3 failures:

1) OCA\Files_Sharing\Tests\CacheTest::testGetFolderContentsInRoot
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'User One'
+'test-share-user1'

/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:472
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:456
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:340

2) OCA\Files_Sharing\Tests\CacheTest::testGetFolderContentsInSubdir
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'User One'
+'test-share-user1'

/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:472
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:456
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:369

3) OCA\Files_Sharing\Tests\CacheTest::testGetFolderContentsWhenSubSubdirShared
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'User One'
+'test-share-user1'

/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:472
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:456
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:415

--

There was 1 risky test:

1) OCA\TwoFactorBackupCodes\Tests\Db\BackupCodeMapperTest::testInsertArgonEncryptedCodes
This test did not perform any assertions

DB=mysql5.6, ENABLE_REDIS=true, PHP=7.1

Show full log
There were 3 failures:

1) OCA\Files_Sharing\Tests\CacheTest::testGetFolderContentsInRoot
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'User One'
+'test-share-user1'

/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:472
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:456
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:359

2) OCA\Files_Sharing\Tests\CacheTest::testGetFolderContentsInSubdir
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'User One'
+'test-share-user1'

/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:472
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:456
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:390

3) OCA\Files_Sharing\Tests\CacheTest::testGetFolderContentsWhenSubSubdirShared
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'User One'
+'test-share-user1'

/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:472
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:456
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:436

--

There was 1 risky test:

1) OCA\TwoFactorBackupCodes\Tests\Db\BackupCodeMapperTest::testInsertArgonEncryptedCodes
This test did not perform any assertions

DB=mysql5.5, ENABLE_REDIS=true, PHP=7.1

Show full log
There were 3 failures:

1) OCA\Files_Sharing\Tests\CacheTest::testGetFolderContentsInRoot
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'User One'
+'test-share-user1'

/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:472
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:456
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:359

2) OCA\Files_Sharing\Tests\CacheTest::testGetFolderContentsInSubdir
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'User One'
+'test-share-user1'

/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:472
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:456
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:390

3) OCA\Files_Sharing\Tests\CacheTest::testGetFolderContentsWhenSubSubdirShared
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'User One'
+'test-share-user1'

/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:472
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:456
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:436

--

There was 1 risky test:

1) OCA\TwoFactorBackupCodes\Tests\Db\BackupCodeMapperTest::testInsertArgonEncryptedCodes
This test did not perform any assertions

DB=postgres, ENABLE_REDIS=true, PHP=7.1, POSTGRES=9

Show full log
There were 3 failures:

1) OCA\Files_Sharing\Tests\CacheTest::testGetFolderContentsInRoot
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'User One'
+'test-share-user1'

/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:472
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:456
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:359

2) OCA\Files_Sharing\Tests\CacheTest::testGetFolderContentsInSubdir
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'User One'
+'test-share-user1'

/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:472
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:456
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:390

3) OCA\Files_Sharing\Tests\CacheTest::testGetFolderContentsWhenSubSubdirShared
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'User One'
+'test-share-user1'

/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:472
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:456
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:436

--

There was 1 risky test:

1) OCA\TwoFactorBackupCodes\Tests\Db\BackupCodeMapperTest::testInsertArgonEncryptedCodes
This test did not perform any assertions

DB=postgres, ENABLE_REDIS=true, PHP=7.1, POSTGRES=10

Show full log
There were 3 failures:

1) OCA\Files_Sharing\Tests\CacheTest::testGetFolderContentsInRoot
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'User One'
+'test-share-user1'

/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:472
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:456
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:359

2) OCA\Files_Sharing\Tests\CacheTest::testGetFolderContentsInSubdir
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'User One'
+'test-share-user1'

/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:472
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:456
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:390

3) OCA\Files_Sharing\Tests\CacheTest::testGetFolderContentsWhenSubSubdirShared
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'User One'
+'test-share-user1'

/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:472
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:456
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:436

--

There was 1 risky test:

1) OCA\TwoFactorBackupCodes\Tests\Db\BackupCodeMapperTest::testInsertArgonEncryptedCodes
This test did not perform any assertions

DB=mysqlmb4, ENABLE_REDIS=true, PHP=7.1

Show full log
There were 3 failures:

1) OCA\Files_Sharing\Tests\CacheTest::testGetFolderContentsInRoot
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'User One'
+'test-share-user1'

/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:472
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:456
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:359

2) OCA\Files_Sharing\Tests\CacheTest::testGetFolderContentsInSubdir
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'User One'
+'test-share-user1'

/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:472
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:456
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:390

3) OCA\Files_Sharing\Tests\CacheTest::testGetFolderContentsWhenSubSubdirShared
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'User One'
+'test-share-user1'

/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:472
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:456
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:436

--

There was 1 risky test:

1) OCA\TwoFactorBackupCodes\Tests\Db\BackupCodeMapperTest::testInsertArgonEncryptedCodes
This test did not perform any assertions

DB=mysqlmb4, ENABLE_REDIS=false, PHP=7.2

Show full log
There were 3 failures:

1) OCA\Files_Sharing\Tests\CacheTest::testGetFolderContentsInRoot
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'User One'
+'test-share-user1'

/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:472
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:456
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:359

2) OCA\Files_Sharing\Tests\CacheTest::testGetFolderContentsInSubdir
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'User One'
+'test-share-user1'

/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:472
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:456
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:390

3) OCA\Files_Sharing\Tests\CacheTest::testGetFolderContentsWhenSubSubdirShared
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'User One'
+'test-share-user1'

/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:472
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:456
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:436

--

There was 1 risky test:

1) OCA\TwoFactorBackupCodes\Tests\Db\BackupCodeMapperTest::testInsertArgonEncryptedCodes
This test did not perform any assertions

DB=mysqlmb4, ENABLE_REDIS=false, PHP=7.3

Show full log
There were 3 failures:

1) OCA\Files_Sharing\Tests\CacheTest::testGetFolderContentsInRoot
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'User One'
+'test-share-user1'

/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:472
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:456
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:340

2) OCA\Files_Sharing\Tests\CacheTest::testGetFolderContentsInSubdir
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'User One'
+'test-share-user1'

/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:472
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:456
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:369

3) OCA\Files_Sharing\Tests\CacheTest::testGetFolderContentsWhenSubSubdirShared
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'User One'
+'test-share-user1'

/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:472
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:456
/drone/src/github.com/nextcloud/server/apps/files_sharing/tests/CacheTest.php:415

--

There was 1 risky test:

1) OCA\TwoFactorBackupCodes\Tests\Db\BackupCodeMapperTest::testInsertArgonEncryptedCodes
This test did not perform any assertions

@nickvergessen
Copy link
Member

For me the tests also fail on master:

$ git pull origin master 
remote: Enumerating objects: 43, done.
remote: Counting objects: 100% (43/43), done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 54 (delta 38), reused 39 (delta 37), pack-reused 11
Unpacking objects: 100% (54/54), done.
From https://github.com/nextcloud/server
 * branch                  master     -> FETCH_HEAD
   c55ac95e1b..d515a64570  master     -> origin/master
Updating c55ac95e1b..d515a64570
Fast-forward
 apps/files/css/files.scss              |  8 ++++++--
 apps/files_sharing/l10n/lt_LT.js       | 29 +++++++++++++++++++++++------
 apps/files_sharing/l10n/lt_LT.json     | 29 +++++++++++++++++++++++------
 core/css/styles.scss                   | 13 +++++++++++++
 core/js/oc-dialogs.js                  | 18 ++++++++++++++++++
 core/templates/filepicker.html         |  6 +++++-
 lib/private/DB/MigrationService.php    | 12 ++++++------
 resources/app-info.xsd                 | 11 ++++++++++-
 tests/acceptance/features/apps.feature | 16 ++++++++--------
 9 files changed, 112 insertions(+), 30 deletions(-)
$ git show
commit d515a645704ecc14472d276da85dc75d37a7dd21 (HEAD -> master, origin/master, origin/HEAD)
Merge: 021751658e 49acc28d90
Author: Roeland Jago Douma <rullzer@users.noreply.github.com>
Date:   Tue Apr 2 09:38:13 2019 +0200

    Merge pull request #14775 from nextcloud/revert-14774-fix/bundle_enable_tests
    
    Revert "Temp disable bundle tests"

$ ./autotest.sh sqlite apps/files_sharing/tests/CacheTest.php 
Using PHP executable /usr/bin/php
Parsing all files in lib/public for the presence of @since or @deprecated on each method...

Using database oc_autotest
Setup environment for sqlite testing on local storage ...
0 Pfade vom Index aktualisiert
Installing ....
Nextcloud was successfully installed
Testing with sqlite ...
No coverage
/home/nickv/Tools/vendor/bin/phpunit --configuration phpunit-autotest.xml --log-junit autotest-results-sqlite.xml ../apps/files_sharing/tests/CacheTest.php 
PHPUnit 6.5.14 by Sebastian Bergmann and contributors.

Runtime:       PHP 7.1.27-1+ubuntu18.10.1+deb.sury.org+1 with Xdebug 2.7.0
Configuration: /home/nickv/Nextcloud/16/server/tests/phpunit-autotest.xml

....FFF....                                                       11 / 11 (100%)

Time: 3.88 seconds, Memory: 28.00MB

There were 3 failures:

1) OCA\Files_Sharing\Tests\CacheTest::testGetFolderContentsInRoot
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'User One'
+'test-share-user1'

/home/nickv/Nextcloud/16/server/apps/files_sharing/tests/CacheTest.php:472
/home/nickv/Nextcloud/16/server/apps/files_sharing/tests/CacheTest.php:456
/home/nickv/Nextcloud/16/server/apps/files_sharing/tests/CacheTest.php:359

2) OCA\Files_Sharing\Tests\CacheTest::testGetFolderContentsInSubdir
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'User One'
+'test-share-user1'

/home/nickv/Nextcloud/16/server/apps/files_sharing/tests/CacheTest.php:472
/home/nickv/Nextcloud/16/server/apps/files_sharing/tests/CacheTest.php:456
/home/nickv/Nextcloud/16/server/apps/files_sharing/tests/CacheTest.php:390

3) OCA\Files_Sharing\Tests\CacheTest::testGetFolderContentsWhenSubSubdirShared
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'User One'
+'test-share-user1'

/home/nickv/Nextcloud/16/server/apps/files_sharing/tests/CacheTest.php:472
/home/nickv/Nextcloud/16/server/apps/files_sharing/tests/CacheTest.php:456
/home/nickv/Nextcloud/16/server/apps/files_sharing/tests/CacheTest.php:436

FAILURES!
Tests: 11, Assertions: 125, Failures: 3.

@MorrisJobke
Copy link
Member

For me the tests also fail on master:

Works here: https://drone.nextcloud.com/nextcloud/server/17450 🤔

@MorrisJobke
Copy link
Member

But they fail locally for me as well. Let me bisect.

@MorrisJobke
Copy link
Member

But they fail locally for me as well. Let me bisect.

Seems to be a local issue. I tried all of them and all fail:

git checkout "master@{1 week ago}"
git checkout "master@{2 week ago}"
git checkout "master@{4 week ago}"
git checkout "master@{8 week ago}"
git checkout "master@{8 week ago}"
git checkout "master@{16 week ago}"
git checkout "master@{1 year ago}"
git checkout "master@{2 year ago}"

I guess we found a race condition here - could that be? One that never showed up on CI, but on local runs only?

@MorrisJobke MorrisJobke mentioned this pull request Apr 3, 2019
2 tasks
@MorrisJobke
Copy link
Member

Let's get this in an check if the new drone architecture also triggers this.

@MorrisJobke
Copy link
Member

Opened in a new PR to debug failing CI: #14967

@MorrisJobke
Copy link
Member

Partially added via #15052 to properly debug the CI failure in smaller steps.

@MorrisJobke
Copy link
Member

Let's close this one here in favor of #14967 and #15052

@MorrisJobke MorrisJobke removed this from the Nextcloud 16 milestone Apr 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants