public TaskState(RemoteTask task, TaskState parentState, string message = "Internal Error (xunit runner): No status reported", TaskResult result = TaskResult.Inconclusive)
 {
     Task = task;
     Message = message;
     Result = result;
     ParentState = parentState;
 }
        public RemoteTaskWrapper(RemoteTask remoteTask, IRemoteTaskServer server)
        {
            RemoteTask = remoteTask;
            this.server = server;

            result = TaskResult.Inconclusive;
        }
 private static void AssertTaskFinishedCalled(FakeRemoteTaskServer.TaskFinishedParameters taskFinishedCall,
                                              RemoteTask remoteTask, string message, TaskResult result)
 {
     Assert.Equal(remoteTask, taskFinishedCall.RemoteTask);
     Assert.Equal(message, taskFinishedCall.Message);
     Assert.Equal(result, taskFinishedCall.Result);
 }
Exemplo n.º 4
0
 public void Failed(IExample example, Exception exception)
 {
     LastResult = TaskResult.Exception;
     _server.TaskOutput(CurrentTask, "Failed:", TaskOutputType.STDERR);
     _server.TaskOutput(CurrentTask, exception.ToString(), TaskOutputType.STDERR);
     _server.TaskFinished(CurrentTask, exception.ToString(), TaskResult.Exception);
 }
Exemplo n.º 5
0
        /// <summary>
        /// Initializes the <see cref="TaskContext"/>
        /// </summary>
        /// <param name="associatedData"></param>
        public TaskContext(ITask task, object associatedData)
        {
            Task = task;
            Result = new TaskResult();
            AssociatedData = associatedData;

            _progress = 0;
        }
Exemplo n.º 6
0
 internal static TaskResult AddDirectoyByNameToZip(Task task, TaskResult result)
 {
     var zip = (ZipFile)Get(task, 0, result);
     foreach (var value in ((List<object>)Get(task, 1, result)))
     {
         zip.AddDirectoryByName(value.ToString());
     }
     return Next(task, result);
 }
Exemplo n.º 7
0
 public void EndTarget(IObsoleteTask task, string name, IBounceCommand command, TaskResult result) {
     if (logOptions.ReportTargetEnd) {
         if (result == TaskResult.Success) {
             StdOut.WriteLine("{0} target: {1}", command.PastTense, name);
         } else {
             StdErr.WriteLine("failed to {0} target: {1}", command.InfinitiveTense, name);
         }
     }
 }
Exemplo n.º 8
0
 public void EndTask(IObsoleteTask task, IBounceCommand command, TaskResult result) {
     if (logOptions.ReportTaskEnd && task.IsLogged && command.IsLogged) {
         if (result == TaskResult.Success) {
             StdOut.WriteLine("{0} task: {1}", command.PastTense, task);
         } else {
             StdErr.WriteLine("failed to {0} task: {1}", command.InfinitiveTense, task);
         }
     }
 }
Exemplo n.º 9
0
        public StorEvilTaskRunner(IRemoteTaskServer server)
            : base(server)
        {
            Logger.Log("StorEvilTaskRunner constructed");
            server.ClientMessage("TaskRunner starting");
            //_isDebug = server.GetConfiguration().IsInInternalDebug;

            _result = TaskResult.Success;
        }
Exemplo n.º 10
0
	public void TaskCompleted()
	{
		TaskResult result = new TaskResult();
		result.gridPosition = gridPosition;
		result.completionTime = Time.time - creationTime;
		result.TimeoutTime = LifeTime;
		result.completionPercentage = repetitionNr / TotalReps;
		GameManager.Instance.TaskCompleted(result);
	}
        public void ScenarioFailed(Scenario scenario, string successPart, string failedPart, string message)
        {
            Output(successPart + " [" + failedPart + "] -- failed");
            Output("----------");
            Output(message);

            _server.TaskException(_remoteTask, new[] {new TaskException("StorEvil failure", message, ""),});
            Result = TaskResult.Exception;
        }
        public void CouldNotInterpret(Scenario scenario, string line)
        {
            Output("Could not interpret:\r\n" + line);
            var suggestion = new ImplementationHelper().Suggest(line);

            Output("You could try the following:");
            Output(suggestion);

            Result = TaskResult.Skipped;
        }
Exemplo n.º 13
0
 public override void ExecuteRecursive(TaskExecutionNode node)
 {
     try
     {
         _result = ExecuteRecursiveInternal(node).Status;
     }
     catch (Exception ex)
     {
         Logger.Log(ex.ToString());
     }
 }
Exemplo n.º 14
0
        public void TaskFinished(RemoteTask remoteTask, string message, TaskResult result, TimeSpan duration)
        {
            Debug.Assert(result != TaskResult.Inconclusive);

            clientController.TaskFinished(remoteTask);
            if (result == TaskResult.Skipped)
                server.TaskExplain(remoteTask, message);
            if (duration >= TimeSpan.Zero)
                server.TaskDuration(remoteTask, duration);
            server.TaskFinished(remoteTask, message, result);
        }
 public void SetMethodTasks(ICollection<XunitTestMethodTask> value)
 {
     if (value == null || value.Count == 0)
     {
         classResult = TaskResult.Inconclusive;
         methodTasks = new Dictionary<string, XunitTestMethodTask>();
     }
     else
     {
         methodTasks = value.ToDictionary(x => x.ShortName);
     }
 }
Exemplo n.º 16
0
        public override TaskResult Execute(TaskExecutionNode node)
        {
            if (node.RemoteTask is RunScenarioTask)
            {
                var result = ExecuteScenario(node);
                if (result.Status != TaskResult.Success)
                    _result = result.Status;
                return result.Status;
            }

            return TaskResult.Success;
        }
Exemplo n.º 17
0
        public override void ExecuteRecursive(TaskExecutionNode node)
        {
            try
            {
                Logger.Log("ExecuteRecursive");
                Logger.Log(node.RemoteTask.RunnerID);
                _result = ExecuteRecursiveInternal(node).Status;

            }
            catch (Exception ex)
            {
                Logger.Log(ex.ToString());
            }
        }
        // Called when a class failure is encountered (i.e., when a fixture from IUseFixture throws an 
        // exception during construction or System.IDisposable.Dispose)
        // Called after all tests within the class have been started and finished
        public bool ClassFailed(string className, string exceptionType, string message, string stackTrace)
        {
            var methodMessage = string.Format("Class failed in {0}", className);
            foreach (var methodTask in methodTasks.Values)
            {
                server.TaskException(methodTask, new[] { new TaskException(null, methodMessage, null) } ); 
                server.TaskFinished(methodTask, methodMessage, TaskResult.Error);
            }

            server.TaskException(classTask, ExceptionConverter.ConvertExceptions(exceptionType, message, stackTrace, out classFinishMessage));
            classResult = TaskResult.Exception;

            // Let's carry on running tests - I guess if it were a catastrophic error, we could chose to abort
            return true;
        }
Exemplo n.º 19
0
        public void Failed(TaskException[] exceptions, string exceptionMessage, string childMessage = null)
        {
            if (childMessage != null)
            {
                Reset();

                var childExceptions = new[] { new TaskException(null, childMessage, null) };
                foreach (var child in children ?? EmptyList<RemoteTaskWrapper>.InstanceList)
                    child.Error(childExceptions, childMessage);
            }

            if (result == TaskResult.Inconclusive)
            {
                result = TaskResult.Exception;
                message = exceptionMessage;
                server.TaskException(RemoteTask, exceptions);
            }
        }
Exemplo n.º 20
0
        public void Finished(decimal durationInSeconds = 0, bool childTestsFailed = false)
        {
            // Result is based on child tasks
            if (result == TaskResult.Inconclusive)
            {
                result = childTestsFailed ? TaskResult.Exception : TaskResult.Success;
                message = childTestsFailed ? "One or more child tests failed" : string.Empty;
            }

            // Only finish once - so a test can share a test case's task
            if (!finished)
            {
                var duration = TimeSpan.FromSeconds((double) durationInSeconds);
                if (duration >= TimeSpan.Zero)
                    server.TaskDuration(RemoteTask, duration);
                server.TaskFinished(RemoteTask, message, result);
            }
            finished = true;
        }
Exemplo n.º 21
0
        // Merge 2 TaskResults get the worst result.
        // Succeeded -> SucceededWithIssues -> Failed/Canceled/Skipped/Abandoned
        // SucceededWithIssues -> Failed/Canceled/Skipped/Abandoned
        // Failed -> Failed
        // Canceled -> Canceled
        // Skipped -> Skipped
        // Abandoned -> Abandoned
        public static TaskResult MergeTaskResults(TaskResult? currentResult, TaskResult comingResult)
        {
            if (currentResult == null)
            {
                return comingResult;
            }

            // current result is Failed/Canceled/Skip/Abandoned
            if (currentResult >= TaskResult.Failed)
            {
                return currentResult.Value;
            }

            // comming result is bad than current result
            if (comingResult >= currentResult)
            {
                return comingResult;
            }

            return currentResult.Value;
        }
Exemplo n.º 22
0
 public void EndTarget(IObsoleteTask task, string name, IBounceCommand command, TaskResult result) {
     output.WriteLine(TeamCityFormatter.FormatTeamCityMessageWithFields("buildStatus", "status", result == TaskResult.Success? "SUCCESS": "FAILURE"));
     output.WriteLine(TeamCityFormatter.FormatTeamCityMessage("progressFinish", name));
 }
Exemplo n.º 23
0
 public void EndTask(IObsoleteTask task, IBounceCommand command, TaskResult result) {
     output.WriteLine(TeamCityFormatter.FormatTeamCityMessage("progressFinish", task.SmallDescription));
 }
Exemplo n.º 24
0
 internal static TaskResult WriteIntoFile(Task task, TaskResult result)
 {
     File.AppendAllText(Get(task, 0, result).ToString(), Get(task, 1, result).ToString());
     return Next(task, result);
 }
Exemplo n.º 25
0
		private void				ImportState(Interface.Struct.TechniteState state)
		{

			taskParameter = 0;
			lastResources = resources;
			resources = state.resources;
			taskResult = (TaskResult)state.taskResult;
			this.state = new CompressedState(state.state).Decoded;
			transitionState = TransitionState.Preserved;

			if (taskResult == Technite.TaskResult.OperationWindowMissed)
			{
				if (++windowMissedThisRound < MaxLogPerRound)
					Out.Log(Significance.Unusual, "Operation Window Missed on " + nextTask + " of " + this);
			}


			if (taskResult != TaskResult.MoreWorkNeeded)
				nextTask = Task.None;

		}
 /// <summary>
 /// Initializes a new instance of the PickResult class
 /// with the specified Microsoft.Phone.Tasks.TaskResult.
 /// </summary>
 /// <param name="taskResult">Associated Microsoft.Phone.Tasks.TaskResult</param>
 public PickResult(TaskResult taskResult)
     : base(taskResult)
 {
 }
Exemplo n.º 27
0
 /// <summary>
 /// Initializes a new instance of the VideoResult class
 /// with the specified Microsoft.Phone.Tasks.TaskResult.
 /// </summary>
 /// <param name="taskResult">Associated Microsoft.Phone.Tasks.TaskResult</param>
 public VideoResult(TaskResult taskResult)
     : base(taskResult)
 {
 }
Exemplo n.º 28
0
 /// <summary>
 /// Initializes a new instance of the AudioResult class
 /// with the specified Microsoft.Phone.Tasks.TaskResult.
 /// </summary>
 /// <param name="taskResult">Associated Microsoft.Phone.Tasks.TaskResult</param>
 public AudioResult(TaskResult taskResult)
     : base(taskResult)
 {
 }
 /// <summary>
 /// Initializes a new instance of the DateTimeResult class
 /// with the specified Microsoft.Phone.Tasks.TaskResult.
 /// </summary>
 /// <param name="taskResult">Associated Microsoft.Phone.Tasks.TaskResult</param>
 public DateTimeResult(TaskResult taskResult)
     : base(taskResult)
 {
 }
Exemplo n.º 30
0
 internal static TaskResult TaskStop(Task task, TaskResult result)
 {
     Util.Running = false;
     return Next(task, result);
 }