简体   繁体   English

黄瓜jvm失败:生成失败,出现异常

[英]cucumber jvm FAILED FAILURE: Build failed with an exception

I try to run this gradle task (via gradlew) 我尝试运行此gradle任务(通过gradlew)

which uses cucmber jvm 使用cucmber jvm

task callCL (type: Exec) {
    commandLine './build/distributions/WebLargeTests/bin/WebLargeTests  -f html:build/reports/cucumber/ -f json:build/reports/cucumber/report.json --glue com.mayApp.testing.cucumber src/main/resources/features --tags ~@ignore -f rerun'
}

and get this error 并得到这个错误

:callCL FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':callCL'.
> A problem occurred starting process 'command './build/distributions/WebLargeTests/bin/WebLargeTests  -f html:build/reports/cucumber/ -f json:build/reports/cucumber/report.json --glue com.myApp.testing.cucumber src/main/resources/features --tags ~@ignore -f rerun''

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 3.448 secs
error=2, No such file or directory
3:48:00 PM: External task execution finished 'callCL'.

when I run the same line from the same path in cmd: 当我在cmd中从同一路径运行同一行时:

/build/distributions/WebLargeTests/bin/WebLargeTests  -f html:build/reports/cucumber/ -f json:build/reports/cucumber/report.json --glue com.myApp.testing.cucumber src/main/resources/features --tags ~@ignore -f rerun
Starting ChromeDriver (v2.9.248307) on port 12095
Starting ChromeDriver (v2.9.248307) on port 34150
Starting ChromeDriver (v2.9.248307) on port 29495
Starting ChromeDriver (v2.9.248307) on port 8792
Starting ChromeDriver (v2.9.248307) on port 23779
Starting ChromeDriver (v2.9.248307) on port 3553

update1: 更新1:

this cmd works in a shell console: 此cmd可在Shell控制台中使用:

./build/distributions/WebLargeTests/bin/WebLargeTests -f html:build/reports/cucumber/ -f json:build/reports/cucumber/report.json --glue com.waze.testing.cucumber src/main/resources/features --tags @only -f rerun ./build/distributions/WebLargeTests/bin/WebLargeTests -f html:build / reports / cucumber / -f json:build / reports / cucumber / report.json --glue com.waze.testing.cucumber src / main / resources /功能--tags @only -f重新运行

but not in the build.gradle 但不在build.gradle中

task callCL (type: Exec) {
    commandLine 'bash', './build/distributions/WebLargeTests/bin/WebLargeTests', '-f',
            'html:build/reports/cucumber/', '-f', 'json:build/reports/cucumber/report.json', '--glue',
            'com.waze.testing.cucumber', 'src/main/resources/features', '--tags', '@ignore', '-f', 'rerun'

    //store the output instead of printing to the console:
    standardOutput = new ByteArrayOutputStream()

    //extension method stopTomcat.output() can be used to obtain the output:
    ext.output = {
        return standardOutput.toString()
    }
}

btw 顺便说一句

I want the cmd to be: 我希望cmd为:

./build/distributions/WebLargeTests/bin/WebLargeTests -f html:build/reports/cucumber/ -f json:build/reports/cucumber/report.json --glue com.waze.testing.cucumber src/main/resources/features --tags @only -f rerun --out rerun.txt ./build/distributions/WebLargeTests/bin/WebLargeTests -f html:build / reports / cucumber / -f json:build / reports / cucumber / report.json --glue com.waze.testing.cucumber src / main / resources /功能--tags @only -f rerun --out rerun.txt

but not in the build.gradle 但不在build.gradle中

task callCL (type: Exec) {
    commandLine 'bash', './build/distributions/WebLargeTests/bin/WebLargeTests', '-f',
            'html:build/reports/cucumber/', '-f', 'json:build/reports/cucumber/report.json', '--glue',
            'com.waze.testing.cucumber', 'src/main/resources/features', '--tags', '@ignore', '-f', 'rerun', '--out', 'rerun.txt'

    //store the output instead of printing to the console:
    standardOutput = new ByteArrayOutputStream()

    //extension method stopTomcat.output() can be used to obtain the output:
    ext.output = {
        return standardOutput.toString()
    }
}

but this doesn't work (shell concole nore build.gradle) 但这是行不通的(shell conole nore build.gradle)

See if this works! 看看是否可行!

Note: I'm using /build/... path instead of using a dot first then slash: ./build/... 注意:我使用的是/ build / ...路径,而不是先使用点然后使用斜杠:./build / ...

task callCL(type: Exec) {

        executable "bash"
        args "-c", "bash /build/distributions/WebLargeTests/bin/WebLargeTests -f html:build/reports/cucumber/ -f json:build/reports/cucumber/report.json --glue com.waze.testing.cucumber src/main/resources/features --tags @only -f rerun"


        // If you want the store the output to a file, you can also try the following
        //args "-c", "bash /build/distributions/WebLargeTests/bin/WebLargeTests -f html:build/reports/cucumber/ -f json:build/reports/cucumber/report.json --glue com.waze.testing.cucumber src/main/resources/features --tags @only -f rerun 1>/some/path/somefile.log 2>&1"

        //store the output instead of printing to the console:
        standardOutput = new ByteArrayOutputStream()

        //extension method stopTomcat.output() can be used to obtain the output:
        ext.output = {
           return standardOutput.toString()
        }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM