radarsh / gradle-test-logger-plugin

A Gradle plugin for printing beautiful logs on the console while running tests
Apache License 2.0
835 stars 36 forks source link

Unable to see testlogger options in my unit test runs #326

Open spark85 opened 10 months ago

spark85 commented 10 months ago

Description Hello,

I've succesfully setup the project as a dependency using the gradle plugin; and I'm sure of it as I am able to setup a testlogger configuration object in my top-level build.gradle. However I'm not seeing the mocha theme or any other feature doing anything when I run ./gradlew app:test or using Android Sudio 'Run Tests'

I haven't setup anything in my modules. Should I be setting something in the modules?

Versions

Type of test being run

Whether it is JUnit, Spock, TestNg, or anything else. Also, try to include a sample test here.

Test logger configuration

testlogger { theme = com.adarshr.gradle.testlogger.theme.ThemeType.MOCHA showExceptions = false showStackTraces = false showCauses = false slowThreshold = 2000 showSummary = false showSimpleNames = false showPassed = true showSkipped = true showFailed = true showOnlySlow = false showStandardStreams = false showPassedStandardStreams = false showSkippedStandardStreams = false showFailedStandardStreams = false logLevel = org.gradle.api.logging.LogLevel.ERROR }

Screenshots

Additional information

Add any other information about the problem here.

radarsh commented 10 months ago

Can you try by commenting out the logLevel setting?

spark85 commented 10 months ago

still having the same problem. Could you add the command line arguments we should be using? is it just gradlew tests?

radarsh commented 10 months ago

You don't need any other argument. Just running the test task should print the logger output. Perhaps create a small reproducible sample so that I could take a look?

spark85 commented 10 months ago

Sure. So I willl show you the output of the build window from Android Studio & also the terminal output from .gradlew command. We have a complicated gradle build system so it's possible that where I am including the test logger & the logger configuration is getting overridden.

spark85 commented 10 months ago

I'm actually getting a new issue; or this was the issue before but it wasn't being logged out.
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

spark85 commented 10 months ago
Screenshot 2023-10-23 at 1 05 19 PM
spark85 commented 10 months ago
Screenshot 2023-10-23 at 1 05 19 PM

Just wanted to check in if this is connected to another issue?

spark85 commented 10 months ago

Added a video with more information --> https://drive.google.com/file/d/1NYfacrmaasiMIDtyN7oHVlAZbU3nOQgD/view?usp=sharing

spark85 commented 10 months ago

Hello, just wanted to know if I should expect an update on this issue or I should close it?

radarsh commented 10 months ago

@spark85 I just found some time to work on this project tonight. Let me check your resources and let you know. I also found this StackOverflow question which seems relevant.

Possibly related to #268 and #111

radarsh commented 10 months ago

Sorry but this is beyond me. Partly because I don't do Android development. Perhaps if someone could create a codespace to reproduce this I might be able to help but even so it's unlikely.