Bug 63394 - JMeter should fail with non-zero when test execution fails (due to missing test plan or other reason)
Summary: JMeter should fail with non-zero when test execution fails (due to missing te...
Status: RESOLVED FIXED
Alias: None
Product: JMeter
Classification: Unclassified
Component: Main (show other bugs)
Version: 5.1.1
Hardware: Macintosh All
: P2 minor (vote)
Target Milestone: JMETER_5.2
Assignee: JMeter issues mailing list
URL:
Keywords: FixedInTrunk, PatchAvailable
Depends on:
Blocks:
 
Reported: 2019-05-02 04:27 UTC by amer g
Modified: 2019-05-21 08:33 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description amer g 2019-05-02 04:27:16 UTC
nit: I'm on Mac OS X 10.14 but that wasn't available in your selection

problem: jmeter exits 0, e.g. success, despite not being able to open the test plan. this results in pipeline jobs consuming the false positive and promoting a revision under the presumption that load testing completed successfully

expected behavior: if test plan could not be opened, jmeter exits with non-zero

steps to reproduce:

```
% jmeter -n -t somefilenamethatisntatestplan.jmx ; echo $?
Could not open somefilenamethatisntatestplan.jmx
0
```

i've looked through the commandline options and cannot see a flag that would allow it to run in a stricter fashion (e.g. failing non-zero on "could not open"). please advise. many thanks!

/a
Comment 1 UbikLoadPack support 2019-05-06 10:14:17 UTC
Hello,
Just for information, we're working on a fix and will contribute a PR soon.

Regards
Comment 2 Felix Schumacher 2019-05-12 08:34:50 UTC
Just saw that there is a PR 456 that could be used. I haven't seen UbikLoads answer and worked on this, too. My solution was pretty similar to the PR except that it used a ConfigurationException instead of a FileNotFoundException.

Are you working on a more complete solution than just checking for file existance?
Comment 3 Philippe Mouawad 2019-05-12 14:56:44 UTC
(In reply to Felix Schumacher from comment #2)
> Just saw that there is a PR 456 that could be used. I haven't seen UbikLoads
> answer and worked on this, too. My solution was pretty similar to the PR
> except that it used a ConfigurationException instead of a
> FileNotFoundException.
> 
> Are you working on a more complete solution than just checking for file
> existance?

Hi Felix,

Yes we're working on a little more complete solution and will provide a test case also.

Regards
Comment 4 Philippe Mouawad 2019-05-13 10:02:33 UTC
Hello Felix,

PR:

https://github.com/apache/jmeter/pull/458


I let you review it and merge it as you'll have an external eye.

Thanks
Regards
Comment 5 Philippe Mouawad 2019-05-21 08:33:06 UTC
Author: pmouawad
Date: Tue May 21 08:32:36 2019
New Revision: 1859615

URL: http://svn.apache.org/viewvc?rev=1859615&view=rev
Log:
Bug 63394 - JMeter should fail with non-zero when test execution fails (due to missing test plan or other reason)

Contributed by UbikLoadPack

This closes #458
This closes #456
Bugzilla Id: 63394

Added:
    jmeter/trunk/test/src/org/apache/jmeter/JMeterTest.java   (with props)
Modified:
    jmeter/trunk/src/core/org/apache/jmeter/JMeter.java
    jmeter/trunk/xdocs/changes.xml