【问题标题】:Build haskell stack tests without running在不运行的情况下构建 haskell 堆栈测试
【发布时间】:2017-08-18 17:20:23
【问题描述】:

我做了一个非常简单的项目,但测试套件失败了 https://github.com/k-bx/noruntests-play

现在,当我运行 stack --test --no-run-tests build 时,我希望它能够构建项目,但不会运行测试。相反,它运行测试:

➜  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

我在这里做错了什么?谢谢!

【问题讨论】:

    标签: haskell command-line-arguments haskell-stack build-tools


    【解决方案1】:

    您应该将build 选项放在--test 之前,如下所示:

    $ stack build --test --no-run-tests
    

    我不确定这是错误还是功能。如果您对开发人员的反馈感兴趣,可以打开问题here。就我个人而言,在build 之前传递--test 似乎很奇怪。在某种合理的意义上,--testbuild 的子部分,子部分或选项通常指定在主选项的右侧。

    还有你想要的更短的版本(因为build --test 只是test):

    $ stack test --no-run-tests
    

    【讨论】:

    • 我认为您在某种程度上是对的,另一方面,如果该选项未被识别,恕我直言,最好不要默默地扔掉它,而是报告错误或警告。我去买票。
    猜你喜欢
    • 1970-01-01
    • 2011-12-30
    • 2010-12-09
    • 1970-01-01
    • 1970-01-01
    • 2022-07-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多