I am following the documentation and I tried to create an Exec task:
task karmaTest(type:Exec) {
// #1 workingDir project.projectDir;
// #2 workingDir project.projectDir.canonicalPath;
// #3 workingDir project.projectDir.absolutePath;
// #4 workingDir project.projectDir.absolutePath.replace(" ", "\\ ");
commandLine 'karma start --singleRun true --browsers PhantomJS src/test/js/config/karma.conf.js'
}
The task is really simple. It just needs to execute javascript tests using karma.
Output #1:
Caused by: java.io.IOException: Cannot run program "karma start --singleRun true --browsers PhantomJS src/test/js/config/karma.conf.js" (in directory "/home/eianni/Br/Repositories Ciao/git/workflowcobrand/wfc-services"): error=2, No such file or directory
Output #2:
Caused by: java.io.IOException: Cannot run program "karma start --singleRun true --browsers PhantomJS src/test/js/config/karma.conf.js" (in directory "/home/eianni/Br/Repositories Ciao/git/workflowcobrand/wfc-services"): error=2, No such file or directory
Output #3:
Caused by: java.io.IOException: Cannot run program "karma start --singleRun true --browsers PhantomJS src/test/js/config/karma.conf.js" (in directory "/home/eianni/Br/Repositories Ciao/git/workflowcobrand/wfc-services"): error=2, No such file or directory
Output #4:
Caused by: java.io.IOException: Cannot run program "karma start --singleRun true --browsers PhantomJS src/test/js/config/karma.conf.js" (in directory "/home/eianni/Br/Repositories\ Ciao/git/workflowcobrand/wfc-services"): error=2, No such file or directory
As you can see I tried in different ways but I'm still getting the error. I don't think it's the white space since when I renamed If was getting the same error and I also removed workingDir
(because the default from docs is project.projectDir
but I'm still getting the error).