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

testlogger extension settings not working for 3.1.0 #246

Open
lhvy opened this issue Dec 4, 2021 · 5 comments
Open

testlogger extension settings not working for 3.1.0 #246

lhvy opened this issue Dec 4, 2021 · 5 comments
Assignees
Labels

Comments

@lhvy
Copy link

lhvy commented Dec 4, 2021

Description

After updating to version 3.1.0, the settings in the testlogger extension stopped working. Written below is the settings i currently use, at the root project level in build.gradle. In version 3.0.0, showPassedStandardStreams false hides the standard out for passed unit tests, but upon upgrading to version 3.1.0, the standard out reappeared for passing tests. I have tried with other settings such as showPassed false, which had the same result of only successfully hiding passed tests in version 3.0.0.

Versions

  • Test logger version: 3.0.1
  • Gradle version: 7.2
  • Java version: OpenJDK 11.0.11

Type of test being run

JUnit 4.13.2

Test logger configuration

testlogger {
    theme 'standard-parallel'
    showFullStackTraces true
    showPassedStandardStreams false
}
@lhvy lhvy added the bug label Dec 4, 2021
@radarsh
Copy link
Owner

radarsh commented Jan 11, 2022

I think this and #252 are duplicates. Are you also configuring testLogging (Gradle's DSL) anywhere?

@lhvy
Copy link
Author

lhvy commented Jan 11, 2022

Yes, also in build.gradle, just below testLogger. The full build.gradle file can be found here if you want to check it out.

// Information on how to configure at https://github.com/radarsh/gradle-test-logger-plugin
testlogger {
    theme 'standard-parallel'
    showFullStackTraces true
    showPassedStandardStreams false
}

test {
    useJUnitPlatform()
    testLogging {
        // https://docs.gradle.org/6.9/userguide/performance.html#suggestions_for_java_projects
        maxParallelForks = Runtime.runtime.availableProcessors().intdiv(2) ?: 1
    }
}

Regarding the two issues being duplicates, I'm not seeing output twice or anything, and I'm only having issues in 3.1.0, everything is working perfectly in 3.0.0.

@radarsh
Copy link
Owner

radarsh commented Jan 16, 2022

Thanks, that was useful. Can you add showStandardStreams = false to testLogging closure and let me know what happens?

test {
    useJUnitPlatform()
    testLogging {
        // https://docs.gradle.org/6.9/userguide/performance.html#suggestions_for_java_projects
        maxParallelForks = Runtime.runtime.availableProcessors().intdiv(2) ?: 1
+       showStandardStreams = false
    }
}

Up until 3.0.0, I used to reset any logging events set on the testLogging closure but doing so seems to be discouraged in Gradle 7. So I've removed the resetting logic. I am wondering if that has caused the issue you're seeing.

@lhvy
Copy link
Author

lhvy commented Jan 21, 2022

Before adding showStandardStreams = false (expected is showPassedStandardStreams false works)
3.0.0 - Failing tests show standard out ✅
3.1.0 - All tests show standard out ❌

After adding showStandardStreams = false (expected is that no standard out appears at all?)
3.0.0 - No tests show standard out
3.1.0 - No tests show standard out

As a sidenote, I've noticed that between 3.0.0 and 3.1.0 the tests appear different too:
3.0.0:


> Task :test

frc.robot.controller.TestSequence testDoesConflict() PASSED
frc.robot.lib.TestConfigReader testEmptyFile() PASSED
frc.robot.lib.TestConfigReader testGetValueType() PASSED
frc.robot.lib.TestConfigReader testMissingFile() PASSED
frc.robot.lib.log.TestTimestampedLogWriter testWrite() PASSED
frc.robot.lib.log.TestTimestampedLogWriter testSymbolicLink() PASSED
frc.robot.subsystems.TestLocation testLocation() PASSED
frc.robot.subsystems.TestVision testVision() PASSED
frc.robot.controller.TestController testStopIntakingInterrupt() PASSED (1.8s)
frc.robot.drive.util.TestTrajectoryCaching testInteriorWaypoints() PASSED (1.8s)
frc.robot.subsystems.TestColourwheel testRotational() PASSED (1.2s)
frc.robot.drive.util.TestTrajectoryCaching testEnd() PASSED
frc.robot.subsystems.TestColourwheel testAdjustAnticlockwise() PASSED
...

3.1.0:


> Task :test


frc.robot.controller.TestSequence testDoesConflict() PASSED

TestSequence > testDoesConflict() PASSED
frc.robot.lib.TestConfigReader testEmptyFile() PASSED

TestConfigReader > testEmptyFile() PASSED
frc.robot.lib.TestConfigReader testGetValueType() PASSED

TestConfigReader > testGetValueType() PASSED
frc.robot.lib.TestConfigReader testMissingFile() PASSED

TestConfigReader > testMissingFile() PASSED
frc.robot.subsystems.TestColourwheel testRotational() PASSED

TestColourwheel > testRotational() PASSED
frc.robot.subsystems.TestColourwheel testAdjustAnticlockwise() PASSED

TestColourwheel > testAdjustAnticlockwise() PASSED
frc.robot.lib.log.TestTimestampedLogWriter testWrite() PASSED

TestTimestampedLogWriter > testWrite() PASSED
frc.robot.subsystems.TestColourwheel testEnableDisable() PASSED

TestColourwheel > testEnableDisable() PASSED
frc.robot.lib.log.TestTimestampedLogWriter testSymbolicLink() PASSED

TestTimestampedLogWriter > testSymbolicLink() PASSED
frc.robot.subsystems.TestLocation testLocation() PASSED
...

@lhvy
Copy link
Author

lhvy commented Nov 30, 2023

Tested in 4.0.0, still appears broken.

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

2 participants