Can anyone explain this test failure (only when run via the Teamcity build agent)

I posted my question here first:
http://stackoverflow.com/questions/3226740/troubleshooting-unable-to-verify-file-access-to-the-localapplicationdata-folder

Issue: I've an acceptance test (written in NUnit) which spawns an executable, which it then drives via the White 0.2 library. The executable creates a log file in the LocalAppData folder of the currently logged in user. The acceptance verifies if the log file contains the expected text. However when run via TeamCity, I get a FileNotFoundException with the path to the LocalSystem account's app data folder.

The tests all pass when run via NUnit in my local user's account (or when run via Resharper through the IDE)

3 comments

I would try the following things:
- run agent service under regular user account instead of local system account or
- start agent via agent.bat

0

Thanks for the suggestions.

Option1 is not feasible - since my acceptance tests written in NUnit go through the GUI and need the "Interacts with desktop" permission for the agent service, which AFAIK is only available with the System account.

I'm looking at invoking the agent via the batch file - can I attach directly to the batch file or is there a test runner exe that I need to attach to ? Basically I'd like to step through the code to know why the log file is not being created (and there are no exceptions) when the test is run in the LocalSystem account.

0

Not sure what you mean by attach to bat file. agent.bat will start agent JVM, which in turn will start build in the separate process. So you will be able to attach debugger or any other tool to this process.

0

Please sign in to leave a comment.