コード例 #1
0
        private async Task <TestCaseFinishedArgs> HandleFinished(string containerId)
        {
            var console = containers[containerId].console;

            console.CloseStream();
            var inspect = await dockerClient.Containers.InspectContainerAsync(containerId);

            console.WriteLine("Exit Code: " + inspect.State.ExitCode);

            var args = new TestCaseFinishedArgs
            {
                ExitCode   = (int)inspect.State.ExitCode,
                OutputData = console.cleanLog,
                ErrorData  = inspect.State.ExitCode != 0 ? console.cleanLog : string.Empty,
            };

            var rmParams = new Docker.DotNet.Models.ContainerRemoveParameters
            {
                Force         = true,
                RemoveLinks   = false,
                RemoveVolumes = false,
            };
            await dockerClient.Containers.RemoveContainerAsync(containerId, rmParams);

            containers.Remove(containerId);
            if (inspect.State.ExitCode != 0 && Application.isPlaying)
            {
                SimulatorConsole.Instance.Visible = true;
                SimulatorConsole.Instance.ChangeTab(console);
            }

            return(args);
        }
コード例 #2
0
        void ProcessExited(object sender, System.EventArgs e)
        {
            var proc = (TestCaseProcess)sender;

            UnityEngine.Debug.Log($"[PROC][main] Process #{proc.Id} exited with result {proc.ExitCode}");

            var args = new TestCaseFinishedArgs(proc.ExitCode, proc.GetOutputData(), proc.GetErrorData());

            OnFinished?.Invoke(args);
        }