OpenSuite error

Posting this here if someone else runs into it… :slight_smile:

I’ve set up our “Test Driver” machine to execute a Ruby script that in turn kicks off an eggplant master. My scripts run just fine in the GUI client. However, when I execute them via the Ruby on the test machine, I get:

EggplantTD:~/EggplantScripts/Test_Suite/Notation eggplantTD$ ruby -x TestAutomation.rb PrintMusic.suite/Scripts/PrintMusicFull.script 
Updating from Perforce...
File(s) up-to-date.
Executing tests... 
2007-08-20 16:09:27.045 runscript[289] {snipped to protect the innocent}
2007-08-20 16:09:27.045 runscript[289] Browsing For Bonjour RFB Servers
2007-08-20 16:09:27.046 runscript[289] Listening For Reverse Connections on Port 5500
2007-08-20 16:09:28.090 runscript[289] Error Running Script Command:
opensuite Error - Unable To Open Suite ~/Documents/Entry_Group/SUT_Start.suite
2007-08-20 16:09:29.091 runscript[289] Completed EggplantTestScript Notaton.suite - Full.script

It appears that the script is not paying attention to relative paths for OpenSuite. Is there a way around it?

The OpenSuite command uses the following search precedence when called with a path that isn’t absolute:
1-Looks for a sibling suite of the current suite
2-Looks in the user’s Default Suite Directory (set in general preferences)
So in particular if you are calling from a different account you will want to ensure that your Default Suite Directory is set.

That was it, Jonathan. The default suite wasn’t set in preferences on the test driver machine. A quick trip to Property List Editor did the trick. For anyone interested, simply add a string key called DefaultDocumentDirectory with the value of the folder you want to use in com.redstonesoftware.Eggplant.plist.

The entry is called DefaultDocumentDirectory in com.redstonesoftware.Eggplant.plist – but usually the easier way to set it is using the field at the bottom of the General Preferences pane in Eggplant (where it is labelled Default Suite Directory). :slight_smile:

Unless, of course you have a CLI-Only licence on a lab machine, then the only way to do it is to edit the PLIST. Thanks for catching my mis-type. I shouldn’t post right before lunch :wink:

No problem, and of course you’re right, if you can’t run the GUI version of Eggplant on that machine (or account) then the preference pane doesn’t do you much good. :wink:

Instead of using Property List Editor (not everyone has it, I believe) you can also do this in a terminal window (when logged in under the account that will be running the script):

defaults write com.redstonesoftware.Eggplant DefaultDocumentDirectory /path/to/desired/directory

(Note: that’s a single command, in case it’s wrapped on your screen)