Skip to content

Commit

Permalink
Merge pull request #395 from ergebnis/feature/constraint
Browse files Browse the repository at this point in the history
Enhancement: Widen version constraints
  • Loading branch information
localheinz committed Dec 3, 2023
2 parents 8f4dfad + a688179 commit 0b8134e
Show file tree
Hide file tree
Showing 20 changed files with 103 additions and 98 deletions.
80 changes: 40 additions & 40 deletions .github/settings.yml
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
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
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
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
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
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"
},
"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
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
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
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
@@ -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
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
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

0 comments on commit 0b8134e

Please sign in to comment.