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

Implement sorting tests by size annotation #3749

Merged
merged 5 commits into from Jul 7, 2019
Merged

Implement sorting tests by size annotation #3749

merged 5 commits into from Jul 7, 2019

Conversation

epdenouden
Copy link
Contributor

Implements #3748: option to sort tests by @small, @medium and @large size annotation.

Changes

  • add --order-by=size CLI flag
  • add executionOrder=size configuration attribute
  • added size annotation support to DataProviderTestSuite
  • expanded TestWithDifferentSizes including data providers and @depends
  • removed unused TestCase::is[Small|Medium|Large]

Testing

./phpunit --debug --order-by=size tests/_files/TestWithDifferentSizes.php   
[...]
                                          
Test 'TestWithDifferentSizes::testWithSizeSmall' started
Test 'TestWithDifferentSizes::testWithSizeSmall' ended
Test 'TestWithDifferentSizes::testDataProviderWithSizeSmall with data set #0 (false)' started
Test 'TestWithDifferentSizes::testDataProviderWithSizeSmall with data set #0 (false)' ended
Test 'TestWithDifferentSizes::testDataProviderWithSizeSmall with data set #1 (true)' started
Test 'TestWithDifferentSizes::testDataProviderWithSizeSmall with data set #1 (true)' ended
Test 'TestWithDifferentSizes::testDataProviderWithSizeMedium with data set #0 (false)' started
Test 'TestWithDifferentSizes::testDataProviderWithSizeMedium with data set #0 (false)' ended
Test 'TestWithDifferentSizes::testDataProviderWithSizeMedium with data set #1 (true)' started
Test 'TestWithDifferentSizes::testDataProviderWithSizeMedium with data set #1 (true)' ended
Test 'TestWithDifferentSizes::testWithSizeMedium' started
Test 'TestWithDifferentSizes::testWithSizeMedium' ended
Test 'TestWithDifferentSizes::testWithSizeLarge' started
Test 'TestWithDifferentSizes::testWithSizeLarge' ended
Test 'TestWithDifferentSizes::testWithSizeUnknown' started
Test 'TestWithDifferentSizes::testWithSizeUnknown' ended
[...]

@codecov
Copy link

codecov bot commented Jul 6, 2019

Codecov Report

Merging #3749 into master will decrease coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #3749      +/-   ##
============================================
- Coverage     81.97%   81.95%   -0.02%     
- Complexity     3801     3811      +10     
============================================
  Files           150      150              
  Lines         10074    10099      +25     
============================================
+ Hits           8258     8277      +19     
- Misses         1816     1822       +6
Impacted Files Coverage Δ Complexity Δ
src/TextUI/Help.php 100% <ø> (ø) 24 <0> (ø) ⬇️
src/Util/Configuration.php 96.41% <100%> (+0.01%) 186 <0> (+1) ⬆️
src/TextUI/Command.php 70.14% <100%> (+0.14%) 212 <0> (+1) ⬆️
src/Framework/DataProviderTestSuite.php 100% <100%> (ø) 5 <1> (+1) ⬆️
src/Runner/TestSuiteSorter.php 100% <100%> (ø) 61 <6> (+7) ⬆️
src/Framework/TestCase.php 75.3% <0%> (-0.67%) 330% <0%> (ø)

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 ce8db89...6bf533f. Read the comment docs.

@codecov

This comment has been minimized.

@psalm-shepherd
Copy link

Psalm didn’t find any errors!

@epdenouden epdenouden changed the title Implement sorting test by size annotation Implement sorting tests by size annotation Jul 6, 2019
@sebastianbergmann sebastianbergmann added this to the PHPUnit 8.3 milestone Jul 7, 2019
@sebastianbergmann sebastianbergmann added the type/enhancement A new idea that should be implemented label Jul 7, 2019
@sebastianbergmann sebastianbergmann merged commit 60eba40 into sebastianbergmann:master Jul 7, 2019
@sebastianbergmann
Copy link
Owner

Thanks!

@epdenouden epdenouden deleted the issue-3748-sorting-by-size-names branch July 7, 2019 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement A new idea that should be implemented
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants