在启动并运行Orchard CMS之后,检查了我们的Subversion存储库,我一直在查看现有的测试覆盖率,特别是SpecFlow测试。
当我尝试从CodeRush测试运行器或NUnit GUI(v2.5.10)运行测试时,我得到了67个测试的例外:
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
我尝试过以管理员身份执行测试,但我知道SpecFlow的真知识,所以我怀疑我错过了一些关键的东西。
答案 0 :(得分:1)
看起来它正在尝试访问隐藏的Subversion文件夹(.svn),但它们根本无法访问。可能的原因是:
使用内部.svn文件进行混乱可能会造成危险并损坏已签出的存储库文件夹。我不知道SpecFlow是否会在流程中修改这些文件 - 如果没有,那就好了
还有一个解决方案将存储库文件(通过TortoiseSVN导出选项)导出到单独的文件夹(与SVN相关的内容不会被复制),全部执行处理副本,每次你想提交 - 将更改的文件复制回SVN绑定文件夹。