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

Name of data set is missing from TeamCity output #5621

Closed
i582 opened this issue Dec 19, 2023 · 0 comments
Closed

Name of data set is missing from TeamCity output #5621

i582 opened this issue Dec 19, 2023 · 0 comments
Labels
feature/teamcity The TeamCity logger type/bug Something is broken version/10 Something affects PHPUnit 10

Comments

@i582
Copy link
Contributor

i582 commented Dec 19, 2023

Q A
PHPUnit version 9.6.15 and 10.4.2
PHP version 8.2.9
Installation Method Composer

Summary

In PHPUnit 10, when run with the --teamcity flag, the ##teamcity[testStarted output in locationHint is missing the with data set #{num} part that was present in PHPUnit 9.

Current behavior

##teamcity[testStarted name='testMethod with data set #0' locationHint='php_qn:///Users/Petr.Makhnev/phpunit_teamcity/SimpleDataProviderTest.php::\SimpleDataProviderTest::testMethod' flowId='36370']

Compared with PHPUnit 9:

##teamcity[testStarted name='testMethod with data set #3185 locationHint='php_qn:///Users/Petr.Makhnev/phpunit_teamcity/SimpleDataProviderTest.php::\SimpleDataProviderTest::testMethod
- with data set #0' 
flowId='36509']

How to reproduce

SimpleDataProviderTest.php

<?php

use PHPUnit\Framework\TestCase;
use PHPUnit\Framework\Attributes\DataProvider;

class SimpleDataProviderTest extends TestCase
{
    #[DataProvider("providePlainData")]
    function testMethod($value, $expected)
    {
        self::assertEquals($expected, $value);
    }

    public static function providePlainData(): array
    {
        return [
            1 => array(0, 2), 2 => array(0, 3), 3 => array(0, 4),
        ];
    }
}

Run:

./vendor/bin/phpunit . --teamcity

Expected behavior

##teamcity[testStarted name='testMethod with data set #3185 locationHint='php_qn:///Users/Petr.Makhnev/phpunit_teamcity/SimpleDataProviderTest.php::\SimpleDataProviderTest::testMethod
+with data set #0' 
flowId='36509']

Impact

This issue prevents PhpStorm from navigating to specific failed datasets in PHPUnit 10.

@i582 i582 added type/bug Something is broken version/10 Something affects PHPUnit 10 version/9 Something affects PHPUnit 9 labels Dec 19, 2023
i582 pushed a commit to i582/phpunit that referenced this issue Dec 19, 2023
i582 pushed a commit to i582/phpunit that referenced this issue Dec 19, 2023
@sebastianbergmann sebastianbergmann added feature/teamcity The TeamCity logger and removed version/9 Something affects PHPUnit 9 labels Dec 19, 2023
@sebastianbergmann sebastianbergmann changed the title Data set is not displayed in PhpUnit 10 in teamcity locationHint meta messages Name of data set is missing from TeamCity output Dec 20, 2023
sebastianbergmann added a commit that referenced this issue Dec 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature/teamcity The TeamCity logger type/bug Something is broken version/10 Something affects PHPUnit 10
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants