teragrep / pth_10

Data Processing Language (DPL) translator for Apache Spark
GNU Affero General Public License v3.0
0 stars 2 forks source link

Don't comment out @Test, use @Disabled instead #223

Closed StrongestNumber9 closed 6 months ago

StrongestNumber9 commented 6 months ago

Description

Use @Disabled before @Test if you need to disable a test, or use @EnabledIfSystemProperty or @DisabledIfSystemPropert if you need to make it conditional. Remove the test completely if it is deprecated

Related task is to go through the disabled tests and check whether it should be enabled or removed.

Use case or motivation behind the feature request

//@Test will hide the test and not show up as disabled and can be easily forgotten

Normally you run all 5 tests

[INFO] Tests run: 5, Failures: 0, Errors: 0, Skipped: 0

Everything looks good and you get false sense of all tests passing if test is commented out

[INFO] Tests run: 4, Failures: 0, Errors: 0, Skipped: 0

We know the test exists but is skipped when properly disabled

[WARNING] Tests run: 5, Failures: 0, Errors: 0, Skipped: 1

Related issues

https://github.com/teragrep/pth_10/blob/57586b4575bf084e3cc4a34bd39bca6c2166fa9a/src/test/java/com/teragrep/pth10/JoinTransformationTest.java#L261-L285

Additional context

https://junit.org/junit5/docs/5.9.1/api/org.junit.jupiter.api/org/junit/jupiter/api/condition/DisabledIfSystemProperty.html

https://junit.org/junit5/docs/5.9.1/api/org.junit.jupiter.api/org/junit/jupiter/api/condition/EnabledIfSystemProperty.html

https://junit.org/junit5/docs/5.2.0/api/org/junit/jupiter/api/Disabled.html

eemhu commented 6 months ago

internal pr merged, switch to @Disabled