Quantcast
Channel: Visual Studio Integrate forum
Viewing all articles
Browse latest Browse all 4410

VSX Integration Test Timout on Unattended Build Server

$
0
0

I am having difficulty running VSX integration tests on an unattended build server (namely, the Team Foundation Service). I am using Visual Studio 2012 and TFS 2012. Here is the test Visual Studio Package project template creates out of the box.

[TestClass]
public class PackageTest
{
    [TestMethod]
    [HostType("VS IDE")]
    public void PackageLoadTest()
    {
        UIThreadInvoker.Invoke((Action)delegate
        {
            var shell = (IVsShell)VsIdeTestHostContext.ServiceProvider.GetService(typeof(SVsShell));
            IVsPackage package;
            var packageGuid = new Guid(Package.Id);
            Assert.AreEqual(VSConstants.S_OK, shell.LoadPackage(ref packageGuid, out package));
            Assert.IsNotNull(package);
        });
    }
}

When this test runs on a local development machine for the first time, Visual Studio comes up in experimental hive and waits for you to select a default profile (C#, VB, General, etc). However, when this test runs on an unattended build server, there is no user to choose the profile and the test times out.

As a workaround, I tried adding a test property to force the VS IDE host start devenv with the /ResetSettings option.

[TestMethod]
[HostType("VS IDE")]
[TestProperty("VsHiveFlags", @"/ResetSettings  ""C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Profiles\General.vssettings""")]
public void PackageLoadTest()
{
    // ...
}

This works locally, but still times out on the hosted build server.

Is there a way to run VSX integration tests reliably in unattended mode?

Thanks,
Oleg


Viewing all articles
Browse latest Browse all 4410

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>