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

Throws STDOUT warning on AppVeyor and WIndows 10 64 #110

Closed
replaysMike opened this issue Dec 6, 2018 · 13 comments
Closed

Throws STDOUT warning on AppVeyor and WIndows 10 64 #110

replaysMike opened this issue Dec 6, 2018 · 13 comments
Assignees
Labels

Comments

@replaysMike
Copy link

replaysMike commented Dec 6, 2018

Scala Version (2.10.x / etc)

Operating System (Ubuntu 15.10 / MacOS 10.10 / Windows 10)

Windows 10 x64

JDK (Oracle 1.8.0_72, OpenJDK 1.8.x, Azul Zing)

java version "1.8.0_191"
Java(TM) SE Runtime Environment (build 1.8.0_191-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.191-b12, mixed mode)

Library Dependencies

If this is an issue that involves integration with another system, include the exact version and OS of the other system, including any intermediate drivers or APIs i.e. if you connect to a PostgreSQL database, include both the version / OS of PostgreSQL and the JDBC driver version used to connect to the database.

Expected Behavior

  1. Generating a report should not throw warnings or errors
  2. java -jar codacy-coverage-reporter-4.0.5-assembly.jar final --project-token "TOKEN" --commit-uuid "COMMITID"

Actual Behavior

Exception thrown when generating report:

java -jar codacy-coverage-reporter-4.0.5-assembly.jar final --project-token "TOKEN" --commit-uuid "COMMITID"

...
22:35:38,345 |-INFO in ch.qos.logback.core.ConsoleAppender[STDOUT] - Enabling JANSI WindowsAnsiOutputStream for the console.
22:35:38,345 |-WARN in ch.qos.logback.core.ConsoleAppender[STDOUT] - Failed to create WindowsAnsiOutputStream. Falling back on the default stream. ch.qos.logback.core.util.DynamicClassLoadingException: Failed to instantiate type org.fusesource.jansi.WindowsAnsiOutputStream
	at ch.qos.logback.core.util.DynamicClassLoadingException: Failed to instantiate type org.fusesource.jansi.WindowsAnsiOutputStream
	at 	at ch.qos.logback.core.util.OptionHelper.instantiateByClassNameAndParameter(OptionHelper.java:69)
	at 	at ch.qos.logback.core.util.OptionHelper.instantiateByClassNameAndParameter(OptionHelper.java:40)
	at 	at ch.qos.logback.core.ConsoleAppender.getTargetStreamForWindows(ConsoleAppender.java:88)
	at 	at ch.qos.logback.core.ConsoleAppender.start(ConsoleAppender.java:79)
	at 	at ch.qos.logback.core.joran.action.AppenderAction.end(AppenderAction.java:90)
	at 	at ch.qos.logback.core.joran.spi.Interpreter.callEndAction(Interpreter.java:309)
	at 	at ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:193)
	at 	at ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:179)
	at 	at ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:62)
	at 	at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:165)
	at 	at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:152)
	at 	at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:110)
	at 	at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:53)
	at 	at ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:75)
	at 	at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:150)
	at 	at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:84)
	at 	at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:55)
	at 	at org.slf4j.LoggerFactory.bind(LoggerFactory.java:150)
	at 	at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:124)
	at 	at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:412)
	at 	at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:357)
	at 	at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:383)
	at 	at org.log4s.package$.getLogger(package.scala:8)
	at 	at com.codacy.helpers.LoggerHelper$.getLogger(LoggerHelper.scala:18)
	at 	at com.codacy.helpers.LoggerHelper$.logger(LoggerHelper.scala:11)
	at 	at com.codacy.rules.ConfigurationRules.<init>(ConfigurationRules.scala:16)
	at 	at com.codacy.di.Components.configRules$lzycompute(Components.scala:14)
	at 	at com.codacy.di.Components.configRules(Components.scala:14)
	at 	at com.codacy.di.Components.validatedConfig$lzycompute(Components.scala:12)
	at 	at com.codacy.di.Components.validatedConfig(Components.scala:12)
	at 	at com.codacy.CodacyCoverageReporter$.run(CodacyCoverageReporter.scala:13)
	at 	at com.codacy.configuration.parser.ConfigurationParsingApp.run(ConfigurationParser.scala:13)
	at 	at com.codacy.configuration.parser.ConfigurationParsingApp.run(ConfigurationParser.scala:11)
	at 	at caseapp.CommandAppWithPreCommand$$anonfun$main$1.apply(CommandAppWithPreCommand.scala:97)
	at 	at caseapp.CommandAppWithPreCommand$$anonfun$main$1.apply(CommandAppWithPreCommand.scala:82)
	at 	at scala.Option.foreach(Option.scala:257)
	at 	at caseapp.CommandAppWithPreCommand.main(CommandAppWithPreCommand.scala:82)
	at 	at com.codacy.CodacyCoverageReporter.main(CodacyCoverageReporter.scala)
Caused by: java.lang.ClassNotFoundException: org.fusesource.jansi.WindowsAnsiOutputStream
	at 	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at 	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at 	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:338)
	at 	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at 	at ch.qos.logback.core.util.OptionHelper.instantiateByClassNameAndParameter(OptionHelper.java:56)
	at 	... 37 common frames omitted
22:35:38,346 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to INFO

Reproducible Test Case

On Windows 10 x64:
java -jar codacy-coverage-reporter-4.0.5-assembly.jar final --project-token "TOKEN" --commit-uuid "COMMITID"

@rtfpessoa
Copy link
Contributor

@replaysMike sorry for the delay getting back to you. This should not affect the coverage posting. Can you confirm this is just a error message?

@ljmf00
Copy link
Contributor

ljmf00 commented Oct 11, 2019

Due to no answering since some time ago, I'm closing this issue.

@guibranco
Copy link

guibranco commented Mar 28, 2020

The error keeping throwing in AppVeyor with Windows.
My example is with VS 2019 image.
C# language (.Net Standard for library, .Net Core for tests).

Yes, it is just an error message that can be interpreted by some filters as error in build process.
Currently, for my projects, no problem...

Some example (error starts at line 318):
AppVeyor build history

Here's a snippet:

java -jar ./codacy-test-reporter.jar report -l CSharp -t %CODACY_PROJECT_TOKEN% -r "%CD%\Tests\%SOLUTION_NAME%.Tests\coverage.cobertura.xml"

05:17:29,982 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback-test.xml] at [jar:file:/C:/projects/viacep/codacy-test-reporter.jar!/logback-test.xml]
05:17:29,998 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList@50a638b5 - URL [jar:file:/C:/projects/viacep/codacy-test-reporter.jar!/logback-test.xml] is not of type file
05:17:30,159 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set
05:17:30,159 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
05:17:30,159 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUT]
05:17:30,188 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
05:17:30,285 |-INFO in ch.qos.logback.core.ConsoleAppender[STDOUT] - Enabling JANSI WindowsAnsiOutputStream for the console.
05:17:30,285 |-WARN in ch.qos.logback.core.ConsoleAppender[STDOUT] - Failed to create WindowsAnsiOutputStream. Falling back on the default stream. ch.qos.logback.core.util.DynamicClassLoadingException: Failed to instantiate type org.fusesource.jansi.WindowsAnsiOutputStream
	at ch.qos.logback.core.util.DynamicClassLoadingException: Failed to instantiate type org.fusesource.jansi.WindowsAnsiOutputStream
	at 	at ch.qos.logback.core.util.OptionHelper.instantiateByClassNameAndParameter(OptionHelper.java:69)
	at 	at ch.qos.logback.core.util.OptionHelper.instantiateByClassNameAndParameter(OptionHelper.java:40)
	at 	at ch.qos.logback.core.ConsoleAppender.getTargetStreamForWindows(ConsoleAppender.java:88)
	at 	at ch.qos.logback.core.ConsoleAppender.start(ConsoleAppender.java:79)
	at 	at ch.qos.logback.core.joran.action.AppenderAction.end(AppenderAction.java:90)
	at 	at ch.qos.logback.core.joran.spi.Interpreter.callEndAction(Interpreter.java:309)
	at 	at ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:193)
	at 	at ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:179)
	at 	at ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:62)
	at 	at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:165)
	at 	at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:152)
	at 	at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:110)
	at 	at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:53)
	at 	at ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:75)
	at 	at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:150)
	at 	at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:84)
	at 	at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:55)
	at 	at org.slf4j.LoggerFactory.bind(LoggerFactory.java:150)
	at 	at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:124)
	at 	at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:412)
	at 	at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:357)
	at 	at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:383)
	at 	at org.log4s.package$.getLogger(package.scala:8)
	at 	at com.codacy.helpers.LoggerHelper$.getLogger(LoggerHelper.scala:18)
	at 	at com.codacy.helpers.LoggerHelper$.logger(LoggerHelper.scala:11)
	at 	at com.codacy.rules.ConfigurationRules.<init>(ConfigurationRules.scala:16)
	at 	at com.codacy.di.Components.configRules$lzycompute(Components.scala:14)
	at 	at com.codacy.di.Components.configRules(Components.scala:14)
	at 	at com.codacy.di.Components.validatedConfig$lzycompute(Components.scala:12)
	at 	at com.codacy.di.Components.validatedConfig(Components.scala:12)
	at 	at com.codacy.CodacyCoverageReporter$.run(CodacyCoverageReporter.scala:13)
	at 	at com.codacy.configuration.parser.ConfigurationParsingApp.run(ConfigurationParser.scala:13)
	at 	at com.codacy.configuration.parser.ConfigurationParsingApp.run(ConfigurationParser.scala:11)
	at 	at caseapp.CommandAppWithPreCommand$$anonfun$main$1.apply(CommandAppWithPreCommand.scala:97)
	at 	at caseapp.CommandAppWithPreCommand$$anonfun$main$1.apply(CommandAppWithPreCommand.scala:82)
	at 	at scala.Option.foreach(Option.scala:257)
	at 	at caseapp.CommandAppWithPreCommand.main(CommandAppWithPreCommand.scala:82)
	at 	at com.codacy.CodacyCoverageReporter.main(CodacyCoverageReporter.scala)
Caused by: java.lang.ClassNotFoundException: org.fusesource.jansi.WindowsAnsiOutputStream
	at 	at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
	at 	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at 	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
	at 	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at 	at ch.qos.logback.core.util.OptionHelper.instantiateByClassNameAndParameter(OptionHelper.java:56)
	at 	... 37 common frames omitted
05:17:30,285 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to INFO
05:17:30,285 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[ROOT]
05:17:30,285 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
05:17:30,285 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@50b472aa - Registering current configuration as safe fallback point
03/28 05:17:30 INFO  c.c.rules.ConfigurationRules:101 - Using API base URL: https://api.codacy.com 
03/28 05:17:30 INFO  com.codacy.rules.ReportRules:126 - Commit UUID not provided, using latest commit of current directory:
4d9b439fec67f8da53362740009cba4c9084563e Guilherme Branco Stracini <guilherme@guilhermebranco.com.br> Sat Mar 28 05:15:43 UTC 2020 
03/28 05:17:30 INFO  com.codacy.rules.ReportRules:48 - Parsing coverage data from: C:\projects\viacep\Tests\ViaCEP.Tests\coverage.cobertura.xml ... 
03/28 05:17:31 INFO  com.codacy.rules.ReportRules:81 - Generated report: C:\projects\viacep\Tests\ViaCEP.Tests\codacy-coverage.json (0.32 kB) 
03/28 05:17:31 INFO  com.codacy.rules.ReportRules:82 - Uploading coverage data... 
03/28 05:17:33 INFO  c.c.CodacyCoverageReporter$:31 - Coverage data uploaded. Coverage received successfully.

@lolgab
Copy link
Contributor

lolgab commented Mar 28, 2020

I'm reopening the issue. Thank you for reporting.

@lolgab lolgab reopened this Mar 28, 2020
@andreaTP
Copy link
Contributor

@guibranco a possible workaround is to tweak the logging level and disable Jansi.

E.g. write a file logback.xml with this content:

<configuration>
    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
        <withJansi>false</withJansi>
        <encoder>
            <pattern>%date %-16level %-10.-10logger %message %n</pattern>
        </encoder>
    </appender>
    <logger name="application" level="ERROR"/>
    <root level="WARN">
        <appender-ref ref="STDOUT"/>
    </root>
</configuration>

And run the reporter passing the new configuration:

java -jar ./codacy-test-reporter.jar report -Dlogback.configurationFile=logback.xml -l CSharp -t %CODACY_PROJECT_TOKEN% -r "%CD%\Tests\%SOLUTION_NAME%.Tests\coverage.cobertura.xml"

I'm sorry but I don't have access to a windows machine to test, can you check and report the result?

@guibranco
Copy link

@andreaTP I'll try soon, and then I'll let you know if this works!

@guibranco
Copy link

@andreaTP I put the file in a "Build" directory in the repository and I'm passing it as a reference in the build, it's generating an error and breaking the build process...

Unrecognized argument: -Dlogback.configurationFile=C:\projects\test-coverage-error\Build\logback.xml

This is how my build section is in the appveyor.yml:

build_script:
- dotnet build %SOLUTION_NAME%.sln
- dotnet test .\Tests\%SOLUTION_NAME%.Tests\%SOLUTION_NAME%.Tests.csproj /p:CollectCoverage=true /p:CoverletOutputFormat="opencover"
- codecov -f %CD%\Tests\%SOLUTION_NAME%.Tests\coverage.opencover.xml
- dotnet test .\Tests\%SOLUTION_NAME%.Tests\%SOLUTION_NAME%.Tests.csproj /p:CollectCoverage=true /p:CoverletOutputFormat="cobertura" 
- java -jar ./codacy-test-reporter.jar report -Dlogback.configurationFile="%CD%\Build\logback.xml" -l CSharp -t %CODACY_PROJECT_TOKEN% -r "%CD%\Tests\%SOLUTION_NAME%.Tests\coverage.cobertura.xml"

@guibranco
Copy link

It works if I switch the arguments order, passing the -D... right after the -jar option

Example:

build_script:
- dotnet build %SOLUTION_NAME%.sln
- dotnet test .\Tests\%SOLUTION_NAME%.Tests\%SOLUTION_NAME%.Tests.csproj /p:CollectCoverage=true /p:CoverletOutputFormat="opencover"
- codecov -f %CD%\Tests\%SOLUTION_NAME%.Tests\coverage.opencover.xml
- dotnet test .\Tests\%SOLUTION_NAME%.Tests\%SOLUTION_NAME%.Tests.csproj /p:CollectCoverage=true /p:CoverletOutputFormat="cobertura" 
- java -jar -Dlogback.configurationFile="%CD%\Build\logback.xml" ./codacy-test-reporter.jar report -l CSharp -t %CODACY_PROJECT_TOKEN% -r "%CD%\Tests\%SOLUTION_NAME%.Tests\coverage.cobertura.xml"

@andreaTP
Copy link
Contributor

@guibranco my bad for the arguments order, sorry for the trouble!
Does it solves the issue?

@guibranco
Copy link

Yes! Now it's working like a charm 👍👏

Thanks!

@lolgab
Copy link
Contributor

lolgab commented Apr 7, 2020

Hi @guibranco,
The problem should be fixed now that we disabled Jansi on our default configuration.
Could you try the latest version (it was fixed in 7.6.8) without the -Dlogback.configurationFile="%CD%\Build\logback.xml" part?
Thank you!

@guibranco
Copy link

It worked with 7.6.8 and 7.7.0

7.6.8 log: https://ci.appveyor.com/project/guibranco/viacep/builds/32012715
7.7.0 log: https://ci.appveyor.com/project/guibranco/viacep/builds/32012758

@lolgab
Copy link
Contributor

lolgab commented Apr 7, 2020

Thank you very much for testing it!
Closing the issue as solved 🎉

@lolgab lolgab closed this as completed Apr 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants