gpt4 book ai didi

r - 在 R 中跳过 travis 上的特定测试文件

转载 作者:行者123 更新时间:2023-12-05 03:02:42 26 4
gpt4 key购买 nike

我的 testing suite由多个文件组成。我想在 travis 上跳过其中一个(与拟合贝叶斯模型相关的那个),因为它需要很多时间并且会失败。

我知道我可以使用 testthat::skip_on_travis() 跳过特定测试。但是,这些在 test_that block 中工作。不幸的是,我想跳过的部分(从 herehere )主要在 test_that block 之外(模型拟合发生在 测试之前)。

我尝试将模型拟合放入 test_that block 中,但其他 block 找不到模型。我也试过嵌套的 test_that block ,但这似乎不起作用......有什么想法吗?

最佳答案

另一个似乎可行的选项是检查环境变量:

if (Sys.getenv("USER") != "travis") {
# tests to be executed...
}

另见此处: https://docs.travis-ci.com/user/environment-variables/#default-environment-variables

关于r - 在 R 中跳过 travis 上的特定测试文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54550233/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com