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

Cleaning / Checks errors during Sonar analyse phase #16

Open
dedece35 opened this issue Jan 6, 2023 · 1 comment
Open

Cleaning / Checks errors during Sonar analyse phase #16

dedece35 opened this issue Jan 6, 2023 · 1 comment
Assignees
Labels
android Something tied to the android OS codenarc 💉 bug Something isn't working

Comments

@dedece35
Copy link
Member

dedece35 commented Jan 6, 2023

Describe the bug
During "build" workflow (on push on "main" branch), some exceptions and errors occurs during last Sonar phase (which launch test pahse)
Check if there are wanted or not and make corrections if not wanted.

To Reproduce
Launch mvn test command on root directory of plugin

Expected behavior
Maybe some errors avoided

Screenshots

  • error type 1 :
10:16:18.936 [main] WARN  o.s.p.groovy.jacoco.JaCoCoExtensions - Exception during analysis of file /home/runner/work/ecoCode-mobile/ecoCode-mobile/android-plugin/DummyFile.dummy
java.io.FileNotFoundException: DummyFile.dummy (No such file or directory)
	at java.base/java.io.FileInputStream.open0(Native Method) ~[na:na]
	at java.base/java.io.FileInputStream.open(FileInputStream.java:219) ~[na:na]
  • error type 2 :
[INFO] Running org.sonar.plugins.groovy.cobertura.CoberturaSensorTest
11:35:44.619 [main] INFO  o.s.p.g.cobertura.CoberturaSensor - Analyzing Cobertura report: Optional[/Users/ddecarvalho/git_perso/ecoCode-mobile/android-plugin/target/test-classes/org/sonar/plugins/groovy/cobertura/coverage.xml]
11:35:44.631 [main] INFO  o.s.p.g.c.CoberturaReportParser - Hit on invalid line for file com/test/web/EmptyResultException.java (line: 16/-1)
11:35:44.631 [main] INFO  o.s.p.g.c.CoberturaReportParser - Hit on invalid line for file com/test/web/EmptyResultException.java (line: 17/-1)
11:35:44.631 [main] WARN  o.s.p.g.c.CoberturaReportParser - File not found: com/test/web/EmptyResultException.java
11:35:44.643 [main] WARN  o.s.p.g.c.CoberturaReportParser - File not found: LoggingFilters.groovy
11:35:44.644 [main] WARN  o.s.p.g.c.CoberturaReportParser - File not found: SiteMapFilters.groovy
  • error type 3 :
[INFO] Running org.sonar.plugins.groovy.foundation.GroovyHighlighterAndTokenizerTest
11:35:44.982 [main] ERROR o.s.p.g.f.GroovyHighlighterAndTokenizer - Unexpected token when lexing file: Error.groovy
groovyjarjarantlr.TokenStreamRecognitionException: unexpected char: '#'
        at org.codehaus.groovy.antlr.parser.GroovyLexer.nextToken(GroovyLexer.java:728) ~[groovy-2.4.17.jar:2.4.17]
        at org.codehaus.groovy.antlr.parser.GroovyLexer$1.nextToken(GroovyLexer.java:262) ~[groovy-2.4.17.jar:2.4.17]
  • error type 4 :
11:35:45.008 [main] ERROR o.s.p.g.f.GroovyHighlighterAndTokenizer - Unable to read file: Greet-fake.groovy
java.io.FileNotFoundException: /Users/ddecarvalho/git_perso/ecoCode-mobile/android-plugin/Greet-fake.groovy (No such file or directory)
        at java.base/java.io.FileInputStream.open0(Native Method) ~[na:na]
        at java.base/java.io.FileInputStream.open(FileInputStream.java:219) ~[na:na]

  • error type 5 :
11:35:45.050 [main] WARN  o.s.p.groovy.jacoco.JaCoCoExtensions - Exception during analysis of file /Users/ddecarvalho/git_perso/ecoCode-mobile/android-plugin/DummyFile.dummy
java.io.FileNotFoundException: DummyFile.dummy (No such file or directory)
        at java.base/java.io.FileInputStream.open0(Native Method) ~[na:na]
        at java.base/java.io.FileInputStream.open(FileInputStream.java:219) ~[na:na]
  • error type 6 :
[INFO] Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.992 s - in org.sonar.plugins.groovy.GroovySensorTest
[INFO] Running org.sonar.plugins.groovy.codenarc.CodeNarcSensorTest
11:35:46.128 [main] WARN  o.s.p.groovy.codenarc.CodeNarcSensor - No such rule in SonarQube, so violation from CodeNarc will be ignored: EmptyElseBlock
11:35:46.129 [main] WARN  o.s.p.groovy.codenarc.CodeNarcSensor - No such rule in SonarQube, so violation from CodeNarc will be ignored: EmptyIfStatement
11:35:46.129 [main] WARN  o.s.p.groovy.codenarc.CodeNarcSensor - No such rule in SonarQube, so violation from CodeNarc will be ignored: StringInstantiation
11:35:46.129 [main] WARN  o.s.p.groovy.codenarc.CodeNarcSensor - No such rule in SonarQube, so violation from CodeNarc will be ignored: DuplicateImport
11:35:46.129 [main] WAR
@dedece35 dedece35 added 💉 bug Something isn't working 🔰 good first issue Good for newcomers android Something tied to the android OS labels Jan 6, 2023
@jhertout
Copy link
Contributor

I think that with errors are related to Codenarc functions we do not use. I have planned to work on Codenarc to simplify it for our use cases and to simplify the build process. I will see these problems at that moment.

@dedece35 dedece35 removed the 🔰 good first issue Good for newcomers label Jan 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
android Something tied to the android OS codenarc 💉 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants