mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 07:47:22 +01:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| cc6bd59df9 | |||
| 3ce6408195 | |||
| 221ac62f03 | |||
| 4b6c949032 | |||
| 1408cffc02 | |||
| 95b5379945 | |||
| cb1c777b9b | |||
| 176d3efbc6 | |||
| d635665c1b | |||
| 22467d05c8 |
41
.github/workflows/integration-tests.yml
vendored
Normal file
41
.github/workflows/integration-tests.yml
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
name: Integration Tests
|
||||
|
||||
on:
|
||||
push:
|
||||
schedule:
|
||||
- cron: '0 0 * * *'
|
||||
|
||||
|
||||
jobs:
|
||||
ci:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||
php: ['8.1', '8.2']
|
||||
dependency-version: [prefer-lowest, prefer-stable]
|
||||
|
||||
name: PHP ${{ matrix.php }} - ${{ matrix.os }} - ${{ matrix.dependency-version }}
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: ${{ matrix.php }}
|
||||
tools: composer:v2
|
||||
coverage: none
|
||||
|
||||
- name: Setup Problem Matches
|
||||
run: |
|
||||
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
|
||||
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
|
||||
|
||||
- name: Install PHP dependencies
|
||||
run: composer update --${{ matrix.dependency-version }} --no-interaction --no-progress --ansi
|
||||
|
||||
- name: Integration Tests
|
||||
run: composer test:integration
|
||||
|
||||
3
.github/workflows/tests.yml
vendored
3
.github/workflows/tests.yml
vendored
@ -43,6 +43,3 @@ jobs:
|
||||
- name: Unit Tests in Parallel
|
||||
run: composer test:parallel
|
||||
if: startsWith(matrix.os, 'windows') != true
|
||||
|
||||
- name: Integration Tests
|
||||
run: composer test:integration
|
||||
|
||||
13
CHANGELOG.md
13
CHANGELOG.md
@ -2,6 +2,19 @@
|
||||
|
||||
## Unreleased
|
||||
|
||||
## [v2.2.2 (2023-03-23)](https://github.com/pestphp/pest/compare/v2.2.1...v2.2.2)
|
||||
|
||||
### Fixed
|
||||
- Edge case in parallel executation test description ([3ce6408](https://github.com/pestphp/pest/commit/3ce640819541ca6022b250e000f336d87c3e7889))
|
||||
|
||||
## [v2.2.1 (2023-03-22)](https://github.com/pestphp/pest/compare/v2.2.0...v2.2.1)
|
||||
|
||||
### Fixed
|
||||
- Collision between tests names with underscores ([#724](https://github.com/pestphp/pest/pull/724))
|
||||
|
||||
### Chore
|
||||
- Bumps PHPUnit to `^10.0.18` ([1408cff](https://github.com/pestphp/pest/commit/1408cffc028690057e44f00038f9390f776e6bfb))
|
||||
|
||||
## [v2.2.0 (2023-03-22)](https://github.com/pestphp/pest/compare/v2.1.0...v2.2.0)
|
||||
|
||||
### Added
|
||||
|
||||
@ -19,15 +19,15 @@
|
||||
"require": {
|
||||
"php": "^8.1.0",
|
||||
"brianium/paratest": "^7.1.2",
|
||||
"nunomaduro/collision": "^7.3.2",
|
||||
"nunomaduro/collision": "^7.3.3",
|
||||
"nunomaduro/termwind": "^1.15.1",
|
||||
"pestphp/pest-plugin": "^2.0.0",
|
||||
"pestphp/pest-plugin-arch": "^2.0.1",
|
||||
"phpunit/phpunit": "^10.0.17"
|
||||
"phpunit/phpunit": "^10.0.18"
|
||||
},
|
||||
"conflict": {
|
||||
"webmozart/assert": "<1.11.0",
|
||||
"phpunit/phpunit": ">10.0.17"
|
||||
"phpunit/phpunit": ">10.0.18"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
|
||||
@ -6,7 +6,7 @@ namespace Pest;
|
||||
|
||||
function version(): string
|
||||
{
|
||||
return '2.2.0';
|
||||
return '2.2.2';
|
||||
}
|
||||
|
||||
function testDirectory(string $file = ''): string
|
||||
|
||||
@ -24,7 +24,7 @@ final class StateGenerator
|
||||
|
||||
foreach ($testResult->testErroredEvents() as $testResultEvent) {
|
||||
if ($testResultEvent instanceof Errored) {
|
||||
$state->add(TestResult::fromTestCase(
|
||||
$state->add(TestResult::fromPestParallelTestCase(
|
||||
$testResultEvent->test(),
|
||||
TestResult::FAIL,
|
||||
$testResultEvent->throwable()
|
||||
@ -35,7 +35,7 @@ final class StateGenerator
|
||||
}
|
||||
|
||||
foreach ($testResult->testFailedEvents() as $testResultEvent) {
|
||||
$state->add(TestResult::fromTestCase(
|
||||
$state->add(TestResult::fromPestParallelTestCase(
|
||||
$testResultEvent->test(),
|
||||
TestResult::FAIL,
|
||||
$testResultEvent->throwable()
|
||||
@ -43,7 +43,7 @@ final class StateGenerator
|
||||
}
|
||||
|
||||
foreach ($testResult->testMarkedIncompleteEvents() as $testResultEvent) {
|
||||
$state->add(TestResult::fromTestCase(
|
||||
$state->add(TestResult::fromPestParallelTestCase(
|
||||
$testResultEvent->test(),
|
||||
TestResult::INCOMPLETE,
|
||||
$testResultEvent->throwable()
|
||||
@ -52,7 +52,7 @@ final class StateGenerator
|
||||
|
||||
foreach ($testResult->testConsideredRiskyEvents() as $riskyEvents) {
|
||||
foreach ($riskyEvents as $riskyEvent) {
|
||||
$state->add(TestResult::fromTestCase(
|
||||
$state->add(TestResult::fromPestParallelTestCase(
|
||||
$riskyEvent->test(),
|
||||
TestResult::RISKY,
|
||||
ThrowableBuilder::from(new TestOutcome($riskyEvent->message()))
|
||||
@ -62,12 +62,12 @@ final class StateGenerator
|
||||
|
||||
foreach ($testResult->testSkippedEvents() as $testResultEvent) {
|
||||
if ($testResultEvent->message() === '__TODO__') {
|
||||
$state->add(TestResult::fromTestCase($testResultEvent->test(), TestResult::TODO));
|
||||
$state->add(TestResult::fromPestParallelTestCase($testResultEvent->test(), TestResult::TODO));
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
$state->add(TestResult::fromTestCase(
|
||||
$state->add(TestResult::fromPestParallelTestCase(
|
||||
$testResultEvent->test(),
|
||||
TestResult::SKIPPED,
|
||||
ThrowableBuilder::from(new SkippedWithMessageException($testResultEvent->message()))
|
||||
@ -77,7 +77,7 @@ final class StateGenerator
|
||||
foreach ($testResult->testTriggeredDeprecationEvents() as $testResultEvent) {
|
||||
$testResultEvent = $testResultEvent[0];
|
||||
|
||||
$state->add(TestResult::fromTestCase(
|
||||
$state->add(TestResult::fromPestParallelTestCase(
|
||||
$testResultEvent->test(),
|
||||
TestResult::DEPRECATED,
|
||||
ThrowableBuilder::from(new TestOutcome($testResultEvent->message()))
|
||||
@ -87,7 +87,7 @@ final class StateGenerator
|
||||
foreach ($testResult->testTriggeredPhpDeprecationEvents() as $testResultEvent) {
|
||||
$testResultEvent = $testResultEvent[0];
|
||||
|
||||
$state->add(TestResult::fromTestCase(
|
||||
$state->add(TestResult::fromPestParallelTestCase(
|
||||
$testResultEvent->test(),
|
||||
TestResult::DEPRECATED,
|
||||
ThrowableBuilder::from(new TestOutcome($testResultEvent->message()))
|
||||
@ -97,7 +97,7 @@ final class StateGenerator
|
||||
foreach ($testResult->testTriggeredNoticeEvents() as $testResultEvent) {
|
||||
$testResultEvent = $testResultEvent[0];
|
||||
|
||||
$state->add(TestResult::fromTestCase(
|
||||
$state->add(TestResult::fromPestParallelTestCase(
|
||||
$testResultEvent->test(),
|
||||
TestResult::NOTICE,
|
||||
ThrowableBuilder::from(new TestOutcome($testResultEvent->message()))
|
||||
@ -107,7 +107,7 @@ final class StateGenerator
|
||||
foreach ($testResult->testTriggeredPhpNoticeEvents() as $testResultEvent) {
|
||||
$testResultEvent = $testResultEvent[0];
|
||||
|
||||
$state->add(TestResult::fromTestCase(
|
||||
$state->add(TestResult::fromPestParallelTestCase(
|
||||
$testResultEvent->test(),
|
||||
TestResult::NOTICE,
|
||||
ThrowableBuilder::from(new TestOutcome($testResultEvent->message()))
|
||||
@ -117,7 +117,7 @@ final class StateGenerator
|
||||
foreach ($testResult->testTriggeredWarningEvents() as $testResultEvent) {
|
||||
$testResultEvent = $testResultEvent[0];
|
||||
|
||||
$state->add(TestResult::fromTestCase(
|
||||
$state->add(TestResult::fromPestParallelTestCase(
|
||||
$testResultEvent->test(),
|
||||
TestResult::WARN,
|
||||
ThrowableBuilder::from(new TestOutcome($testResultEvent->message()))
|
||||
@ -127,7 +127,7 @@ final class StateGenerator
|
||||
foreach ($testResult->testTriggeredPhpWarningEvents() as $testResultEvent) {
|
||||
$testResultEvent = $testResultEvent[0];
|
||||
|
||||
$state->add(TestResult::fromTestCase(
|
||||
$state->add(TestResult::fromPestParallelTestCase(
|
||||
$testResultEvent->test(),
|
||||
TestResult::WARN,
|
||||
ThrowableBuilder::from(new TestOutcome($testResultEvent->message()))
|
||||
@ -136,7 +136,7 @@ final class StateGenerator
|
||||
|
||||
// for each test that passed, we need to add it to the state
|
||||
for ($i = 0; $i < $passedTests; $i++) {
|
||||
$state->add(TestResult::fromTestCase(
|
||||
$state->add(TestResult::fromPestParallelTestCase(
|
||||
new TestMethod(
|
||||
"$i", // @phpstan-ignore-line
|
||||
'', // @phpstan-ignore-line
|
||||
|
||||
@ -59,6 +59,8 @@ final class Str
|
||||
*/
|
||||
public static function evaluable(string $code): string
|
||||
{
|
||||
$code = str_replace('_', '__', $code);
|
||||
|
||||
$code = self::PREFIX.str_replace(' ', '_', $code);
|
||||
|
||||
// sticks to PHP8.2 function naming rules https://www.php.net/manual/en/functions.user-defined.php
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
|
||||
⨯.
|
||||
────────────────────────────────────────────────────────────────────────────
|
||||
FAILED Tests\Fixtures\CollisionTest > success Exception
|
||||
FAILED Tests\Fixtures\CollisionTest > error Exception
|
||||
error
|
||||
|
||||
at tests/Fixtures/CollisionTest.php:4
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
|
||||
Pest Testing Framework 2.2.0.
|
||||
Pest Testing Framework 2.2.2.
|
||||
|
||||
USAGE: pest <file> [options]
|
||||
|
||||
|
||||
@ -909,7 +909,7 @@
|
||||
|
||||
PASS Tests\Unit\Support\Str
|
||||
✓ it evaluates the code with ('version()', '__pest_evaluable_version__')
|
||||
✓ it evaluates the code with ('version__ ', '__pest_evaluable_version___')
|
||||
✓ it evaluates the code with ('version__ ', '__pest_evaluable_version_____')
|
||||
✓ it evaluates the code with ('version\', '__pest_evaluable_version_')
|
||||
|
||||
PASS Tests\Unit\TestName
|
||||
@ -918,6 +918,8 @@
|
||||
✓ it may start with P with ('P\PPPackages\Foo', 'PPPackages\Foo')
|
||||
✓ it may start with P with ('PPPackages\Foo', 'PPPackages\Foo') #1
|
||||
✓ it may start with P with ('PPPackages\Foo', 'PPPackages\Foo') #2
|
||||
✓ test description
|
||||
✓ test_description
|
||||
✓ ふ+が+
|
||||
✓ ほげ
|
||||
✓ 卜竹弓一十山
|
||||
@ -1002,4 +1004,4 @@
|
||||
PASS Tests\Visual\Version
|
||||
✓ visual snapshot of help command output
|
||||
|
||||
Tests: 2 deprecated, 3 warnings, 4 incomplete, 1 notice, 4 todos, 14 skipped, 701 passed (1698 assertions)
|
||||
Tests: 2 deprecated, 3 warnings, 4 incomplete, 1 notice, 4 todos, 14 skipped, 703 passed (1702 assertions)
|
||||
@ -1,3 +1,3 @@
|
||||
|
||||
Pest Testing Framework 2.2.0.
|
||||
Pest Testing Framework 2.2.2.
|
||||
|
||||
|
||||
@ -8,6 +8,6 @@ it('evaluates the code', function ($evaluatable, $expected) {
|
||||
expect($code)->toBe($expected);
|
||||
})->with([
|
||||
['version()', '__pest_evaluable_version__'],
|
||||
['version__ ', '__pest_evaluable_version___'],
|
||||
['version__ ', '__pest_evaluable_version_____'],
|
||||
['version\\', '__pest_evaluable_version_'],
|
||||
]);
|
||||
|
||||
@ -13,6 +13,8 @@ it('may start with P', function (string $real, string $toBePrinted) {
|
||||
]);
|
||||
|
||||
$names = [
|
||||
'test description' => '__pest_evaluable_test_description',
|
||||
'test_description' => '__pest_evaluable_test__description',
|
||||
'ふ+が+' => '__pest_evaluable_ふ_が_',
|
||||
'ほげ' => '__pest_evaluable_ほげ',
|
||||
'卜竹弓一十山' => '__pest_evaluable_卜竹弓一十山',
|
||||
|
||||
@ -15,6 +15,6 @@ $run = function () {
|
||||
};
|
||||
|
||||
test('parallel', function () use ($run) {
|
||||
expect($run())->toContain('Tests: 2 deprecated, 3 warnings, 4 incomplete, 1 notice, 4 todos, 11 skipped, 690 passed (1684 assertions)')
|
||||
expect($run())->toContain('Tests: 2 deprecated, 3 warnings, 4 incomplete, 1 notice, 4 todos, 11 skipped, 692 passed (1688 assertions)')
|
||||
->toContain('Parallel: 3 processes');
|
||||
})->skip(PHP_OS_FAMILY === 'Windows');
|
||||
|
||||
Reference in New Issue
Block a user