[JIRA] (JENKINS-59865) Bogus Scala Compiler warning about missing files after test failure in sbt

38 views
Skip to first unread message

quellkristfalconer@gmail.com (JIRA)

unread,
Oct 21, 2019, 7:45:05 AM10/21/19
to jenkinsc...@googlegroups.com
Patrick Roemer created an issue
 
Jenkins / Bug JENKINS-59865
Bogus Scala Compiler warning about missing files after test failure in sbt
Issue Type: Bug Bug
Assignee: Ulli Hafner
Components: warnings-ng-plugin
Created: 2019-10-21 11:44
Environment: Jenkins v2.190.1
Warnings-NG v6.1.1
Labels: sbt
Priority: Trivial Trivial
Reporter: Patrick Roemer

sbt test run fails in Jenkins build, producing a line such as:

[error] Total time: 127 s, completed Oct 7, 2019 9:11:30 AM

Later, during

post { always

{  recordIssues enabledForFailure: true, tools: [scala()] }

}

the following output occurs in Jenkins log:

[Scala Compiler] [-ERROR-] Can't resolve absolute paths for some files:
[Scala Compiler] [-ERROR-] - Total time: 127 s, completed Oct 7, 2019 9
[Scala Compiler] [-ERROR-] Can't create fingerprints for some files:
[Scala Compiler] [-ERROR-] - 'Total time: 127 s, completed Oct 7, 2019 9', IO exception has been thrown: java.nio.file.NoSuchFileException: Total time: 127 s, completed Oct 7, 2019 9

Looks like a false positive from [Sbt]ScalacParser regex capture at first glance:

https://github.com/jenkinsci/analysis-model/blob/ddc3068166835508c4a5b1a8d30cec7d92109bfc/src/main/java/edu/hm/hafner/analysis/parser/SbtScalacParser.java#L19

https://github.com/jenkinsci/analysis-model/blob/ddc3068166835508c4a5b1a8d30cec7d92109bfc/src/main/java/edu/hm/hafner/analysis/parser/ScalacParser.java#L20

Not a big deal at all, but can be confusing (in particular since scalac ran green).

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

ullrich.hafner@gmail.com (JIRA)

unread,
Oct 23, 2019, 5:34:03 AM10/23/19
to jenkinsc...@googlegroups.com
Ulli Hafner updated an issue
Change By: Ulli Hafner
Component/s: analysis-model
Component/s: warnings-ng-plugin
Labels: sbt help-wanted newbie-friendly

ullrich.hafner@gmail.com (JIRA)

unread,
Oct 23, 2019, 5:35:03 AM10/23/19
to jenkinsc...@googlegroups.com
Ulli Hafner updated an issue
sbt test run fails in Jenkins build, producing a line such as:

{noformat}
[error] Total time: 127 s, completed Oct 7, 2019 9:11:30 AM
{noformat}
Later, during

{noformat}
post { always {  recordIssues enabledForFailure: true, tools: [scala()] } }
{noformat}
the following output occurs in Jenkins log:

{noformat}
[Scala Compiler] [-ERROR-] Can't resolve absolute paths for some files:
[Scala Compiler] [-ERROR-] - Total time: 127 s, completed Oct 7, 2019 9
[Scala Compiler] [-ERROR-] Can't create fingerprints for some files:
[Scala Compiler] [-ERROR-] - 'Total time: 127 s, completed Oct 7, 2019 9', IO exception has been thrown: java.nio.file.NoSuchFileException: Total time: 127 s, completed Oct 7, 2019 9
{noformat}

ullrich.hafner@gmail.com (JIRA)

unread,
Oct 23, 2019, 5:35:05 AM10/23/19
to jenkinsc...@googlegroups.com

ullrich.hafner@gmail.com (JIRA)

unread,
Oct 23, 2019, 5:36:02 AM10/23/19
to jenkinsc...@googlegroups.com

benjamin.c.cross@gmail.com (JIRA)

unread,
Dec 15, 2019, 11:28:03 AM12/15/19
to jenkinsc...@googlegroups.com
Benjamin Cross commented on Bug JENKINS-59865
 
Re: Bogus Scala Compiler warning about missing files after test failure in sbt

Are you saying that the sbt should not be throwing an error as scalac ran green or are you saying that scalac parser is not recognizing the error?

jarredparrett@gmail.com (JIRA)

unread,
Dec 15, 2019, 12:40:04 PM12/15/19
to jenkinsc...@googlegroups.com

jarredparrett@gmail.com (JIRA)

unread,
Dec 15, 2019, 12:41:02 PM12/15/19
to jenkinsc...@googlegroups.com

jarredparrett@gmail.com (JIRA)

unread,
Dec 15, 2019, 12:41:03 PM12/15/19
to jenkinsc...@googlegroups.com

benjamin.c.cross@gmail.com (JIRA)

unread,
Dec 15, 2019, 12:42:03 PM12/15/19
to jenkinsc...@googlegroups.com

ullrich.hafner@gmail.com (JIRA)

unread,
Dec 15, 2019, 1:55:04 PM12/15/19
to jenkinsc...@googlegroups.com
Ulli Hafner commented on Bug JENKINS-59865
 
Re: Bogus Scala Compiler warning about missing files after test failure in sbt

I think the issue is about the Scala parser: it should ignore the error message with the summary line and the runtimes.

ullrich.hafner@gmail.com (JIRA)

unread,
Dec 15, 2019, 1:55:04 PM12/15/19
to jenkinsc...@googlegroups.com
Ulli Hafner updated an issue
Change By: Ulli Hafner
sbt wsbt test run fails in Jenkins build, producing a line such as:


{noformat}
[error] Total time: 127 s, completed Oct 7, 2019 9:11:30 AM
{noformat}
Later, during

{noformat}
post { always {  recordIssues enabledForFailure: true, tools: [scala()] } }
{noformat}
the following output occurs in Jenkins log:

{noformat}
[Scala Compiler] [-ERROR-] Can't resolve absolute paths for some files:
[Scala Compiler] [-ERROR-] - Total time: 127 s, completed Oct 7, 2019 9
[Scala Compiler] [-ERROR-] Can't create fingerprints for some files:
[Scala Compiler] [-ERROR-] - 'Total time: 127 s, completed Oct 7, 2019 9', IO exception has been thrown: java.nio.file.NoSuchFileException: Total time: 127 s, completed Oct 7, 2019 9
{noformat}

Looks like a false positive from [Sbt]ScalacParser regex capture at first glance:

[https://github.com/jenkinsci/analysis-model/blob/ddc3068166835508c4a5b1a8d30cec7d92109bfc/src/main/java/edu/hm/hafner/analysis/parser/SbtScalacParser.java#L19]

[https://github.com/jenkinsci/analysis-model/blob/ddc3068166835508c4a5b1a8d30cec7d92109bfc/src/main/java/edu/hm/hafner/analysis/parser/ScalacParser.java#L20]

Not a big deal at all, but can be confusing (in particular since scalac ran green).

benjamin.c.cross@gmail.com (JIRA)

unread,
Dec 17, 2019, 9:05:02 PM12/17/19
to jenkinsc...@googlegroups.com

jarredparrett@gmail.com (JIRA)

unread,
Dec 19, 2019, 10:12:02 PM12/19/19
to jenkinsc...@googlegroups.com

jarredparrett@gmail.com (JIRA)

unread,
Dec 20, 2019, 12:26:05 PM12/20/19
to jenkinsc...@googlegroups.com

jarredparrett@gmail.com (JIRA)

unread,
Dec 20, 2019, 12:26:06 PM12/20/19
to jenkinsc...@googlegroups.com
Jarred Parrett commented on Bug JENKINS-59865
 
Re: Bogus Scala Compiler warning about missing files after test failure in sbt

Hi Ulli, I am a classmate of Benjamin Cross and we are working on the bug together. I have been working through it and have a good idea about what is going on but was wondering if I could ask a few questions about recreating the bug before attempting to resolve it. Presently, I understand that the ScalacParser is a class of the analysis-model which is a jar that is employed by the plugin Jenkins-Next-Generation-Warning. In trying to recreate it, the thought we had was to create a Scala project which, when running along with the pipeline including 'post { always

{ recordIssues enabledForFailure: true, tools: [scala()] }

}' and having the above plugin enabled to record the issues, it would produce the issue as explained above. From there, we would validate the results before making proper changes to regEx to exclude the false positive line. I had to present this work approach, so I put together a brief diagram - below.

Questions I have:

  • does this understanding sound right?
  • in creating the sample scala project to recreate this, I think we should compile with the scalac as this parser deals with it , is that right?
  • is this approach overkill / could this be handled through just dealing with analysis-model and testing within there or is it worth going through the entire process to fully test and better understand architecture?
  • Are there any other resources that I should look to?

My apologies if these questions are all very introductory, we are still getting a handle of understanding the project 

 

thanks and happy holidays

-Jarred Parrett

 

jarredparrett@gmail.com (JIRA)

unread,
Dec 20, 2019, 12:49:03 PM12/20/19
to jenkinsc...@googlegroups.com
Jarred Parrett edited a comment on Bug JENKINS-59865
Hi Ulli [~drulli] , I am a classmate of Benjamin Cross and we are working on the bug together. I have been working through it and have a good idea about what is going on but was wondering if I could ask a few questions about recreating the bug before attempting to resolve it. Presently, I understand that the ScalacParser is a class of the analysis-model which is a jar that is employed by the plugin Jenkins-Next-Generation-Warning. In trying to recreate it, the thought we had was to create a Scala project which, when running along with the pipeline including 'post \ { always

{ recordIssues enabledForFailure: true, tools: [scala()] }

}' and having the above plugin enabled to record the issues, it would produce the issue as explained above. From there, we would validate the results before making proper changes to regEx to exclude the false positive line. I had to present this work approach, so I put together a brief diagram - below.

Questions I have:
* does this understanding sound right?
* in creating the sample scala project to recreate this, I think we should compile with the scalac as this parser deals with it , is that right?
* is this approach overkill / could this be handled through just dealing with analysis-model and testing within there or is it worth going through the entire process to fully test and better understand architecture?
* Are there any other resources that I should look to?


My apologies if these questions are all very introductory, we are still getting a handle of understanding the project 

 

thanks and happy holidays

-Jarred Parrett

 

!Bug_1_Diagram.jpg!

jarredparrett@gmail.com (JIRA)

unread,
Dec 26, 2019, 10:31:03 AM12/26/19
to jenkinsc...@googlegroups.com
Jarred Parrett edited a comment on Bug JENKINS-59865
Hi [~drulli], I am a classmate of Benjamin Cross and we are working on the bug together. I have been working through it and have a good idea about what is going on but was wondering if I could ask a few questions about recreating the bug before attempting to resolve it. Presently, I understand that the - ScalacParser - sbt parser  is a class of the analysis-model which is a jar that is employed by the plugin Jenkins-Next-Generation-Warning. In trying to recreate it, the thought we had was to create a Scala project which, when running along with the pipeline including 'post { always


{ recordIssues enabledForFailure: true, tools: [scala()] }

}' and having the above plugin enabled to record the issues, it would produce the issue as explained above. From there, we would validate the results before making proper changes to regEx to exclude the false positive line. I had to present this work approach, so I put together a brief diagram - below.

Questions I have:
* does this understanding sound right?
* - in creating the sample scala project to recreate this, I think we should compile with the scalac as this parser deals with it , is that right?
* is this approach overkill / could this be handled through just dealing with analysis
- model and testing within there or Upon more investigation, this is it worth going through the entire process to fully test and better understand architecture? with sbt, not scalac so that was wrong
* Are there any other resources that I should look to?

My apologies if these questions are all very introductory, we are still getting a handle of understanding the project 

 

thanks and happy holidays

-Jarred Parrett

 

!Bug_1_Diagram.jpg!

ullrich.hafner@gmail.com (JIRA)

unread,
Dec 26, 2019, 4:45:03 PM12/26/19
to jenkinsc...@googlegroups.com

I think it is much simpler to reproduce and fix this bug. You only need to change and test the analysis model module. Create a text file that contains the message from above (with the error) and read it in the test class SbcParserTest with the parser SbcParser. It should produce a warning. Then fix the bug so that no warning will be shown anymore.

There is no need to use the warnings-ng plugin for the test, as the bug is only part of the library analysis-model.

ullrich.hafner@gmail.com (JIRA)

unread,
Dec 26, 2019, 4:46:03 PM12/26/19
to jenkinsc...@googlegroups.com
Ulli Hafner edited a comment on Bug JENKINS-59865
I think it is much simpler to reproduce and fix this bug. You only need to change and test the analysis model module. Create a text file that contains the message from above (with the error) and read it in the test class {{SbcParserTest}} with the parser {{ SbcParser }} . It should produce a warning. Then fix the bug so that no warning will be shown anymore.


There is no need to use the warnings-ng plugin for the test, as the bug is only part of the library analysis-model.

jarredparrett@gmail.com (JIRA)

unread,
Dec 27, 2019, 10:58:04 AM12/27/19
to jenkinsc...@googlegroups.com

Thank you for the direction - it made it much easier to recreate. In working on it, I think its test class was SbtScalacParserTest.java; I ran that with a custom text file that contained the content from sbtScalac.txt with the addition of the above line. The test then fails as it expects 4 errors in the report but gets 5. To resolve this, I changed the SbtScalacParser.java to include the negative lookahead statement - "^(\\[warn\\]|\\[error\\](?!\\s+Total
stime
)
s*(.?)\\d+)(?::\\d+)?:
s
(.*)$"

 Thank you for your help

jarredparrett@gmail.com (JIRA)

unread,
Dec 27, 2019, 10:59:02 AM12/27/19
to jenkinsc...@googlegroups.com
Jarred Parrett edited a comment on Bug JENKINS-59865
Thank you for the direction - it made it much easier to recreate. In working on it, I think its test class was SbtScalacParserTest.java; I ran that with a custom text file that contained the content from sbtScalac.txt with the addition of the above line. The test then fails as it expects 4 errors in the report but gets 5. To resolve this, I changed the SbtScalacParser.java to include the negative lookahead statement - <tt> "^(\\[warn\\]|\\[error\\] +(?!\\s+Total\\stime: ) +) \\s*(.*?):(\\d+)(?::\\d+)?:\\s*(.*)$" ;<tt>


 Thank you for your help

jarredparrett@gmail.com (JIRA)

unread,
Dec 27, 2019, 11:00:02 AM12/27/19
to jenkinsc...@googlegroups.com
Jarred Parrett edited a comment on Bug JENKINS-59865
Thank you for the direction - it made it much easier to recreate. In working on it, I think its test class was SbtScalacParserTest.java; I ran that with a custom text file that contained the content from sbtScalac.txt with the addition of the above line. The test then fails as it expects 4 errors in the report but gets 5. To resolve this, I changed the SbtScalacParser.java to include the negative lookahead statement - <tt> {{ "^(\\[warn\\]|\\[error\\])\\s*(.*?):(\\d+)(?::\\d+)?:\\s*(.*)$"; <tt> }}


 Thank you for your help

jarredparrett@gmail.com (JIRA)

unread,
Dec 27, 2019, 11:01:03 AM12/27/19
to jenkinsc...@googlegroups.com
Jarred Parrett edited a comment on Bug JENKINS-59865
Thank you for the direction - it made it much easier to recreate. In working on it, I think its test class was SbtScalacParserTest.java; I ran that with a custom text file that contained the content from sbtScalac.txt with the addition of the above line. The test then fails as it expects 4 errors in the report but gets 5. To resolve this, I changed the SbtScalacParser.java to include the negative lookahead statement -
{ { code:java}
"^(\\[warn\\]|\\[error\\] (?!\\s+Total\\stime: ) ) \\s*(.*?):(\\d+)(?::\\d+)?:\\s*(.*)$" ;
{code
} }


 Thank you for your help

ullrich.hafner@gmail.com (JIRA)

unread,
Jan 7, 2020, 5:46:04 AM1/7/20
to jenkinsc...@googlegroups.com
Ulli Hafner started work on Bug JENKINS-59865
 
Change By: Ulli Hafner
Status: Open In Progress

ullrich.hafner@gmail.com (JIRA)

unread,
Jan 7, 2020, 5:48:03 AM1/7/20
to jenkinsc...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages