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

Enhancement: Widen version constraints #395

Merged
merged 1 commit into from
Dec 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 40 additions & 40 deletions .github/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,52 +14,52 @@ branches:
required_approving_review_count: 1
required_status_checks:
checks:
- context: "Code Coverage (7.4, 8.5.36, locked)"
- context: "Code Coverage (7.4, 8.5.19, locked)"
- context: "Coding Standards (7.4, locked)"
- context: "Compile Phar (8.1, locked)"
- context: "Dependency Analysis (7.4, locked)"
- context: "Refactoring (7.4, locked)"
- context: "Security Analysis (7.4, locked)"
- context: "Static Code Analysis (7.4, locked)"
- context: "Tests (7.4, 8.5.36, highest)"
- context: "Tests (7.4, 8.5.36, highest)"
- context: "Tests (7.4, 8.5.36, locked)"
- context: "Tests (7.4, 8.5.36, locked)"
- context: "Tests (7.4, 8.5.36, lowest)"
- context: "Tests (7.4, 8.5.36, lowest)"
- context: "Tests (8.0, 8.5.36, highest)"
- context: "Tests (8.0, 8.5.36, highest)"
- context: "Tests (8.0, 8.5.36, locked)"
- context: "Tests (8.0, 8.5.36, locked)"
- context: "Tests (8.0, 8.5.36, lowest)"
- context: "Tests (8.0, 8.5.36, lowest)"
- context: "Tests (8.1, 10.4.0, highest)"
- context: "Tests (8.1, 10.4.0, locked)"
- context: "Tests (8.1, 10.4.0, lowest)"
- context: "Tests (8.1, 8.5.36, highest)"
- context: "Tests (8.1, 8.5.36, locked)"
- context: "Tests (8.1, 8.5.36, lowest)"
- context: "Tests (8.1, 9.6.0, highest)"
- context: "Tests (8.1, 9.6.0, locked)"
- context: "Tests (8.1, 9.6.0, lowest)"
- context: "Tests (8.2, 10.4.0, highest)"
- context: "Tests (8.2, 10.4.0, locked)"
- context: "Tests (8.2, 10.4.0, lowest)"
- context: "Tests (8.2, 8.5.36, highest)"
- context: "Tests (8.2, 8.5.36, locked)"
- context: "Tests (8.2, 8.5.36, lowest)"
- context: "Tests (8.2, 9.6.0, highest)"
- context: "Tests (8.2, 9.6.0, locked)"
- context: "Tests (8.2, 9.6.0, lowest)"
- context: "Tests (8.3, 10.4.0, highest)"
- context: "Tests (8.3, 10.4.0, locked)"
- context: "Tests (8.3, 10.4.0, lowest)"
- context: "Tests (8.3, 8.5.36, highest)"
- context: "Tests (8.3, 8.5.36, locked)"
- context: "Tests (8.3, 8.5.36, lowest)"
- context: "Tests (8.3, 9.6.0, highest)"
- context: "Tests (8.3, 9.6.0, locked)"
- context: "Tests (8.3, 9.6.0, lowest)"
- context: "Tests (7.4, 8.5.19, highest)"
- context: "Tests (7.4, 8.5.19, highest)"
- context: "Tests (7.4, 8.5.19, locked)"
- context: "Tests (7.4, 8.5.19, locked)"
- context: "Tests (7.4, 8.5.19, lowest)"
- context: "Tests (7.4, 8.5.19, lowest)"
- context: "Tests (8.0, 8.5.19, highest)"
- context: "Tests (8.0, 8.5.19, highest)"
- context: "Tests (8.0, 8.5.19, locked)"
- context: "Tests (8.0, 8.5.19, locked)"
- context: "Tests (8.0, 8.5.19, lowest)"
- context: "Tests (8.0, 8.5.19, lowest)"
- context: "Tests (8.1, 10.0.0, highest)"
- context: "Tests (8.1, 10.0.0, locked)"
- context: "Tests (8.1, 10.0.0, lowest)"
- context: "Tests (8.1, 8.5.19, highest)"
- context: "Tests (8.1, 8.5.19, locked)"
- context: "Tests (8.1, 8.5.19, lowest)"
- context: "Tests (8.1, 9.0.0, highest)"
- context: "Tests (8.1, 9.0.0, locked)"
- context: "Tests (8.1, 9.0.0, lowest)"
- context: "Tests (8.2, 10.0.0, highest)"
- context: "Tests (8.2, 10.0.0, locked)"
- context: "Tests (8.2, 10.0.0, lowest)"
- context: "Tests (8.2, 8.5.19, highest)"
- context: "Tests (8.2, 8.5.19, locked)"
- context: "Tests (8.2, 8.5.19, lowest)"
- context: "Tests (8.2, 9.0.0, highest)"
- context: "Tests (8.2, 9.0.0, locked)"
- context: "Tests (8.2, 9.0.0, lowest)"
- context: "Tests (8.3, 10.0.0, highest)"
- context: "Tests (8.3, 10.0.0, locked)"
- context: "Tests (8.3, 10.0.0, lowest)"
- context: "Tests (8.3, 8.5.19, highest)"
- context: "Tests (8.3, 8.5.19, locked)"
- context: "Tests (8.3, 8.5.19, lowest)"
- context: "Tests (8.3, 9.0.0, highest)"
- context: "Tests (8.3, 9.0.0, locked)"
- context: "Tests (8.3, 9.0.0, lowest)"
strict: false
restrictions:

Expand Down
40 changes: 20 additions & 20 deletions .github/workflows/integrate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- "7.4"

phpunit-version:
- "8.5.36"
- "8.5.19"

dependencies:
- "locked"
Expand Down Expand Up @@ -465,8 +465,8 @@ jobs:
- "8.3"

phpunit-version:
- "8.5.36"
- "9.6.0"
- "8.5.19"
- "9.0.0"

dependencies:
- "lowest"
Expand All @@ -475,39 +475,39 @@ jobs:

include:
- php-version: "8.1"
phpunit-version: "10.4.0"
phpunit-version: "10.0.0"
dependencies: "lowest"

- php-version: "8.1"
phpunit-version: "10.4.0"
phpunit-version: "10.0.0"
dependencies: "locked"

- php-version: "8.1"
phpunit-version: "10.4.0"
phpunit-version: "10.0.0"
dependencies: "highest"

- php-version: "8.2"
phpunit-version: "10.4.0"
phpunit-version: "10.0.0"
dependencies: "lowest"

- php-version: "8.2"
phpunit-version: "10.4.0"
phpunit-version: "10.0.0"
dependencies: "locked"

- php-version: "8.2"
phpunit-version: "10.4.0"
phpunit-version: "10.0.0"
dependencies: "highest"

- php-version: "8.3"
phpunit-version: "10.4.0"
phpunit-version: "10.0.0"
dependencies: "lowest"

- php-version: "8.3"
phpunit-version: "10.4.0"
phpunit-version: "10.0.0"
dependencies: "locked"

- php-version: "8.3"
phpunit-version: "10.4.0"
phpunit-version: "10.0.0"
dependencies: "highest"

steps:
Expand Down Expand Up @@ -551,18 +551,18 @@ jobs:
with:
dependencies: "${{ matrix.dependencies }}"

- name: "Run unit tests with phpunit/phpunit:9.6.0"
if: "matrix.phpunit-version == '9.6.0'"
- name: "Run unit tests with phpunit/phpunit:9.0.0"
if: "matrix.phpunit-version == '9.0.0'"
run: "vendor/bin/phpunit --colors=always --configuration=test/Unit/phpunit.xml"

- name: "Run end-to-end tests with phpunit/phpunit:8.5.36"
if: "matrix.phpunit-version == '8.5.36'"
- name: "Run end-to-end tests with phpunit/phpunit:8.5.19"
if: "matrix.phpunit-version == '8.5.19'"
run: "vendor/bin/phpunit --colors=always --configuration=test/EndToEnd/Version8/phpunit.xml"

- name: "Run end-to-end tests with phpunit/phpunit:9.6.0"
if: "matrix.phpunit-version == '9.6.0'"
- name: "Run end-to-end tests with phpunit/phpunit:9.0.0"
if: "matrix.phpunit-version == '9.0.0'"
run: "vendor/bin/phpunit --colors=always --configuration=test/EndToEnd/Version9/phpunit.xml"

- name: "Run end-to-end tests with phpunit/phpunit:10.4.0"
if: "matrix.phpunit-version == '10.4.0'"
- name: "Run end-to-end tests with phpunit/phpunit:10.0.0"
if: "matrix.phpunit-version == '10.0.0'"
run: "vendor/bin/phpunit --colors=always --configuration=test/EndToEnd/Version10/phpunit.xml"
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

For a full diff see [`2.6.0...main`][2.6.0...main].

### Changed

- Widened version constraints to allow installation with `phpunit/phpunit:^8.5.19`, `phpunit/phpunit:^9.0.0`, and `phpunit/phpunit:^10.0.0` ([#396]), by [@localheinz]

## [`2.6.0`][2.6.0]

For a full diff see [`2.5.0...2.6.0`][2.5.0...2.6.0].
Expand Down Expand Up @@ -226,6 +230,7 @@ For a full diff see [`7afa59c...1.0.0`][7afa59c...1.0.0].
[#390]: https://github.com/ergebnis/phpunit-slow-test-detector/pull/390
[#393]: https://github.com/ergebnis/phpunit-slow-test-detector/pull/393
[#394]: https://github.com/ergebnis/phpunit-slow-test-detector/pull/394
[#396]: https://github.com/ergebnis/phpunit-slow-test-detector/pull/396

[@HypeMC]: https://github.com/HypeMC
[@localheinz]: https://github.com/localheinz
Expand Down
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ it: refactoring coding-standards security-analysis static-code-analysis tests ##
.PHONY: code-coverage
code-coverage: ## Collects coverage from running unit tests with phpunit/phpunit
mkdir -p .build/phpunit/
composer remove ergebnis/php-cs-fixer-config psalm/plugin-phpunit vimeo/psalm --dev --no-interaction --no-progress; composer require phpunit/phpunit:^8.5.36 --no-interaction --quiet --update-with-all-dependencies; vendor/bin/phpunit --configuration=test/Unit/phpunit.xml --coverage-text; git checkout HEAD -- composer.json composer.lock
composer remove ergebnis/php-cs-fixer-config psalm/plugin-phpunit vimeo/psalm --dev --no-interaction --no-progress; composer require phpunit/phpunit:^8.5.19 --no-interaction --quiet --update-with-all-dependencies; vendor/bin/phpunit --configuration=test/Unit/phpunit.xml --coverage-text; git checkout HEAD -- composer.json composer.lock

.PHONY: coding-standards
coding-standards: vendor ## Lints YAML files with yamllint, normalizes composer.json with ergebnis/composer-normalize, and fixes code style issues with friendsofphp/php-cs-fixer
Expand Down Expand Up @@ -60,10 +60,10 @@ static-code-analysis-baseline: vendor ## Generates a baseline for static code an
.PHONY: tests
tests: ## Runs unit and end-to-end tests with phpunit/phpunit
mkdir -p .build/phpunit
composer remove ergebnis/php-cs-fixer-config psalm/plugin-phpunit vimeo/psalm --dev --no-interaction --no-progress; composer require phpunit/phpunit:^8.5.36 --no-interaction --quiet --update-with-all-dependencies; vendor/bin/phpunit --configuration=test/Unit/phpunit.xml; git checkout HEAD -- composer.json composer.lock
composer remove ergebnis/php-cs-fixer-config psalm/plugin-phpunit vimeo/psalm --dev --no-interaction --no-progress; composer require phpunit/phpunit:^8.5.36 --no-interaction --quiet --update-with-all-dependencies; vendor/bin/phpunit --configuration=test/EndToEnd/Version8/phpunit.xml; git checkout HEAD -- composer.json composer.lock
composer remove ergebnis/php-cs-fixer-config psalm/plugin-phpunit vimeo/psalm --dev --no-interaction --no-progress; composer require phpunit/phpunit:^9.6.0 --no-interaction --quiet --update-with-all-dependencies; vendor/bin/phpunit --configuration=test/EndToEnd/Version9/phpunit.xml; git checkout HEAD -- composer.json composer.lock
composer remove ergebnis/php-cs-fixer-config psalm/plugin-phpunit vimeo/psalm --dev --no-interaction --no-progress; composer require phpunit/phpunit:^10.4.0 --no-interaction --quiet --update-with-all-dependencies; vendor/bin/phpunit --configuration=test/EndToEnd/Version10/phpunit.xml; git checkout HEAD -- composer.json composer.lock
composer remove ergebnis/php-cs-fixer-config psalm/plugin-phpunit vimeo/psalm --dev --no-interaction --no-progress; composer require phpunit/phpunit:^8.5.19 --no-interaction --quiet --update-with-all-dependencies; vendor/bin/phpunit --configuration=test/Unit/phpunit.xml; git checkout HEAD -- composer.json composer.lock
composer remove ergebnis/php-cs-fixer-config psalm/plugin-phpunit vimeo/psalm --dev --no-interaction --no-progress; composer require phpunit/phpunit:^8.5.19 --no-interaction --quiet --update-with-all-dependencies; vendor/bin/phpunit --configuration=test/EndToEnd/Version8/phpunit.xml; git checkout HEAD -- composer.json composer.lock
composer remove ergebnis/php-cs-fixer-config psalm/plugin-phpunit vimeo/psalm --dev --no-interaction --no-progress; composer require phpunit/phpunit:^9.0.0 --no-interaction --quiet --update-with-all-dependencies; vendor/bin/phpunit --configuration=test/EndToEnd/Version9/phpunit.xml; git checkout HEAD -- composer.json composer.lock
composer remove ergebnis/php-cs-fixer-config psalm/plugin-phpunit vimeo/psalm --dev --no-interaction --no-progress; composer require phpunit/phpunit:^10.0.0 --no-interaction --quiet --update-with-all-dependencies; vendor/bin/phpunit --configuration=test/EndToEnd/Version10/phpunit.xml; git checkout HEAD -- composer.json composer.lock

vendor: composer.json composer.lock
composer validate --strict
Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ This package provides an extension for detecting slow tests in [`phpunit/phpunit

The extension is compatible with the following versions of `phpunit/phpunit`:

- [`phpunit/phpunit:^8.5.36`](https://github.com/sebastianbergmann/phpunit/tree/8.5.36)
- [`phpunit/phpunit:^9.6.0`](https://github.com/sebastianbergmann/phpunit/tree/9.6.0)
- [`phpunit/phpunit:^10.4.0`](https://github.com/sebastianbergmann/phpunit/tree/10.4.0)
- [`phpunit/phpunit:^8.5.19`](https://github.com/sebastianbergmann/phpunit/tree/8.5.19)
- [`phpunit/phpunit:^9.0.0`](https://github.com/sebastianbergmann/phpunit/tree/9.0.0)
- [`phpunit/phpunit:^10.0.0`](https://github.com/sebastianbergmann/phpunit/tree/10.0.0)

## Installation

Expand All @@ -40,7 +40,7 @@ Download `phpunit-slow-test-detector.phar` from the [latest release](https://git

### Bootstrapping the extension as a `composer` package

To bootstrap the extension as a `composer` package when using `phpunit/phpunit:^8.5.14` or `phpunit/phpunit:^9.6.0`, adjust your `phpunit.xml` configuration file and configure the [`extensions` element](https://docs.phpunit.de/en/9.6/configuration.html#the-extensions-element):
To bootstrap the extension as a `composer` package when using `phpunit/phpunit:^8.5.19` or `phpunit/phpunit:^9.0.0`, adjust your `phpunit.xml` configuration file and configure the [`extensions` element](https://docs.phpunit.de/en/9.6/configuration.html#the-extensions-element):

```diff
<phpunit
Expand All @@ -59,7 +59,7 @@ To bootstrap the extension as a `composer` package when using `phpunit/phpunit:^
</phpunit>
```

To bootstrap the extension as a `composer` package when using `phpunit/phpunit:^10.4.0`, adjust your `phpunit.xml` configuration file and configure the [`extensions` element](https://docs.phpunit.de/en/10.4/configuration.html#the-extensions-element):
To bootstrap the extension as a `composer` package when using `phpunit/phpunit:^10.0.0`, adjust your `phpunit.xml` configuration file and configure the [`extensions` element](https://docs.phpunit.de/en/10.4/configuration.html#the-extensions-element):

```diff
<phpunit
Expand All @@ -80,7 +80,7 @@ To bootstrap the extension as a `composer` package when using `phpunit/phpunit:^

### Bootstrapping the extension as a PHAR

To bootstrap the extension as a PHAR when using `phpunit/phpunit:^10.4.0`, adjust your `phpunit.xml` configuration file and configure the [`extensionsDirectory` attribute](https://docs.phpunit.de/en/10.4/configuration.html#the-extensionsdirectory-attribute) of the [`<phpunit>` element](https://docs.phpunit.de/en/10.4/configuration.html#the-phpunit-element):
To bootstrap the extension as a PHAR when using `phpunit/phpunit:^10.0.0`, adjust your `phpunit.xml` configuration file and configure the [`extensionsDirectory` attribute](https://docs.phpunit.de/en/10.4/configuration.html#the-extensionsdirectory-attribute) of the [`<phpunit>` element](https://docs.phpunit.de/en/10.4/configuration.html#the-phpunit-element):

```diff
<phpunit
Expand All @@ -107,7 +107,7 @@ You can configure the extension with the following parameters in your `phpunit.x
- `maximum-count`, an `int`, the maximum count of slow test that should be listed, defaults to `10`
- `maximum-duration`, an `int`, the maximum duration in milliseconds for all tests, defaults to `500`

The following example configures the maximum count of slow tests to three, and the maximum duration for all tests to 250 milliseconds when using `phpunit/phpunit:^10.4.0`:
The following example configures the maximum count of slow tests to three, and the maximum duration for all tests to 250 milliseconds when using `phpunit/phpunit:^10.0.0`:

```diff
<phpunit
Expand All @@ -130,7 +130,7 @@ The following example configures the maximum count of slow tests to three, and t
</phpunit>
```

The following example configures the maximum count of slow tests to three, and the maximum duration for all tests to 250 milliseconds when using `phpunit/phpunit:^8.5.0` or `phpunit/phpunit:^9.6.0`:
The following example configures the maximum count of slow tests to three, and the maximum duration for all tests to 250 milliseconds when using `phpunit/phpunit:^8.5.19` or `phpunit/phpunit:^9.0.0`:

```diff
<phpunit
Expand Down Expand Up @@ -218,7 +218,7 @@ vendor/bin/phpunit
When the extension has detected slow tests, it will report them:

```txt
PHPUnit 10.4.0 by Sebastian Bergmann and contributors.
PHPUnit 10.0.0 by Sebastian Bergmann and contributors.

Runtime: PHP 8.1.0
Configuration: test/EndToEnd/Default/phpunit.xml
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
},
"require": {
"php": "~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0",
"phpunit/phpunit": "^8.5.36 || ^9.6.0 || ^10.4.0"
"phpunit/phpunit": "^8.5.19 || ^9.0.0 || ^10.0.0"
Copy link
Member Author

Choose a reason for hiding this comment

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

},
"require-dev": {
"ergebnis/composer-normalize": "^2.28.3",
Expand Down
2 changes: 1 addition & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions test/EndToEnd/Version10/DefaultConfiguration/test.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ $application = new TextUI\Application();

$application->run($_SERVER['argv']);
--EXPECTF--
PHPUnit %s by Sebastian Bergmann and contributors.
PHPUnit %s

Runtime: %s
Configuration: %Stest/EndToEnd/Version10/DefaultConfiguration/phpunit.xml
Random Seed: %s
Random %seed: %s

............ 12 / 12 (100%)

Expand Down
4 changes: 2 additions & 2 deletions test/EndToEnd/Version10/MaximumCount/Three/test.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ $application = new TextUI\Application();

$application->run($_SERVER['argv']);
--EXPECTF--
PHPUnit %s by Sebastian Bergmann and contributors.
PHPUnit %s

Runtime: %s
Configuration: %Stest/EndToEnd/Version10/MaximumCount/Three/phpunit.xml
Random Seed: %s
Random %seed: %s

..... 5 / 5 (100%)

Expand Down
4 changes: 2 additions & 2 deletions test/EndToEnd/Version10/MaximumDuration/Fifty/test.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ $application = new TextUI\Application();

$application->run($_SERVER['argv']);
--EXPECTF--
PHPUnit %s by Sebastian Bergmann and contributors.
PHPUnit %s

Runtime: %s
Configuration: %Stest/EndToEnd/Version10/MaximumDuration/Fifty/phpunit.xml
Random Seed: %s
Random %seed: %s

............. 13 / 13 (100%)

Expand Down
2 changes: 1 addition & 1 deletion test/EndToEnd/Version10/phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.4/phpunit.xsd"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd"
beStrictAboutChangesToGlobalState="true"
beStrictAboutCoverageMetadata="true"
beStrictAboutOutputDuringTests="true"
Expand Down
4 changes: 2 additions & 2 deletions test/EndToEnd/Version8/DefaultConfiguration/test.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ require_once __DIR__ . '/../../../../vendor/autoload.php';

PHPUnit\TextUI\Command::main();
--EXPECTF--
PHPUnit %s by Sebastian Bergmann and contributors.
PHPUnit %s

Runtime: %s
Configuration: %Stest/EndToEnd/Version8/DefaultConfiguration/phpunit.xml
Random seed: %s
Random %seed: %s

............ 12 / 12 (100%)

Expand Down
4 changes: 2 additions & 2 deletions test/EndToEnd/Version8/MaximumCount/Three/test.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ require_once __DIR__ . '/../../../../../vendor/autoload.php';

PHPUnit\TextUI\Command::main();
--EXPECTF--
PHPUnit %s by Sebastian Bergmann and contributors.
PHPUnit %s

Runtime: %s
Configuration: %Stest/EndToEnd/Version8/MaximumCount/Three/phpunit.xml
Random seed: %s
Random %seed: %s

..... 5 / 5 (100%)

Expand Down
Loading