mathworks / jenkins-matlab-plugin

This plugin enables you to run MATLAB® and Simulink® as part of your Jenkins™ build.
45 stars 54 forks source link

"-sd" alone instead of "-sd matlab" results in a passing build #293

Closed mw-hrastega closed 7 months ago

mw-hrastega commented 7 months ago

I deleted "matlab" from the Startup Options box and ran a build with -sd alone as the startup option. I was expecting an incomplete option to result in a Jenkins build error; however, the build passed.

sameagen-MW commented 7 months ago
image

Here's a screenshot of how matlab -batch handles this case.

sameagen-MW commented 7 months ago

I think that matching the behavior of the matlab executable is probably my preference, but I would be open to potentially changing the behavior if that ends up being the group consensus.

mw-hrastega commented 7 months ago
image

Here's a screenshot of how matlab -batch handles this case.

Thanks @sameagen-MW for including a screenshot.

sameagen-MW commented 7 months ago

Did the warning message show up in the Jenkins job Houman?

mw-hrastega commented 7 months ago

Did the warning message show up in the Jenkins job Houman?

Hmm. Not sure. Didn't inspect the build log 🤒

Vahila commented 7 months ago

Hi, with the hpi file generated out of latest changes in 2.11.2 qual branch, I see weird behavior when just specifying -sd alone on Windows. Attaching screenshots for reference. Project run on Windows agent: Console log: image

Jenkins project config: image image

And when project is run on Linux, I see some errors as below. Console log: image Jenkins Configure page: image

nbhoski commented 7 months ago

I tried it on command line and its exacttly the same behaviour as Jenkins

image image

@sameagen-MW is there any limitation from go lang exec that we are using ? since its not throwing any error on -sd

image
sameagen-MW commented 7 months ago

Yep, after looking into it I can confirm that this is an issue with the way that run-matlab-command handles arguments. In this case what's happening is because we're appending -batch "command" after the flags, the full command would be matlab -sd -batch "command", and it registers -batch as the argument for -sd leading to an error in parsing "command".

I'll close the issue here and open an enhancement on run-matlab-command.