You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by surli <gi...@git.apache.org> on 2017/02/08 17:47:03 UTC

[GitHub] maven-surefire pull request #143: maven-surefire-parser: add new method isEr...

GitHub user surli opened a pull request:

    https://github.com/apache/maven-surefire/pull/143

    maven-surefire-parser: add new method isError in ReportTestCase 

    There is currently no way after parsing test cases to know if the test case is a failure or an error. I added a boolean `isError` in ReportTestCase and associated getter and setter and I set it up in the TestSuiteXmlParser. 
    
    I need this feature for an automation repair project: if there is another way with existing tooling, just tell me about it!


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/surli/maven-surefire surefire-parser-feature-error-status

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/maven-surefire/pull/143.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #143
    
----
commit 2b97d46d5a5adf660a0231a7128cbae3839845b8
Author: Simon Urli <si...@inria.fr>
Date:   2017-02-08T16:57:30Z

    Change ReportTestCase to add a new isError method to detect if it's a failure or an error. Change parser and tests accordingly.

commit 36f724a0371e6cf9a565dfcef0b9d3953ddd56f1
Author: Simon Urli <si...@inria.fr>
Date:   2017-02-08T17:43:58Z

    Fix checkstyle issue.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


[GitHub] maven-surefire issue #143: maven-surefire-parser: add new method isError in ...

Posted by Tibor17 <gi...@git.apache.org>.
Github user Tibor17 commented on the issue:

    https://github.com/apache/maven-surefire/pull/143
  
    @surli 
    You have not answered my questions yet. Let's do it now about making releases. Register in Jira and open issue in https://issues.apache.org/jira/browse/SUREFIRE. The message of the commit should be renamed to something like:
    `[SUREFIRE-12345] Same issue title as in GitHub`.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


[GitHub] maven-surefire issue #143: [SUREFIRE-1416] maven-surefire-parser: add new me...

Posted by Tibor17 <gi...@git.apache.org>.
Github user Tibor17 commented on the issue:

    https://github.com/apache/maven-surefire/pull/143
  
    @surli 
    Thx for contributing. Now you can close the PR.


---

[GitHub] maven-surefire issue #143: [SUREFIRE-1416] maven-surefire-parser: add new me...

Posted by Tibor17 <gi...@git.apache.org>.
Github user Tibor17 commented on the issue:

    https://github.com/apache/maven-surefire/pull/143
  
    @surli 
    If there are no objections, I would push the branch SUREFIRE-1416 to master.
    Thx.


---

[GitHub] maven-surefire issue #143: [SUREFIRE-1416] maven-surefire-parser: add new me...

Posted by surli <gi...@git.apache.org>.
Github user surli commented on the issue:

    https://github.com/apache/maven-surefire/pull/143
  
    Hi @Tibor17 
    
    sorry I was off lately so I just saw your comments. I did not check what you asked before. I'm currently reviewing your code and it looks fine for me :) 
    Thanks!


---

[GitHub] maven-surefire issue #143: [SUREFIRE-1416] maven-surefire-parser: add new me...

Posted by Tibor17 <gi...@git.apache.org>.
Github user Tibor17 commented on the issue:

    https://github.com/apache/maven-surefire/pull/143
  
    @surli 
    I had to change you code in new branch
    https://git1-us-west.apache.org/repos/asf?p=maven-surefire.git;a=shortlog;h=refs/heads/SUREFIRE-1416
    Can you build the version `2.21.0-SNAPSHOT` using `mvn install -DskipTests` and let me know if the report site works for you? I want to include this fix in release in several days.


---

[GitHub] maven-surefire issue #143: maven-surefire-parser: add new method isError in ...

Posted by surli <gi...@git.apache.org>.
Github user surli commented on the issue:

    https://github.com/apache/maven-surefire/pull/143
  
    Hi @Tibor17 sorry I missed your previous review, I'll make changes in the coming days and open the issue on JIRA


---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


[GitHub] maven-surefire issue #143: [SUREFIRE-1416] maven-surefire-parser: add new me...

Posted by Tibor17 <gi...@git.apache.org>.
Github user Tibor17 commented on the issue:

    https://github.com/apache/maven-surefire/pull/143
  
    @surli 
    Pls try to use it in your projects. I want to know if it is useful for you and working. Thx.


---

[GitHub] maven-surefire pull request #143: [SUREFIRE-1416] maven-surefire-parser: add...

Posted by surli <gi...@git.apache.org>.
Github user surli closed the pull request at:

    https://github.com/apache/maven-surefire/pull/143


---

[GitHub] maven-surefire pull request #143: maven-surefire-parser: add new method isEr...

Posted by Tibor17 <gi...@git.apache.org>.
Github user Tibor17 commented on a diff in the pull request:

    https://github.com/apache/maven-surefire/pull/143#discussion_r108780826
  
    --- Diff: surefire-report-parser/src/main/java/org/apache/maven/plugins/surefire/report/TestSuiteXmlParser.java ---
    @@ -196,7 +196,8 @@ else if ( "failure".equals( qName ) )
                     }
                     else if ( "error".equals( qName ) )
                     {
    -                    testCase.setFailure( attributes.getValue( "message" ), attributes.getValue( "type" ) );
    +                    testCase.setFailure( attributes.getValue( "message" ), attributes.getValue( "type" ) )
    --- End diff --
    
    If having an error, then failure and error are set both. Why?
    See Line 235. Maybe you should introduce `setErrorDetail` similar to what is `setFailureDetail`, and show the detail in HTML report and thus distinguish between these two.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


[GitHub] maven-surefire pull request #143: maven-surefire-parser: add new method isEr...

Posted by surli <gi...@git.apache.org>.
Github user surli commented on a diff in the pull request:

    https://github.com/apache/maven-surefire/pull/143#discussion_r138015510
  
    --- Diff: surefire-report-parser/src/main/java/org/apache/maven/plugins/surefire/report/ReportTestCase.java ---
    @@ -156,6 +158,15 @@ public boolean hasFailure()
             return hasFailure;
         }
     
    +    public boolean isError() {
    --- End diff --
    
    > You are not calling the getter in SurefireReportGenerator
    
    I just committed something in that direction but not sure about the modification of the ID in the generated report... 


---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


[GitHub] maven-surefire pull request #143: maven-surefire-parser: add new method isEr...

Posted by surli <gi...@git.apache.org>.
Github user surli commented on a diff in the pull request:

    https://github.com/apache/maven-surefire/pull/143#discussion_r138012247
  
    --- Diff: surefire-report-parser/src/main/java/org/apache/maven/plugins/surefire/report/TestSuiteXmlParser.java ---
    @@ -196,7 +196,8 @@ else if ( "failure".equals( qName ) )
                     }
                     else if ( "error".equals( qName ) )
                     {
    -                    testCase.setFailure( attributes.getValue( "message" ), attributes.getValue( "type" ) );
    +                    testCase.setFailure( attributes.getValue( "message" ), attributes.getValue( "type" ) )
    --- End diff --
    
    > If having an error, then failure and error are set both. Why?
    
    An error is a specific kind of failure: if I start to introduce error details, then I should also add error type, message, line, and I'll got every field of `ReportTestCase` duplicated. My purpose was to keep the field of `ReportTestCase` to report the information around the failure, but to be able to flag it as an error instead of a failure. 


---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


[GitHub] maven-surefire issue #143: [SUREFIRE-1416] maven-surefire-parser: add new me...

Posted by surli <gi...@git.apache.org>.
Github user surli commented on the issue:

    https://github.com/apache/maven-surefire/pull/143
  
    @Tibor17 I can confirm it's working for me and it's useful! See my PR https://github.com/Spirals-Team/librepair/pull/380


---

[GitHub] maven-surefire pull request #143: maven-surefire-parser: add new method isEr...

Posted by Tibor17 <gi...@git.apache.org>.
Github user Tibor17 commented on a diff in the pull request:

    https://github.com/apache/maven-surefire/pull/143#discussion_r108779823
  
    --- Diff: surefire-report-parser/src/main/java/org/apache/maven/plugins/surefire/report/ReportTestCase.java ---
    @@ -156,6 +158,15 @@ public boolean hasFailure()
             return hasFailure;
         }
     
    +    public boolean isError() {
    --- End diff --
    
    You are not calling the getter in `SurefireReportGenerator`.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org