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

[WIP] Bump phpunit 7 #34877

Closed
wants to merge 10 commits into from
Closed

[WIP] Bump phpunit 7 #34877

wants to merge 10 commits into from

Conversation

phil-davis
Copy link
Contributor

Description

See what happens, and then if it might help #34858

Note: PHPUnit7 requires PHP7.1, so it cannot help in stable10 while it still supports PHP7.0.

Related Issue

maybe can help #34858

Motivation and Context

How Has This Been Tested?

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Database schema changes (next release will require increase of minor version instead of patch)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests only (no source changes)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:

Open tasks:

  • Backport (if applicable set "backport-request" label and remove when the backport was done)

@codecov
Copy link

codecov bot commented Mar 22, 2019

Codecov Report

Merging #34877 into master will decrease coverage by 16.95%.
The diff coverage is n/a.

Impacted file tree graph

@@              Coverage Diff              @@
##             master   #34877       +/-   ##
=============================================
- Coverage     65.35%    48.4%   -16.96%     
=============================================
  Files          1208      109     -1099     
  Lines         69969    10475    -59494     
  Branches       1280     1280               
=============================================
- Hits          45726     5070    -40656     
+ Misses        23871     5033    -18838     
  Partials        372      372
Flag Coverage Δ Complexity Δ
#javascript 53.04% <ø> (ø) 0 <ø> (ø) ⬇️
#phpunit 38.14% <ø> (-28.63%) 0 <ø> (-18484)
Impacted Files Coverage Δ Complexity Δ
lib/private/Files/Storage/DAV.php 59.45% <0%> (-21.64%) 0% <0%> (ø)
apps/files_external/lib/Command/ListCommand.php 66.66% <0%> (-1%) 0% <0%> (ø)
apps/files_external/lib/Lib/Storage/SMB.php 47.6% <0%> (-0.34%) 0% <0%> (ø)
apps/files_external/lib/Command/Backends.php 0% <0%> (ø) 0% <0%> (ø) ⬇️
apps/files_external/lib/AppInfo/Application.php 0% <0%> (ø) 0% <0%> (ø) ⬇️
apps/files_external/lib/Command/Import.php 0% <0%> (ø) 0% <0%> (ø) ⬇️
apps/updatenotification/templates/admin.php
lib/private/Encryption/Keys/Storage.php
lib/private/App/CodeChecker/NodeVisitor.php
lib/private/RedisFactory.php
... and 1092 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c845954...e1f5296. Read the comment docs.

@codecov
Copy link

codecov bot commented Mar 22, 2019

Codecov Report

Merging #34877 into master will increase coverage by 16.47%.
The diff coverage is n/a.

Impacted file tree graph

@@              Coverage Diff              @@
##             master   #34877       +/-   ##
=============================================
+ Coverage     48.39%   64.87%   +16.47%     
- Complexity        0    17814    +17814     
=============================================
  Files           109     1208     +1099     
  Lines         10493    69814    +59321     
  Branches       1280     1280               
=============================================
+ Hits           5078    45290    +40212     
- Misses         5043    24152    +19109     
  Partials        372      372
Flag Coverage Δ Complexity Δ
#javascript 53.04% <ø> (ø) 0 <ø> (ø) ⬇️
#phpunit 66.23% <ø> (+28.05%) 17814 <ø> (+17814) ⬆️
Impacted Files Coverage Δ Complexity Δ
...eratedfilesharing/lib/Middleware/OcmMiddleware.php 76.74% <ø> (ø) 19 <0> (?)
...pps/comments/tests/unit/Dav/RootCollectionTest.php 98.36% <ø> (ø) 17 <0> (?)
...mments/tests/unit/Dav/EntityTypeCollectionTest.php 100% <ø> (ø) 6 <0> (?)
tests/bootstrap.php 0% <ø> (ø) 0 <0> (?)
...s/comments/tests/unit/Dav/EntityCollectionTest.php 100% <ø> (ø) 8 <0> (?)
apps/files_external/lib/config.php 10.71% <0%> (-20.87%) 19% <0%> (+19%)
apps/files_external/lib/Command/ListCommand.php 66.66% <0%> (-1%) 0% <0%> (ø)
apps/files_external/lib/Lib/Storage/SMB.php 47.6% <0%> (-0.34%) 0% <0%> (ø)
apps/files_external/lib/Command/Backends.php 0% <0%> (ø) 0% <0%> (ø) ⬇️
apps/files_external/lib/AppInfo/Application.php 0% <0%> (ø) 0% <0%> (ø) ⬇️
... and 1102 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3f4a433...024760a. Read the comment docs.

@phil-davis
Copy link
Contributor Author

phil-davis commented Mar 23, 2019

Commit cleaner-ignore phpunit/phpunit phpunit.xsd stops dg/composer-cleaner from removing phpunit.xsd. That fixes:

 phpdbg -d memory_limit=4096M -rr ./lib/composer/bin/phpunit --configuration tests/phpunit-autotest.xml --coverage-clover tests/output/coverage/autotest-clover-mysql.xml
[Welcome to phpdbg, the interactive PHP debugger, v0.5.0]
To get help using phpdbg type "help" and press enter
[Please report bugs to <http://bugs.php.net/report.php>]
[PHP Warning:  DOMDocument::schemaValidate(): Invalid Schema in /drone/src/lib/composer/phpunit/phpunit/src/Util/Configuration.php on line 1034]
PHPUnit 7.5.7 by Sebastian Bergmann and contributors.

Runtime:       PHPDBG 7.1.27-1+ubuntu16.04.1+deb.sury.org+1
Configuration: /drone/src/tests/phpunit-autotest.xml

  Warning - The configuration file did not pass validation!
  The following problems have been detected:

  Line 0:
  - failed to load external entity "/drone/src/lib/composer/phpunit/phpunit/phpunit.xsd"
  - Failed to locate the main schema resource at '/drone/src/lib/composer/phpunit/phpunit/phpunit.xsd'.

  Test results may not be as expected.

Commit ApiTest testUpdateShare ensure message is a string before passing fixes:

There was 1 error:

1) OCA\Files_Sharing\Tests\ApiTest::testUpdateShare
TypeError: Argument 2 passed to PHPUnit\Framework\Assert::assertTrue() must be of the type string, null given, called in /drone/src/apps/files_sharing/tests/ApiTest.php on line 1028

/drone/src/apps/files_sharing/tests/ApiTest.php:1028

Commit Do not try to mock private method themeExist fixes:

There were 2 warnings:

1) Test\legacy\DefaultsTest::testGetShortFooterFromCore
Trying to configure method "themeExist" which cannot be configured because it does not exist, has not been specified, is final, or is static

2) Test\legacy\DefaultsTest::testGetImprintWhenNotInstalled
Trying to configure method "themeExist" which cannot be configured because it does not exist, has not been specified, is final, or is static

@phil-davis
Copy link
Contributor Author

Commit Adjust LegacyDBTest testDecimal to pass on sqlite
See issue #34880
The change in the commit makes it so the test passes. It remains to be decided if underlying code needs to be "fixed" somewhere, rather than adjusting the test.

@phil-davis
Copy link
Contributor Author

Commit Adjust testPathVerificationAstralPlane to avoid 'risky' message avoids:

1) Test\Files\PathVerificationTest::testPathVerificationAstralPlane with data set #0 ('🐵')
This test did not perform any assertions

/drone/src/tests/lib/Files/PathVerificationTest.php:83

@phil-davis phil-davis force-pushed the bump-phpunit-7 branch 2 times, most recently from a92d7ee to 77ce410 Compare March 25, 2019 05:16
@phil-davis
Copy link
Contributor Author

See PR #34921 for the next version of this.

@phil-davis phil-davis closed this Mar 29, 2019
@phil-davis phil-davis deleted the bump-phpunit-7 branch March 29, 2019 04:56
@lock lock bot locked as resolved and limited conversation to collaborators Apr 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant