[英]Build haskell stack tests without running
I've made a very simple project with a failing test suite https://github.com/k-bx/noruntests-play 我用一个失败的测试套件制作了一个非常简单的项目https://github.com/k-bx/noruntests-play
Now when I run stack --test --no-run-tests build
I would expect it to build the project, but not run the tests. 现在,当我运行
stack --test --no-run-tests build
我希望它能够构建项目,但不会运行测试。 Instead, it runs the tests: 相反,它运行测试:
➜ noruntests-play git:(master) stack --test --no-run-tests build
noruntests-play-0.1.0.0: test (suite: test)
test: error
CallStack (from HasCallStack):
error, called at tests/Tests.hs:4:8 in main:Main
Test suite failure for package noruntests-play-0.1.0.0
test: exited with: ExitFailure 1
Logs printed to console
What am I doing wrong here? 我在这做错了什么? Thank you!
谢谢!
You should put build
option before --test
like this: 你应该把
build
选项之前--test
是这样的:
$ stack build --test --no-run-tests
I'm not sure whether it's bug or feature. 我不确定它是否是错误或功能。 You can open issue here if you're interested in feedback from developers.
如果您对开发人员的反馈感兴趣,可以在此处打开问题。 Personally for me it seems strange to pass
--test
before build
. 个人对我来说似乎有些奇怪传递
--test
之前build
。 In some reasonable sense --test
is subpart of build
and subparts or options are usually specified to the right of main option. 在某种合理的意义上
--test
是build
子部分,子部分或选项通常指定在主选项的右侧。
Also there's shorter version of what you want (because build --test
is just test
): 还有你想要的更短版本(因为
build --test
只是test
):
$ stack test --no-run-tests
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.