/// <summary> /// Creates a new instance of the multiple test sandbox wrapper. /// </summary> /// <param name="logger"></param> /// <param name="dockerClient"></param> /// <param name="compilerService"></param> /// <param name="request"></param> public MultipleTestSandboxWrapper(ILogger logger, DockerClient dockerClient, CompilerService compilerService, CompileMultipleTestsSourceRequest request, Types.Compiler compiler) { this._logger = logger; this._dockerClient = dockerClient; this._compilerService = compilerService; this._request = request; this._compiler = compiler; }
public SingleTestSandbox(ILogger logger, DockerClient dockerClient, CompileTestSourceRequest singleTestCreationRequest, Types.Compiler compiler) : base(logger, dockerClient, singleTestCreationRequest, compiler) { this._singleRequest = singleTestCreationRequest; // Raise our completion event when the base is raised. base.CompletedEvent += this.HandleBaseSandboxCompletionEvent; }
/// <summary> /// Creates a new sandbox and performs the compiling process with a supporting test. /// </summary> /// <param name="request">The request that will contain the sandbox details.</param> /// <param name="compiler">The compiler being used for the process.</param> internal async Task HandleSingleCompileTestSandboxRequest(CompileTestSourceRequest request, Types.Compiler compiler) { var sandbox = new SingleTestSandbox(this._logger, this._dockerClient, request, compiler); this.AddSandbox(sandbox); sandbox.StatusChangeEvent += this.OnStatusChangeEvent; sandbox.CompletedEvent += this.OnSingleTestCompileSandboxCompletionEvent; await sandbox.Run(); }
/// <summary> /// Creates multiple sandboxes that will be used to execute multiple test cases. Completing once all /// tests have passed or any single test has failed. /// </summary> /// <param name="request">The request that will contain the compile details.</param> /// <param name="compiler">The compiler being used for the process.</param> internal async Task HandleMultipleCompileTestSandboxRequest(CompileMultipleTestsSourceRequest request, Types.Compiler compiler) { this._logger.LogInformation($"starting multiple test case execution for: " + $"{request.Id}, tests: {request.TestCases.Count}"); var multipleWrapper = new MultipleTestSandboxWrapper(this._logger, this._dockerClient, this, request, compiler); multipleWrapper.CompletedEvent += this.OnMultipleSandboxCompletionEvent; await multipleWrapper.Start(); }