Pipeline reports successful when commands are not available
I observe this at least with gitlab-runner for windows using shell executor and powershell.
Some ways to reproduce
- install gitlab-runner on a system (in my case Windows 10) that doesn't have git installed. Register that runner for a project, define a pipeline, and let it run.
- use a pipeline that includes a command which is not available on the system (e.g. dotnet)
The output of 1) will be something like:
`Running with gitlab-runner 10.1.0 (c1ecf97f) on MACHINE (896fb137) Using Shell executor... Running on MACHINE... & : The term 'git' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At C:\WINDOWS\TEMP\build_script687426374\script.ps1:142 char:5
- & "git" "config" "-f" "C:\gitlab-runner\builds\896fb137\0...
-
~~~~~
- CategoryInfo : ObjectNotFound: (git:String) [], CommandNotFound Exception
- FullyQualifiedErrorId : CommandNotFoundException
cd : Cannot find path 'C:\gitlab-runner\builds\896fb137\0\path\to\rep' because it does not exist.`
The output of 2) will be something like: `$ dotnet restore "myproject.sln" dotnet : The term 'dotnet' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At C:\WINDOWS\TEMP\build_script258464955\script.ps1:103 char:1
- dotnet restore "myproject.sln"
-
+ CategoryInfo : ObjectNotFound: (dotnet:String) [], CommandNotFo undException + FullyQualifiedErrorId : CommandNotFoundException
Job succeeded`
Typically, it is expected that these commands are available. I discovered these issues when trying to fit an old system as runner.