2013-03-20 125 views
0

我想安装一个ant生成脚本behat测试,所以我可以从詹金斯运行它们。当我用bin/behat或./bin/behat命令行运行behat时,输出按预期工作。但是,当我用下面的ant脚本蚂蚁生成脚本behat错误

<project name="behat" basedir="."> 
    <exec dir="bin" executable="./behat"> 
    </exec> 
</project> 

我得到这个错误:

Buildfile: <mydir>/build.xml 
[exec] 
[exec] 
[exec] 
[exec] [RuntimeException] 
[exec] Context class not found. 
[exec] Maybe you have provided wrong or no `bootstrap` path in your behat.yml: 
[exec] http://docs.behat.org/guides/7.config.html#paths 
[exec] 
[exec] 
[exec] 
[exec] behat [--init] [-f|--format="..."] [--out="..."] [--lang="..."] [--[no-]ansi] [--[no-]time] [--[no-]paths] [--[no-]snippets] [--[no-]snippets-paths] [--[no-]multiline] [--[no-]expand] [--story-syntax] [-d|--definitions="..."] [--name="..."] [--tags="..."] [--cache="..."] [--strict] [--dry-run] [--rerun="..."] [--append-snippets] [--append-to="..."] [features] 
[exec] 
[exec] 
[exec] Result: 1 

BUILD SUCCESSFUL 
Total time: 0 seconds 

回答

1

您不应该从bin目录运行behat。它不会找到你的behat.yml文件。

您应该像这样运行:

./bin/behat 

或传递路径配置文件:

cd bin 
./bin/behat --config ../behat.yml 

我没有尝试过的版本。你的蚂蚁脚本可能看起来像这样:

<project name="behat" basedir="."> 
    <exec dir="${basedir}" executable="./bin/behat" /> 
</project> 
+0

工作。谢谢。 – steve76 2013-03-23 14:10:46

0

我把蚂蚁的方程,只用于詹金斯运行贝哈特命令直接:

cd <mydir> 
bin/behat 

我需要检查的一件事是从詹金斯返回失败,但它可能是由于behat测试失败。