public static void EnsureSilverlightPlatformSupport(this IUnitTestLaunch launch, ref IUnitTestRun run, IUnitTestProvider provider, ITaskRunnerHostController hostController) { foreach (var sequence in run.GetRootTasks().ToArray()) { ConvertToSilverlightSequenceIfNecessary(sequence, ref run, launch, provider, hostController); } }
public UnityTaskRunnerHostController(ITaskRunnerHostController innerHostController, IShellLocks shellLocks, IUnityController unityController) { myShellLocks = shellLocks; myInnerHostController = innerHostController; myUnityController = unityController; myStartUnityTask = Task.CompletedTask; }
public UnityTaskRunnerHostController(ITaskRunnerHostController innerHostController, IShellLocks shellLocks, IUnityController unityController, string taskRunnerName) { myShellLocks = shellLocks ?? throw new ArgumentNullException(nameof(shellLocks)); myInnerHostController = innerHostController ?? throw new ArgumentNullException(nameof(innerHostController)); myUnityController = unityController ?? throw new ArgumentNullException(nameof(unityController)); myStartUnityTask = Task.CompletedTask; TaskRunnerName = taskRunnerName ?? throw new ArgumentNullException(nameof(taskRunnerName)); }
public void Run( Lifetime lifetime, ITaskRunnerHostController runController, IUnitTestRun run, IUnitTestLaunch launch, Action continuation) { launch.EnsureSilverlightPlatformSupport(ref run, this.provider, runController); this.strategy = new OutOfProcessUnitTestRunStrategy(SilverlightUnitTestProvider.GetTaskRunnerInfo(launch)); this.strategy.Run(lifetime, runController, run, launch, continuation); }
public void Run(Lifetime lifetime, ITaskRunnerHostController runController, IUnitTestRun run, IUnitTestLaunch launch, Action continuation) { foreach (var project in run.Elements.OfType<Element>().GroupBy(x => x.ProjectFolder)) { var projectFolder = project.Key; foreach (var set in project.GroupBy(x => x.IsE2E)) { KarmaTestRunner.Run(launch, projectFolder, set, set.Key); } } launch.Finished(); }
public void Run(Lifetime lifetime, ITaskRunnerHostController runController, IUnitTestRun run, IUnitTestLaunch launch, Action continuation) { foreach (var project in run.Elements.OfType <Element>().GroupBy(x => x.ProjectFolder)) { var projectFolder = project.Key; foreach (var set in project.GroupBy(x => x.IsE2E)) { KarmaTestRunner.Run(launch, projectFolder, set, set.Key); } } launch.Finished(); }
public Task PrepareForRun(IUnitTestRun run, ITaskRunnerHostController next) { var lifetimeDef = myLifetime.CreateNested(); run.PutData(ourLifetimeDefinitionKey, lifetimeDef); lock (myStartUnitySync) { WrapStartUnityTask(() => PrepareForRunInternal(lifetimeDef.Lifetime, run)); WrapStartUnityTask(() => next.PrepareForRun(run)); return(myStartUnityTask); } }
public static void EnsureSilverlightPlatformSupport(this IUnitTestLaunch launch, UnitTestProviders providers, ITaskRunnerHostController hostController) { var runs = launch.GetRuns(); foreach (var run in runs.Values.Select(r => r.Value).ToArray()) { foreach (var sequence in run.GetRootTasks().ToArray()) { ConvertToSilverlightSequenceIfNecessary(sequence, run, launch, providers, hostController); } } launch.RemoveEmptyRuns(); }
private static void ConvertToSilverlightSequenceIfNecessary(RemoteTaskPacket sequence, IUnitTestRun run, IUnitTestLaunch launch, UnitTestProviders providers, ITaskRunnerHostController hostController) { if (!sequence.IsSilverlightSequence()) { var silverlightProject = sequence.GetSilverlightProject(run); if (silverlightProject != null) { var silverlightRun = launch.GetOrCreateSilverlightRun(silverlightProject.PlatformID, providers, hostController); var provider = providers.GetProvider(SilverlightUnitTestProvider.RunnerId); var silverlightElement = new SilverlightUnitTestElement(provider, silverlightRun.Key.RunStrategy); var remoteTask = new SilverlightUnitTestTask(silverlightProject.PlatformID.Version, silverlightProject.GetXapPath(), silverlightProject.GetDllPath()); var silverlightSequence = new RemoteTaskPacket(remoteTask) { TaskPackets = { sequence } }; run.GetRootTasks().Remove(sequence); silverlightRun.Value.AddTaskSequence(silverlightSequence, silverlightElement, run); } } }
private static void ConvertToSilverlightSequenceIfNecessary(RemoteTaskPacket sequence, ref IUnitTestRun run, IUnitTestLaunch launch, IUnitTestProvider provider, ITaskRunnerHostController hostController) { if (!sequence.IsSilverlightSequence()) { var silverlightProject = sequence.GetSilverlightProject(run); if (silverlightProject != null) { var silverlightRun = launch.GetOrCreateSilverlightRun(silverlightProject.PlatformID, provider, hostController); var silverlightElement = new SilverlightUnitTestElement(new UnitTestElementId(provider, run.Elements.First().Id.PersistentProjectId, Guid.NewGuid().ToString()), silverlightRun.Key.RunStrategy); var remoteTask = new SilverlightUnitTestTask(silverlightProject.PlatformID.Version, silverlightProject.GetXapPath(), silverlightProject.GetDllPath()); var silverlightSequence = new RemoteTaskPacket(remoteTask) { TaskPackets = { sequence } }; run.GetRootTasks().Remove(sequence); silverlightRun.Value.AddTaskSequence(silverlightSequence, silverlightElement, run); run = silverlightRun.Value; } } }
public static void EnsureSilverlightPlatformSupport(this IUnitTestLaunch launch, UnitTestProviders providers, ITaskRunnerHostController hostController) { var runs = launch.GetRuns(); foreach (var run in runs.Values.Select(r => r.Value).ToArray()) { foreach (var sequence in run.GetRootTasks().ToArray()) { if (run.Elements.FirstOrDefault() is SilverlightUnitTestElement) { continue; } IUnitTestRun localRun = run; var provider = providers.GetProvider(SilverlightUnitTestProvider.RunnerId); ConvertToSilverlightSequenceIfNecessary(sequence, ref localRun, launch, provider, hostController); } } launch.RemoveEmptyRuns(); }
public static KeyValuePair<UnitTestRunProperties, UnitTestRun> GetOrCreateSilverlightRun(this IUnitTestLaunch launch, PlatformID silverlightPlatform, IUnitTestProvider provider, ITaskRunnerHostController hostController) { var runs = launch.GetRuns(); var silverlightRun = runs.Values.FirstOrDefault(run => run.Value.GetSilverlightPlatformVersion() == silverlightPlatform.Version); if (silverlightRun.Value == null) { var runtimeEnvironment = new RuntimeEnvironment { PlatformType = PlatformType.x86, PlatformVersion = PlatformVersion.v4_0 }; var run = new UnitTestRun((UnitTestLaunch)launch, runtimeEnvironment); var runStrategy = new OutOfProcessUnitTestRunStrategy(SilverlightUnitTestProvider.GetTaskRunnerInfo(launch)); var runProperties = new UnitTestRunProperties(provider, null, runStrategy, runtimeEnvironment); runProperties.RunController = hostController; silverlightRun = new KeyValuePair<UnitTestRunProperties, UnitTestRun>(runProperties, run); runs.Add(run.ID, silverlightRun); } return silverlightRun; }
public void Cancel(ITaskRunnerHostController runController, IUnitTestRun run) { this.strategy.Cancel(runController, run); }
public Task CleanupAfterRun(IUnitTestRun run, ITaskRunnerHostController next) => next.CleanupAfterRun(run);
public void Abort(ITaskRunnerHostController runController, IUnitTestRun run) { }
public void Abort(ITaskRunnerHostController runController, IUnitTestRun run) { this.strategy.Abort(runController, run); }
private static void ConvertToSilverlightSequenceIfNecessary(RemoteTaskPacket sequence, IUnitTestRun run, IUnitTestLaunch launch, UnitTestProviders providers, ITaskRunnerHostController hostController) { if (!sequence.IsSilverlightSequence()) { var silverlightProject = sequence.GetSilverlightProject(run); if (silverlightProject != null) { var silverlightRun = launch.GetOrCreateSilverlightRun(silverlightProject.PlatformID, providers, hostController); var provider = providers.GetProvider(SilverlightUnitTestProvider.RunnerId); var silverlightElement = new SilverlightUnitTestElement(provider, silverlightRun.Key.RunStrategy); var remoteTask = new SilverlightUnitTestTask(silverlightProject.PlatformID.Version, silverlightProject.GetXapPath(), silverlightProject.GetDllPath()); var silverlightSequence = new RemoteTaskPacket(remoteTask) { TaskPackets = { sequence } }; run.GetRootTasks().Remove(sequence); silverlightRun.Value.AddTaskSequence(silverlightSequence, silverlightElement, run); } } }
public void Cancel(ITaskRunnerHostController runController, IUnitTestRun run) { }
public static KeyValuePair <UnitTestRunProperties, UnitTestRun> GetOrCreateSilverlightRun(this IUnitTestLaunch launch, PlatformID silverlightPlatform, UnitTestProviders providers, ITaskRunnerHostController hostController) { var runs = launch.GetRuns(); var silverlightRun = runs.Values.FirstOrDefault(run => run.Value.GetSilverlightPlatformVersion() == silverlightPlatform.Version); if (silverlightRun.Value == null) { var runtimeEnvironment = new RuntimeEnvironment { PlatformType = PlatformType.x86, PlatformVersion = PlatformVersion.v4_0 }; var run = new UnitTestRun((UnitTestLaunch)launch, runtimeEnvironment); var runStrategy = new OutOfProcessUnitTestRunStrategy(SilverlightUnitTestProvider.GetTaskRunnerInfo(launch)); var unitTestProvider = providers.GetProvider(SilverlightUnitTestProvider.RunnerId); var runProperties = new UnitTestRunProperties(unitTestProvider, null, runStrategy, runtimeEnvironment); runProperties.RunController = hostController; silverlightRun = new KeyValuePair <UnitTestRunProperties, UnitTestRun>(runProperties, run); runs.Add(run.ID, silverlightRun); } return(silverlightRun); }
public void Cancel(ITaskRunnerHostController runController, IUnitTestRun run) { }
public void Abort(ITaskRunnerHostController runController, IUnitTestRun run) { }
public ClientControllerInfo GetClientControllerInfo(IUnitTestRun run, ITaskRunnerHostController next) => null;
public static void EnsureSilverlightPlatformSupport(this IUnitTestLaunch launch, UnitTestProviders providers, ITaskRunnerHostController hostController) { var runs = launch.GetRuns(); foreach (var run in runs.Values.Select(r => r.Value).ToArray()) { foreach (var sequence in run.GetRootTasks().ToArray()) { ConvertToSilverlightSequenceIfNecessary(sequence, run, launch, providers, hostController); } } launch.RemoveEmptyRuns(); }