运行 使用 Gauge Framework 的并行执行

Running Parallel Executions with Gauge Framework

我在服务器中托管了一个 C#(不是核心)的仪表测试项目。然后有一个外部工具可以为不同的标签发送 gauge 运行 命令。它几乎同时发送 17 运行 条不同标签的命令。我限制了 10 个调用的并发性,所以只有 10 个通过(有点离题)。但是,对于这 10 个请求,gauge 似乎仍然需要使用 gauge-bin 文件夹,因为我很少收到以下错误:

D:\Program Files (x86)\MSBuild.0\bin\Microsoft.Common.CurrentVersion.targets(1819,5): warning MSB3101: Could not write state file "obj\Any CPU\Debug\TestAutomation.csprojResolveAssemblyReference.cache". The process cannot access the file 'D:\home\site\wwwroot\Gauge\Apps\TestAutomation\obj\Any CPU\Debug\TestAutomation.csprojResolveAssemblyReference.cache' because it is being used by another process. [D:\home\site\wwwroot\Gauge\Apps\TestAutomation\TestAutomation.csproj]

D:\Program Files (x86)\MSBuild.0\bin\Microsoft.Common.CurrentVersion.targets(4411,5): error MSB3491: Could not write lines to file "obj\Any CPU\Debug\TestAutomation.csproj.FileListAbsolute.txt". The process cannot access the file 'D:\home\site\wwwroot\Gauge\Apps\TestAutomation\obj\Any CPU\Debug\TestAutomation.csproj.FileListAbsolute.txt' because it is being used by another process. [D:\home\site\wwwroot\Gauge\Apps\TestAutomation\TestAutomation.csproj]

我知道这些文件位于 obj\Any CPU\Debug。我不知道如何找到解决方法来避免此错误。我的第一个想法是删除 obj 文件夹中的文件,因为此后测试似乎 运行 正常。但是,当我执行测试时,文件仍然生成。

此错误表明有多个 msbuild 进程试图同时构建同一个项目。这会导致 obj 文件夹中的资源冲突。

如果您需要同时 运行 同一个 Gauge 项目,您可以尝试这样的操作吗:

  • 先构建项目(外规)。
  • GAUGE_CUSTOM_BUILD_PATH设置为上面输出文件夹的位置..
  • 运行 gauge run specs

这将使用预构建的二进制文件来执行测试。您可能还会看到 运行 时间有所改善。