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

Print complete test result (outcome and issues) when --teamcity is used #5285

Closed
CxDevLead opened this issue Mar 16, 2023 · 6 comments
Closed
Assignees
Labels
feature/teamcity The TeamCity logger version/10 Something affects PHPUnit 10

Comments

@CxDevLead
Copy link

CxDevLead commented Mar 16, 2023

Q A
PHPUnit version 10.0.16
PHP version 8.2
Installation Method Composer

Summary

Output with displayDetailsOnTestsThatTriggerDeprecations="true" only includes the Deprecation in the tests summary, but does not list the file location.

Current behavior

Deprecations mentioned in summary when run in PHPStorm. The same issue is also happening with testdox enabled.

OK, but some tests have issues!
Tests: 627, Assertions: 1355, Deprecations: 1.

How to reproduce

This is my configuration:

<?xml version="1.0" encoding="UTF-8"?>
<phpunit
        bootstrap="PHPUnitBootstrap.php"
        backupGlobals="false"
        colors="true"
        cacheDirectory=".phpunit.cache"
        displayDetailsOnTestsThatTriggerDeprecations="true"
        displayDetailsOnTestsThatTriggerErrors="true"
        displayDetailsOnTestsThatTriggerNotices="true"
        displayDetailsOnTestsThatTriggerWarnings="true"
>

Expected behavior

The expected behaviour is a list of the deprecations and which files they reside in, so they can be fixed!

@CxDevLead CxDevLead added type/bug Something is broken version/10 Something affects PHPUnit 10 labels Mar 16, 2023
@sebastianbergmann sebastianbergmann added feature/teamcity The TeamCity logger and removed type/bug Something is broken labels Mar 17, 2023
@sebastianbergmann
Copy link
Owner

This is not a bug, it works as it is currently intended to work.

The idea here is that --teamcity replaces the default output of PHPUnit's test runner with output in TeamCity format that can be parsed by PhpStorm.

Due to limitations of PHPUnit 9's architecture, the TeamCity messages were printed in addition to the default output. In PHPUnit 10 we "fixed" that.

In #5276, we already brought back the display of test result summary and warnings. We can, of course, also bring back other details. But I do not want to make that decision, that decision should be made by JetBrains. Because nobody is helped if the output that PHPUnit generates when --teamcity is used cannot be processed by PhpStorm.

Here is what I propose: --teamcity should only replace the default progress printer with our TeamCity progress printer. Test results should be printed using the default result printer. I will gladly implement this if JetBrains confirms that this won't break PhpStorm's parsing of PHPUnit's TeamCity output.

@CxDevLead
Copy link
Author

CxDevLead commented Mar 17, 2023

Thanks Sebastian, that explanation makes sense.

I have opened a ticket with JetBrains so they can review your proposed fix: https://youtrack.jetbrains.com/issue/WI-71858/PHPUnit10-doesnt-list-deprecations-even-when-displayDetailsOnTestsThatTriggerDeprecations-is-set-to-true

@isfedorov
Copy link
Contributor

Hi @sebastianbergmann! PhpStorm is here. Let's bring back deprecations as well as it was done for other details in scope of #5276 . We will check and ensure that PhpStorm processes such output properly as well

@sebastianbergmann sebastianbergmann changed the title PHPUnit 10.0.16 doesn't list the deprecations, even when displayDetailsOnTestsThatTriggerDeprecations is set to true Print complete test result (outcome and issues) when --testdox is used Mar 20, 2023
@sebastianbergmann sebastianbergmann self-assigned this Mar 20, 2023
@sebastianbergmann sebastianbergmann changed the title Print complete test result (outcome and issues) when --testdox is used Print complete test result (outcome and issues) when --teamcity is used Mar 20, 2023
@sebastianbergmann
Copy link
Owner

@isfedorov Can you please have a look at the output of --teamcity after 113efc9? Thanks!

@isfedorov
Copy link
Contributor

At the first glance looks ok with phpunit dev branch
Screenshot 2023-03-20 at 15 02 43

@sebastianbergmann
Copy link
Owner

@isfedorov Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature/teamcity The TeamCity logger version/10 Something affects PHPUnit 10
Projects
None yet
Development

No branches or pull requests

3 participants