Why does condition always evaluate to false?
Management Console is 8.0.0.1 on Windows 7.
Agent is 7.1.3 on Windows 7. Trying to execute a conditional step - the condition always evaluates as false - why? A sample condition is 1 = 1 , however, no matter what I put in for the condition, it always comes out false. When sending the same test from a 7.1.3 Management Console running on Windows XP to the same 7.1.3 Agent running on Windows 7, the condition is evaluated correctly. Do I have to use the 8.0.0.1 Agent with the 8.0.0.1 Management Console? Should I be using the Perl legacy engine on the 8.0.0.1 Management Console rather than the Java version? Can someone explain the difference between the Java and the Perl versions? Why would I care to choose one versus the other? What was used with 7.1.3 Build Forge? Thanks, John Bobinyec |
4 answers
Here's an excerpt from the console file:
COND CRRBF9999I: Condition '1 = 1' evaluated to 'false'. MJC CRRBF1594I: Step Test Condition (bcaaee760c681000acd1d7d4afd0e8d1) started. |
By the way, it happens with the 8.0.0.1 agent as well.
Thanks, John Bobinyec |
The short answer is you really want to use "eq" instead of "=" unless you include it in one of the functions. You could also say "true(1==1)"
Here is the appropriate section of the docs that shows all the other conditional functions
It's a subset of the javascript conditionals.
Comments
John Bobinyec
commented May 05 '14, 6:55 p.m.
Why did I not have to do that with the 7.1.3 Management Console? It evaluated conditions in the native script language of the agent machine. So a Windows XP agent would be able to interpret 1 = 1 as true because that condition is recognized by the command interpreter.
|
You can use the perl engine, but that doesn't get you any benefit of the 8.0 release. The perl engine will also likely be removed from a future release in the 8.x line. The "1=1" behavior from the perl engine was actually a defect in the way the conditions were assessed. The true(1==1) syntax was documented back in the 7.1.x line as the correct way.
My suggestion would be to craft an API program to go through all your steps. For the conditional steps, have it parse the condition. If there is the use of a single =, either change it to eq, or wrap the conditional in a true().
|
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.