-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How can we use "validate" in scripts? #20
Comments
Hi Rob
Thanks for the comments.
Good question - perhaps it would be useful to set a command line switch to cause a fail-with-exit-code on a bad plan entry?
Cheers
Derek
…________________________________
From: rpgoldman <notifications@github.com>
Sent: 12 September 2017 23:09:45
To: KCL-Planning/VAL
Cc: Subscribed
Subject: [KCL-Planning/VAL] How can we use "validate" in scripts? (#20)
I was planning to invoke validate in a script, and check to see if my plan validated using the customary check against exit status. But I was disappointed to find that even when validate emitted `Bad plan description!" its exit code was still zero.
Digging further, since the plan argument is optional, and it's possible to check multiple plans in a single run of validate, I can see why the exit code wasn't set. And, indeed, AFAICT if validate fails to parse a plan file, it gets a zero back from getPlan, which means it's just like the plan not being there.
But if validate doesn't set an exit code, how can one use it in a script?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub<https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FKCL-Planning%2FVAL%2Fissues%2F20&data=01%7C01%7Cderek.long%40kcl.ac.uk%7C088cb331b5e449b5239908d4fa2afadb%7C8370cf1416f34c16b83c724071654356%7C0&sdata=syCcQp12zfP9m9wJEIsvXqzk6oZzs3oG8xZkm%2Bv9Yhk%3D&reserved=0>, or mute the thread<https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAHSnVE75cRWGipOmzvkSDqOUq9AcWj27ks5shwEhgaJpZM4PVUqG&data=01%7C01%7Cderek.long%40kcl.ac.uk%7C088cb331b5e449b5239908d4fa2afadb%7C8370cf1416f34c16b83c724071654356%7C0&sdata=yRj1Drsh%2BJXhKcTX9mAZJhP1F3IoUn3GgVEJG0VDBeU%3D&reserved=0>.
|
Yes, I think that would be quite helpful. The alternative would be forcing scripts to parse output strings, which isn't very appealing. |
For our work, we have to parse the output anyway because we are also interested in what VAL says about the quality of the validated plans. I don't know if it's helpful for you, but we use the "downward-lab" package by Jendrik Seipp for this, which is available online. I don't know how difficult it would be to adapt Jendrik's code for other planning systems than Fast Downward. |
I was planning to invoke
validate
in a script, and check to see if my plan validated using the customary check against exit status. But I was disappointed to find that even whenvalidate
emitted `Bad plan description!" its exit code was still zero.Digging further, since the plan argument is optional, and it's possible to check multiple plans in a single run of validate, I can see why the exit code wasn't set. And, indeed, AFAICT if
validate
fails to parse a plan file, it gets a zero back fromgetPlan
, which means it's just like the plan not being there.But if
validate
doesn't set an exit code, how can one use it in a script?The text was updated successfully, but these errors were encountered: