如何管理可能在x86安装上的部署项引用,或者基于MSTest的项目的x64安装?

时间:2022-05-18 16:34:27

Much related to this question, we have a scenario on my team where we need to copy the contents of a folder for a suite of libraries and configuration files for said libraries to our folder where our test code is running from, as part of the test's deployment step.

与此问题有很大关系,我们的团队中有一个场景,我们需要将所有库的库和配置文件的文件夹内容复制到我们运行测试代码的文件夹中,作为测试的一部分部署步骤。

Due to the installation size, and other factors, checking in this install folder into source control for sharing between team members just isn't viable.

由于安装大小和其他因素,将此安装文件夹签入源代码控制以便在团队成员之间共享是不可行的。

The install path for the folder is either /Program Files/InternalTool/ or /Program Files (x86)/InternalTool/ depending on the installed environment. I want to setup my .testrunconfig file such that when a person gets the latest version of the solution, they don't have to worry about fixups for the path to the shared internal library suite.

该文件夹的安装路径是/ Program Files / InternalTool /或/ Program Files(x86)/ InternalTool /,具体取决于安装的环境。我想设置我的.testrunco​​nfig文件,以便当一个人获得最新版本的解决方案时,他们不必担心共享内部库套件路径的修正。

Is there a way to make this seamless for all members involved, and if so, how could one accomplish this?

有没有办法让所有相关成员都能无缝地进行,如果有的话,怎么能实现这个目标呢?

Restrictions are as follows:

限制如下:

  • can't check in shared suite
  • 无法入住共享套房

  • shared suite has no override for installation path
  • 共享套件没有覆盖安装路径

Is this possible, or am I asking for too much?

这可能吗,还是我要求太多?

2 个解决方案

#1


0  

We handle this sort of issue (our issues are not the same but are similar) by having different config files with different names and copying the correct one over when it is needed.

我们通过使用具有不同名称的不同配置文件并在需要时复制正确的配置文件来处理此类问题(我们的问题不同但是相似)。

In some cases we automate this within the batch job that gets the latest version.

在某些情况下,我们会在获得最新版本的批处理作业中自动执行此操作。

#2


0  

This was actually way, way easier than I expected.

这实际上比我预期的方式更容易。

While the UI doesn't support many things with the local test run config file, I was able to set the path using the standard %ProgramFiles%.

虽然UI不支持本地测试运行配置文件的许多内容,但我能够使用标准%ProgramFiles%设置路径。

  • On x86 systems, this resolves, on most systems, to C:\Program Files\.
  • 在x86系统上,这在大多数系统上解析为C:\ Program Files \。

  • On x64 systems, this resolves, on most systems, to C:\Program Files\.
  • 在x64系统上,这在大多数系统上解析为C:\ Program Files \。

But! If the caller is 32-bit, and not 64-bit or set to MSIL, %ProgramFiles% will resolve to C:\Program Files(x86)\. Since there is no 64-bit mstest, the resolution should happen seamlessly. For an example, this is ripped from my LocalTestRun.testrunconfig file, and then properly sanitized:

但!如果调用者是32位,而不是64位或设置为MSIL,%ProgramFiles%将解析为C:\ Program Files(x86)\。由于没有64位mstest,因此分辨率应无缝进行。例如,这是从我的LocalTestRun.testrunco​​nfig文件中删除,然后正确清理:

  <Deployment>
    <DeploymentItem filename="%ProgramFiles%\InternalSuite\" />
  </Deployment>

While I haven't had the chance to fully test this yet, this should resolve our issue just fine. I have tested this on my 32-bit system, and have found that it resolves right as rain.

虽然我还没有机会对此进行全面测试,但这应该可以解决我们的问题。我已经在我的32位系统上对此进行了测试,并发现它可以像雨一样解决。

Hope this helps someone else!

希望这有助于其他人!

#1


0  

We handle this sort of issue (our issues are not the same but are similar) by having different config files with different names and copying the correct one over when it is needed.

我们通过使用具有不同名称的不同配置文件并在需要时复制正确的配置文件来处理此类问题(我们的问题不同但是相似)。

In some cases we automate this within the batch job that gets the latest version.

在某些情况下,我们会在获得最新版本的批处理作业中自动执行此操作。

#2


0  

This was actually way, way easier than I expected.

这实际上比我预期的方式更容易。

While the UI doesn't support many things with the local test run config file, I was able to set the path using the standard %ProgramFiles%.

虽然UI不支持本地测试运行配置文件的许多内容,但我能够使用标准%ProgramFiles%设置路径。

  • On x86 systems, this resolves, on most systems, to C:\Program Files\.
  • 在x86系统上,这在大多数系统上解析为C:\ Program Files \。

  • On x64 systems, this resolves, on most systems, to C:\Program Files\.
  • 在x64系统上,这在大多数系统上解析为C:\ Program Files \。

But! If the caller is 32-bit, and not 64-bit or set to MSIL, %ProgramFiles% will resolve to C:\Program Files(x86)\. Since there is no 64-bit mstest, the resolution should happen seamlessly. For an example, this is ripped from my LocalTestRun.testrunconfig file, and then properly sanitized:

但!如果调用者是32位,而不是64位或设置为MSIL,%ProgramFiles%将解析为C:\ Program Files(x86)\。由于没有64位mstest,因此分辨率应无缝进行。例如,这是从我的LocalTestRun.testrunco​​nfig文件中删除,然后正确清理:

  <Deployment>
    <DeploymentItem filename="%ProgramFiles%\InternalSuite\" />
  </Deployment>

While I haven't had the chance to fully test this yet, this should resolve our issue just fine. I have tested this on my 32-bit system, and have found that it resolves right as rain.

虽然我还没有机会对此进行全面测试,但这应该可以解决我们的问题。我已经在我的32位系统上对此进行了测试,并发现它可以像雨一样解决。

Hope this helps someone else!

希望这有助于其他人!