我担心一些开发人员通常会使用 @Ignore 忽略失败的测试以绕过 SonarQube 静态验证。
为此,我正在寻找会产生问题的规则。
有人知道我怎样才能做到这一点吗?
我正在使用 SonarQube 5.4 和 JUnit。
最佳答案
曾经有一个规则:Rule S1607: Tests should not be ignored
(旧)
然而,此规则已更新,现在实际上允许忽略测试,如果适当注释:Rule S1607: JUnit4 @Ignored and JUnit5 @Disabled annotations should be used to disable tests and should provide a rationale
(new)
关于java - JUnit @Ignore 的 Sonarqube 规则,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45109864/