2
votes

After getting the Orchard CMS up and running then checked into our Subversion repository, I have been looking at the existing test coverage and specifically the SpecFlow tests.

When I try and run the tests from the CodeRush test runner or from NUnit GUI (v2.5.10) I get exceptions on 67 of the tests:

Orchard.Specs.AdditionFeature.AnonymousUserCanSeeTheHomePageButNotTheDashboard:
System.UnauthorizedAccessException : Access to the path
'C:\Users\richard.slater\AppData\Local\Temp\Orchard.Specs\5dchvodt.b1i\Modules\
Orchard.Packaging\Views\.svn\all-wcprops' is denied.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.File.InternalCopy(String sourceFileName, String destFileName, Boolean overwrite)
at Orchard.Specs.Util.PathExtensions.FileCopy(Path sourcePath, Path targetPath, Path sourceFile) in C:\Project\Damovo.co.uk_NEW\src\Orchard.Specs\Util\PathExtensions.cs:line 51
at Orchard.Specs.Util.PathExtensions.c__DisplayClass1.b__0(Path file) in C:\Project\Damovo.co.uk_NEW\src\Orchard.Specs\Util\PathExtensions.cs:line 22
at Bleroy.FluentPath.PathCollection.ForEach(Action`1 action)
at Orchard.Specs.Util.PathExtensions.DeepCopy(Path sourcePath, Path targetPath) in C:\Project\Damovo.co.uk_NEW\src\Orchard.Specs\Util\PathExtensions.cs:line 20
at Orchard.Specs.Hosting.WebHost.CopyExtension(String extensionFolder, String extensionName, ExtensionDeploymentOptions deploymentOptions) in C:\Project\Damovo.co.uk_NEW\src\Orchard.Specs\Hosting\WebHost.cs:line 202
at Orchard.Specs.Bindings.WebAppHosting.GivenIHaveModule(String moduleName) in C:\Project\Damovo.co.uk_NEW\src\Orchard.Specs\Bindings\WebAppHosting.cs:line 132
at Orchard.Specs.Bindings.WebAppHosting.GivenIHaveACleanSiteWith(String virtualDirectory, Table table) in C:\Project\Damovo.co.uk_NEW\src\Orchard.Specs\Bindings\WebAppHosting.cs:line 161
at Orchard.Specs.Bindings.OrchardSiteFactory.GivenIHaveInstalledOrchard(String virtualDirectory) in C:\Project\Damovo.co.uk_NEW\src\Orchard.Specs\Bindings\OrchardSiteFactory.cs:line 23
at Orchard.Specs.Bindings.OrchardSiteFactory.GivenIHaveInstalledOrchard() in C:\Project\Damovo.co.uk_NEW\src\Orchard.Specs\Bindings\OrchardSiteFactory.cs:line 16
at TechTalk.SpecFlow.Bindings.MethodBinding.InvokeAction(Object[] arguments, ITestTracer testTracer, TimeSpan& duration)
at TechTalk.SpecFlow.TestRunner.ExecuteStepMatch(BindingMatch match, Object[] arguments)
at TechTalk.SpecFlow.TestRunner.ExecuteStep(StepArgs stepArgs)
at TechTalk.SpecFlow.TestRunner.CollectScenarioErrors()
at Orchard.Specs.AdditionFeature.AnonymousUserCanSeeTheHomePageButNotTheDashboard() in c:\Project\Damovo.co.uk_NEW\src\Orchard.Specs\PermissionModel.feature:line 28

I have tried executing the tests as Administrator, however I have know real knowledge of SpecFlow so I suspect I am missing something critical.

1

1 Answers

1
votes

It looks like it's trying to access the hidden Subversion folders (.svn) and they are simply not accessible. Possible reasons are:

  • The user accound, under which you are currently operating doesn't have sufficient access rights (read). Try setting those for the currently logged in user on Security tab on the top-level repository folder Properties' screen - changes should propagate to all lower folders.
  • There is a Subversion client (like TortoiseSVN) running in the background, which has those files opened for reading/writing. This is more likely. Try turning it off (or killing the SVN client process if there is no option to close it) and see what would happen.

Messing with internal .svn files can be dangerous and corrupt your checked-out repository folder. I don't know if SpecFlow modifies those files in the process - if not, that's good

There is also a solution to Export the repository files (via TortoiseSVN Export option) to separate folder (the SVN-related stuff will not be copied), do all work on the copy, and every time you'd like to commit - copy changed files back to the SVN-bound folder.