getgauge / gauge

Light weight cross-platform test automation
https://gauge.org
Apache License 2.0
2.97k stars 338 forks source link

Azure pipeline execution issues on cloud agent machine, Cannot run program "gauge": CreateProcess error=2, The system cannot find the file specified #2044

Open hcsan opened 3 years ago

hcsan commented 3 years ago

Describe the bug Hi Team ,

I have followed azure documentation and tried to execute the scripts on Azure pipeline i am getting

Gauge Java with selenium

first time it worked fine , all cloud agent/machines are non persistent Script executing on Azure cloud, i will get the below error .

Same configuration will work fine on Remote agent which is hosted locally ( Where i have setup the gauge path in system environment path variable )

I tied to get the path , set the gauge path nothing worked , tried to set the env variable at the execution time

[ERROR] Failed to execute goal com.thoughtworks.gauge.maven:gauge-maven-plugin:1.4.3:execute (default-cli) on project My-test-automation: Gauge Specs execution failed. java.io.IOException: Cannot run program "gauge": CreateProcess error=2, The system cannot find the file specified -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.thoughtworks.gauge.maven:gauge-maven-plugin:1.4.3:execute (default-cli) on project swoop-test-automation: Gauge Specs execution failed. java.io.IOException: Cannot run program "gauge": CreateProcess error=2, The system cannot find the file specified at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)

at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)

[ERROR] [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

To Reproduce Steps (or project) to reproduce the behavior:

pool: vmImage: 'vs2017-win2016'

steps:

mvn -X -e test-compile gauge:execute -DspecsDir=specs/mytest -Denv="win_chrome" -Dtags="4" -Dflags="--max-retries-count=2,--verbose,--strategy=eager"

sriv commented 3 years ago

can you try running gauge -v as a command before invoking mvn? The error seems to suggest that mvn is not able to locate gauge binary.