[英]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.