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

Run oci tests against phpunit9/php8 #24827

Merged
merged 3 commits into from
Sep 28, 2021
Merged

Run oci tests against phpunit9/php8 #24827

merged 3 commits into from
Sep 28, 2021

Conversation

juliushaertl
Copy link
Member

@juliushaertl juliushaertl commented Dec 23, 2020

  • Run OCI unit tests against PHP8 and PHPunit9
  • Fix tests in tests/Core that have not been executed for a while due to the uppercase directory name
  • Fix use of removed getAnnotations method

@juliushaertl juliushaertl force-pushed the bugfix/phpunit9 branch 2 times, most recently from 8c67120 to 24abe25 Compare January 5, 2021 07:53
@juliushaertl
Copy link
Member Author

I expected worse:

There were 89 warnings:
The at() matcher has been deprecated. It will be removed in PHPUnit 10. Please refactor your test to not rely on the order in which methods are invoked.

@juliushaertl juliushaertl force-pushed the bugfix/phpunit9 branch 2 times, most recently from 0f28cbb to 6c88597 Compare January 5, 2021 14:16
@nextcloud nextcloud deleted a comment from faily-bot bot Jan 5, 2021
@juliushaertl juliushaertl marked this pull request as ready for review January 5, 2021 15:43
@juliushaertl juliushaertl added the 3. to review Waiting for reviews label Jan 5, 2021
@juliushaertl juliushaertl added this to the Nextcloud 21 milestone Jan 5, 2021
@faily-bot
Copy link

faily-bot bot commented Jan 5, 2021

🤖 beep boop beep 🤖

Here are the logs for the failed build:

Status of 993: failure

nodb

Show full log
There were 4 errors:

1) Tests\Core\Controller\AutoCompleteControllerTest::testGet with data set #0 (array(array(array(), array()), array(array('Alice A.', array('alice')), array('Bob Y.', array('bob')))), array(array('alice', 'Alice A.', 'users'), array('bob', 'Bob Y.', 'users')), '', 'files', '42', null)
Undefined index: status

/drone/src/core/Controller/AutoCompleteController.php:119
/drone/src/core/Controller/AutoCompleteController.php:105
/drone/src/tests/Core/Controller/AutoCompleteControllerTest.php:170

2) Tests\Core\Controller\AutoCompleteControllerTest::testGet with data set #1 (array(array(array(), array()), array(array('Alice A.', array('alice')), array('Bob Y.', array('bob')))), array(array('alice', 'Alice A.', 'users'), array('bob', 'Bob Y.', 'users')), '', null, null, null)
Undefined index: status

/drone/src/core/Controller/AutoCompleteController.php:119
/drone/src/core/Controller/AutoCompleteController.php:105
/drone/src/tests/Core/Controller/AutoCompleteControllerTest.php:170

3) Tests\Core\Controller\AutoCompleteControllerTest::testGet with data set #2 (array(array(array(), array()), array(array('Alice A.', array('alice')), array('Bob Y.', array('bob')))), array(array('alice', 'Alice A.', 'users'), array('bob', 'Bob Y.', 'users')), '', 'files', '42', 'karma|bus-factor')
Undefined index: status

/drone/src/core/Controller/AutoCompleteController.php:119
/drone/src/core/Controller/AutoCompleteController.php:105
/drone/src/tests/Core/Controller/AutoCompleteControllerTest.php:170

4) Tests\Core\Controller\AutoCompleteControllerTest::testGet with data set #3 (array(array(array(array('Bob Y.', array('bob'))), array()), array(array('Robert R.', array('bobby')))), array(array('bob', 'Bob Y.', 'users'), array('bobby', 'Robert R.', 'users')), 'bob', 'files', '42', null)
Undefined index: status

/drone/src/core/Controller/AutoCompleteController.php:119
/drone/src/core/Controller/AutoCompleteController.php:105
/drone/src/tests/Core/Controller/AutoCompleteControllerTest.php:170

--

There were 11 warnings:

1) Test\AppFramework\Controller\AuthPublicShareControllerTest::testAuthenticateAuthenticated
Trying to configure method "isAuthenticated" which cannot be configured because it does not exist, has not been specified, is final, or is static

2) Test\Support\Subscription\RegistryTest::testDelegateIsHardUserLimitReachedWithoutSupportAppAndUserCount with data set #0 (35, 15, 2, false)
Cannot stub or mock class or interface "Test\Support\Subscription\UserInterface" which does not exist

3) Test\Support\Subscription\RegistryTest::testDelegateIsHardUserLimitReachedWithoutSupportAppAndUserCount with data set #1 (35, 45, 15, false)
Cannot stub or mock class or interface "Test\Support\Subscription\UserInterface" which does not exist

4) Test\Support\Subscription\RegistryTest::testDelegateIsHardUserLimitReachedWithoutSupportAppAndUserCount with data set #2 (35, 45, 5, true)
Cannot stub or mock class or interface "Test\Support\Subscription\UserInterface" which does not exist

5) Test\Support\Subscription\RegistryTest::testDelegateIsHardUserLimitReachedWithoutSupportAppAndUserCount with data set #3 (35, 45, 55, false)
Cannot stub or mock class or interface "Test\Support\Subscription\UserInterface" which does not exist

6) OCA\DAV\Tests\unit\CalDAV\CalendarTest::testConfidentialClassification with data set #0 (3, false)
No method rule is set

7) Warning
The data provider specified for ExpirationTest::testGetMaxAgeAsTimestamp is invalid.
PHPUnit\Util\Exception: Method timestampTestData does not exist

8) OCA\Settings\Tests\Mailer\NewUserMailHelperTest::testGenerateTemplateWithPasswordResetToken
Method getTime may not return value of type string, its return declaration is ": int"

9) OCA\TwoFactorBackupCodes\Tests\Unit\Listener\ActivityPublisherTest::testHandleCodesGeneratedEvent
Method publish may not return value of type Mock_IEvent_fce5efeb, its return declaration is ": void"

10) OCA\UpdateNotification\Tests\Notification\BackgroundJobTest::testCreateNotifications with data set #1 ('app2', '1.0.1', '1.0.0', '1.0.0', true, array('user1'), array(array('user1')))
Method notify may not return value of type Mock_INotification_94c2ca1b, its return declaration is ": void"

11) OCA\UpdateNotification\Tests\Notification\BackgroundJobTest::testCreateNotifications with data set #2 ('app3', '1.0.1', false, false, true, array('user2', 'user3'), array(array('user2'), array('user3')))
Method notify may not return value of type Mock_INotification_94c2ca1b, its return declaration is ": void"

sqlite

Show full log

mysql8.0-php7.4

Show full log
There was 1 error:

1) Test\Files\ObjectStore\ObjectStoreStorageTest::testCopy with data set #4 ('/source.txt', '/tärgét.txt')
copy(/tmp/oc_tmp_v2Lw8d-folder/urn:oid:1223): failed to open stream: No such file or directory

/drone/src/lib/private/Files/Storage/Local.php:351
/drone/src/lib/private/Files/ObjectStore/StorageObjectStore.php:99
/drone/src/lib/private/Files/ObjectStore/ObjectStoreStorage.php:580
/drone/src/lib/private/Files/ObjectStore/ObjectStoreStorage.php:561
/drone/src/lib/private/Files/ObjectStore/ObjectStoreStorage.php:543
/drone/src/tests/lib/Files/Storage/Storage.php:232

integration-ldap-openldap-uid-features

  • failure block could not be found - most likely this run got canceled
Show full log
+ bash tests/drone-run-integration-tests.sh || exit 0
=========================
= List of changed files =
=========================
.github/workflows/oci.yml
core/Controller/AutoCompleteController.php
tests/Core/Command/Apps/AppsDisableTest.php
tests/Core/Command/Apps/AppsEnableTest.php
tests/Core/Command/Preview/RepairTest.php
tests/lib/TestCase.php
tests/phpunit-autotest.xml
=========================
YML files are modified
+ ./occ maintenance:install --admin-pass=admin --data-dir=/dev/shm/nc_int
Nextcloud was successfully installed
+ ./occ config:system:set redis host --value=cache
System config value redis => host set to string cache
+ ./occ config:system:set redis port --value=6379 --type=integer
System config value redis => port set to integer 6379
+ ./occ config:system:set redis timeout --value=0 --type=integer
System config value redis => timeout set to integer 0
+ ./occ config:system:set --type string --value "\OC\Memcache\Redis" memcache.local
System config value memcache.local set to string \OC\Memcache\Redis
+ ./occ config:system:set --type string --value "\OC\Memcache\Redis" memcache.distributed
PHP Warning:  Redis::connect(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /drone/src/lib/private/RedisFactory.php on line 92
An unhandled exception has been thrown:
RedisException: Redis server went away in /drone/src/lib/private/Memcache/Redis.php:55
Stack trace:
#0 /drone/src/lib/private/Memcache/Redis.php(55): Redis->get('4afcf3bd73954ae...')
#1 /drone/src/lib/private/App/InfoParser.php(58): OC\Memcache\Redis->get('/drone/src/apps...')
#2 /drone/src/lib/private/App/AppManager.php(511): OC\App\InfoParser->parse('/drone/src/apps...')
#3 /drone/src/lib/private/legacy/OC_App.php(589): OC\App\AppManager->getAppInfo('files', false, NULL)
#4 /drone/src/lib/private/AppFramework/App.php(70): OC_App::getAppInfo('files')
#5 /drone/src/lib/private/legacy/OC_App.php(270): OC\AppFramework\App::buildAppNamespace('files')
#6 /drone/src/lib/private/AppFramework/Bootstrap/Coordinator.php(108): OC_App::registerAutoloading('files', '/drone/src/apps...')
#7 /drone/src/lib/private/AppFramework/Bootstrap/Coordinator.php(82): OC\AppFramework\Bootstrap\Coordinator->registerApps(Array)
#8 /drone/src/lib/base.php(644): OC\AppFramework\Bootstrap\Coordinator->runInitialRegistration()
#9 /drone/src/lib/base.php(1091): OC::init()
#10 /drone/src/console.php(49): require_once('/drone/src/lib/...')
#11 /drone/src/occ(11): require_once('/drone/src/cons...')

@rullzer rullzer mentioned this pull request Jan 6, 2021
5 tasks
@rullzer rullzer modified the milestones: Nextcloud 21, Nextcloud 22 Jan 6, 2021
@nickvergessen
Copy link
Member

  1. Test\User\DatabaseTest::testSearch
    Failed asserting that actual size 3 matches expected size 2.

@rullzer
Copy link
Member

rullzer commented Mar 30, 2021

So what are the next steps?

@kesselb
Copy link
Contributor

kesselb commented Mar 30, 2021

Merged master and "solved" the conflicts.

  • Fix tests in tests/Core that have not been executed for a while due to the uppercase directory name

replaced by #26265

  • Fix use of removed getAnnotations method

replaced by #26353

If the CI is happy let me cleanup the commits a bit before we merge.

Copy link
Member

@blizzz blizzz left a comment

Choose a reason for hiding this comment

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

🧹

@@ -33,6 +33,7 @@
use OCP\IDBConnection;
use OCP\IL10N;
use OCP\Security\ISecureRandom;
use PHPUnit\Util\Test;
Copy link
Member

Choose a reason for hiding this comment

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

unused

Copy link
Member

Choose a reason for hiding this comment

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

this statement is still superfluous, isn't it?

Copy link
Member

Choose a reason for hiding this comment

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

CI will tell us. I'll remove it now.

@MorrisJobke MorrisJobke mentioned this pull request May 20, 2021
@MorrisJobke
Copy link
Member

🏓

@MorrisJobke MorrisJobke mentioned this pull request May 26, 2021
98 tasks
@blizzz blizzz mentioned this pull request Jun 2, 2021
57 tasks
@blizzz
Copy link
Member

blizzz commented Jun 2, 2021

conflicts

@MorrisJobke MorrisJobke mentioned this pull request Jun 10, 2021
59 tasks
@blizzz blizzz mentioned this pull request Jun 16, 2021
45 tasks
@MichaIng
Copy link
Member

Rebased and conflicts solved.

Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
… anything useful

Signed-off-by: Julius Härtl <jus@bitgrid.net>
@kesselb kesselb merged commit ee987d7 into master Sep 28, 2021
@kesselb kesselb deleted the bugfix/phpunit9 branch September 28, 2021 06:36
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants