一千萬個為什麽

搜索

是否可以使用Pygradle定義最小代碼覆蓋率?



Pygradle is used to build and test a Python project. In gradle it is possible to define a minimum code coverage percentage:

  jacocoTestCoverageVerification {
    違規規則{
        規則 {
            限制{
                最小值= 0.5
            }
        }

        規則 {
            啟用= false
            元素='CLASS'
            包括= ['org.gradle。*']

            限制{
                counter ='LINE'
                值='TOTALCOUNT'
                最大值= 0.3
            }
        }
    }
}
</代碼> 

如果未達到此限制,則構建將失敗。是否可以使用Pygradle定義最小代碼覆蓋率?

當上面的代碼片段運行時,構建失敗並返回以下內容:

FAILURE: Build failed with an exception.

* Where:
Build file '/home/user/SomeProject/build.gradle' line: 14

* What went wrong:
A problem occurred evaluating root project 'SomeProject'.
> Could not find method jacocoTestCoverageVerification() for arguments [build_fsdafasdfsa] on root project 'SomeProject' of type org.gradle.api.Project.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 2s

轉載註明原文: 是否可以使用Pygradle定義最小代碼覆蓋率?

一共有 1 個回答:

At the moment it looks like it is not possible to define a minimum code coverage as the ticket that was created is still open https://github.com/linkedin/pygradle/issues/184