使用 Arcanist (Phabricator) 自动运行 PHPUnit 测试 [英] Automatically running PHPUnit tests with Arcanist (Phabricator)

查看:29
本文介绍了使用 Arcanist (Phabricator) 自动运行 PHPUnit 测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一个简单"的问题:如何使用 Arcanist 自动运行 PHPunit 测试?

A "simple" question: how can I automatically run PHPunit tests with Arcanist?

根据文档,我应该首先加载一个自定义库.如前所述 here 我应该创建一个 .arcconfig文件并加载相应的库.

According to the documentation I should first load a custom library. As stated here I should create a .arcconfig file and load the appropriate library.

所以:我在我的项目中创建了一个目录arc_libs",并在目录src"中使用了 arc liberate 来生成所需的文件.我现在的配置是:

So: I've create a dir "arc_libs" in my project and in the dir "src" I used arc liberate to generate the needed files. My config is now:

{
  "project.name" : "arc_libs",
  "phabricator.uri" : "https://phabricator.xxx.xxx.net/",
  "unit.engine" : "PhpunitTestEngine",
  "load" : ["arc_libs/src"]
}

库确实被加载了,因为我可以运行 arc unit

The libary DOES get loaded because I can run arc unit

[matthijs@xx xxx]$ arc unit
No tests to run.

但正如您所见,没有要运行的测试.我们将测试保存在project_root/tests"中,据我了解 文档 我应该在模块"中创建一个 __tests__ 目录(可能是我的 arc_libs 目录?)

But as you can see there are no tests to run. We keep our tests in "project_root/tests" and as far as I understand the documentation I should create a __tests__ dir in "the module" (probably my arc_libs dir ?)

但是我想运行我现有的 PHPunit 测试文件,而不是我需要创建的新测试.我尝试使用符号链接等,但我无法让它工作.奥术师没有检测到我的测试.

However I want to run my existing PHPunit test files, not new tests I need to create. I tried using a symlink etc but I cannot get it to work. Arcanist doesn't detect my tests.

所以我的问题是:如何使用 arcanist 自动运行我现有的 PHPunit 测试?

So my question: How can I automatically run my EXISTING PHPunit tests with arcanist?

(注意我们使用 arc diff 应该自动运行 arc unit)

(note we use arc diff that should run arc unit automatically)

推荐答案

$ arc unit --help

  unit [options] [paths]
  unit [options] --rev [rev]
      Supports: git, svn, hg
      Run unit tests that cover specified paths. If no paths are specified,
      unit tests covering all modified files will be run.

默认情况下,arc lint 和 arc unit 旨在用作进行更改过程的一部分,因此默认情况下它仅作用于更改的文件.奇怪的是,您没有任何更改的文件.您可能想要指定一些路径,或者运行 arc unit --everything 来运行所有测试.

By default, arc lint and arc unit are meant to be used as part of a process of making changes, so by default it only acts on changed files. Odds are, you don't have any changed files. You probably want to specify some paths, or run arc unit --everything to run all tests.

这篇关于使用 Arcanist (Phabricator) 自动运行 PHPUnit 测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆