Posts Tagged ‘continuous-integration’
We have had some issues lately getting our automated acceptance tests running in TeamCity on Firefox.
Our failing tests could open browser windows, but not interact with them — the same behaviour exhibited when the JSSH plugin is missing. And the error reported in TeamCity is like:
Unable to connect to machine : 127.0.0.1 on port 9997. Make sure that JSSh is properly installed and Firefox is running with '-jssh' option (Watir::Exception::UnableToStartJSShException)
This was puzzling because we knew we had installed JSSH.
The problem amounts to ensuring the Firefox JSSH extension is enabled for the correct account.
Build agents, user accounts and desktop (GUI) interaction
Only when Local System Account is selected can you also select the Allow service to interact with the desktop option. The “this account” method does not even allow selection of the checkbox (watch carefully, the checkbox is unchecked when you press apply).
Running without GUI does not prevent these types of things happening — they’re just not painted on the screen — so to diagnose issues like these it’s preferable to allow interaction with desktop.
This means running build agents as Local System account.
$ "C:\Program Files\Mozilla Firefox\firefox -install-global-extension 'path\to\extension'"
You can then run Team City Build Agent Service as Local System user and enable desktop interaction.
- [Windows Local System account] The LocalSystem account is a predefined local account used by the service control manager. This account is not recognized by the security subsystem, so you cannot specify its name in a call to the LookupAccountName function. It has extensive privileges on the local computer, and acts as the computer on the network.
- [Firefox command line options] Various command line options are be available to perform advanced, troubleshooting or system administration tasks. Installation into the application directory is possible from the command line, intended to be used by administrators on multi-user systems.
We encountered an interesting problem today. while getting automated acceptance tests running in TeamCity.
Why Rake? :
- Rakefiles (rake‘s version of Makefiles) are completely defined in standard Ruby syntax. No XML files to edit. No quirky Makefile syntax to worry about (is that a tab or a space?)
- Users can specify tasks with prerequisites.
- Rake supports rule patterns to synthesize implicit tasks.
- Flexible FileLists that act like arrays but know about manipulating file names and paths.
- A library of prepackaged tasks to make building rakefiles easier.
What are we using it for?
Our rake file consists of a single task instructing the ruby interpreter to run cucumber with a set of fixtures — simple.
What were the symptoms?
We found that our build would “fail” as soon as we issued the shell command. The rest of the process works as expected — cucumber runs all the test and we get the results logged.
Finally we tracked this down to unexpected behaviour in the TeamCity rake runner.
What was the cause?
The TeamCity rake runner is designed to capture all output from rake, and redirect it to the appropriate TeamCity log.
# Send the message to the default rake output (which is $stderr). def rake_output_message(message) $stderr.puts(message) end
The TeamCity rake runner has overridden this in an attempt to capture these messages. For some reason this implementation sends an error message to TeamCity.
This means that all shell commands fail when running under the TeamCity rake runner.
Why does rake write to $stderr by default?
Don’t know. And the method name is not very evocative: rake_output_message.
Perhaps it’s intended to be overridden.
EDIT, 07-05-2009: All of these issues have been resolved by upgrading to latest version — even the teamcity-deletes-rake-file wrongness.