简体   繁体   English

如何在某些分支上定义某些测试?

[英]How do define certain tests on certain branches?

I am new to gitlab ci/cd.我是 gitlab ci/cd 的新手。 i like how it works.我喜欢它的工作方式。 I would like to run certain tests in certain branches.我想在某些分支中运行某些测试。 how can i define the same in yml file?如何在 yml 文件中定义相同的内容?

I am using gitlab ci/cd for R package development and using testthat package for unit-testing. I am using gitlab ci/cd for R package development and using testthat package for unit-testing.

You need to think how to structure your test suites in your branches.您需要考虑如何在您的分支中构建您的测试套件。

For example, you can name test-suite like /tests/branch_1/ and your branch has name branch_1 , then例如,您可以将 test-suite 命名为/tests/branch_1/并且您的分支的名称为branch_1 ,然后

test_job:
  script:
    -  test_dir("inst/tests/${CI_COMMIT_REF_NAME}"

where $CI_COMMIT_REF_NAME is your branch or tag name, according to gitlab predefined variables doc , will execute the test-suite with the same name your branch name is.其中$CI_COMMIT_REF_NAME是您的分支或标签名称,根据gitlab 预定义变量 doc ,将执行与您的分支名称相同的名称的测试套件。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我已经按照一定的规则定义了一个向量。 如何定义输出矢量的函数? - I have defined a vector according to a certain rule. How do I define a function that outputs the vector? 如何在某些行的序列中定义没有 NA 的列? - How to define column that doesn't have NAs in sequence of certain rows? 在 R 中,如何选择在某个行索引中包含某个值的某些列? - In R, how do I select certain columns that contain a certain value in a certain row index? dendextend:color_branches在某些hclust方法中不起作用 - dendextend: color_branches not working for certain hclust methods 如何根据相应列中的特定值替换特定列中的值? - How do I replace values in certain columns conditional on a certain value in corresponding columns? 学习 R:如何输出具有对应于某些 x 向量的索引的某些 y 向量元素的元素? - Learning R: How do I output the element of certain y vector elements with indices that correspond to certain x vectors? 在R中:如何将符合特定条件的值设置为特定值 - In R: How do I set values that meet a certain criteria to a certain value 在R中,如何提取最接近某个值的数组中某个行的列号? - In R, how do I extract the column number of a certain row in an array that's closest to a certain value? 如何定义一定数量的嵌套 for 循环(基于 R Shiny 应用程序中的输入长度)? - How to define a certain number of nested for-loops (based on input length in R Shiny app)? 如何替换字符串中某个位置的某个字符? - How to replace the certain character in certain position in the string?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM