Beispiel #1
0
 public TestItemFinishedEventArgs(Service service, FinishTestItemRequest request, ITestReporter testReporter, string report)
 {
     Service = service;
     FinishTestItemRequest = request;
     TestReporter          = testReporter;
     Report = report;
 }
Beispiel #2
0
 public StepFinishedEventArgs(IClientService service, FinishTestItemRequest request, ITestReporter testReporter, FeatureContext featureContext, ScenarioContext scenarioContext, ScenarioStepContext stepContext)
     : this(service, request, testReporter)
 {
     FeatureContext  = featureContext;
     ScenarioContext = scenarioContext;
     StepContext     = stepContext;
 }
Beispiel #3
0
        public void AfterScenario()
        {
            if (CurrentScenario != null)
            {
                var request = new FinishTestItemRequest
                {
                    EndTime = DateTime.UtcNow,
                    Status  = Status
                };

                var eventArg = new TestItemFinishedEventArgs(Bridge.Service, request, CurrentScenario);
                if (BeforeScenarioFinished != null)
                {
                    BeforeScenarioFinished(this, eventArg);
                }
                if (!eventArg.Canceled)
                {
                    CurrentScenario.Finish(request);
                    if (AfterScenarioFinished != null)
                    {
                        AfterScenarioFinished(this,
                                              new TestItemFinishedEventArgs(Bridge.Service, request, CurrentScenario));
                    }

                    CurrentScenarioDescription = string.Empty;
                }
            }
        }
        public static void AfterFeature(FeatureContext featureContext)
        {
            lock (LockHelper.GetLock(FeatureInfoEqualityComparer.GetFeatureInfoHashCode(featureContext.FeatureInfo)))
            {
                var currentFeature       = ReportPortalAddin.GetFeatureTestReporter(featureContext);
                var remainingThreadCount = ReportPortalAddin.DecrementFeatureThreadCount(featureContext);

                if (currentFeature != null && currentFeature.FinishTask == null && remainingThreadCount == 0)
                {
                    var request = new FinishTestItemRequest
                    {
                        EndTime = DateTime.UtcNow,
                        Status  = Status.Skipped
                    };

                    var eventArg = new TestItemFinishedEventArgs(Bridge.Service, request, currentFeature);
                    ReportPortalAddin.OnBeforeFeatureFinished(null, eventArg);

                    if (!eventArg.Canceled)
                    {
                        currentFeature.Finish(request);
                        currentFeature.FinishTask.Wait();

                        ReportPortalAddin.OnAfterFeatureFinished(null, new TestItemFinishedEventArgs(Bridge.Service, request, currentFeature));
                    }
                }
            }
        }
Beispiel #5
0
        public void TraceBindingError(BindingException ex)
        {
            if (CurrentScenario != null)
            {
                Status = Status.Failed;

                var request = new FinishTestItemRequest
                {
                    Status  = Status.Failed,
                    EndTime = DateTime.UtcNow.AddMilliseconds(1),
                    Issue   = new Issue
                    {
                        Type    = IssueType.AutomationBug,
                        Comment = ex.Message
                    }
                };

                var errorRequest = new AddLogItemRequest
                {
                    Level = LogLevel.Error,
                    Time  = DateTime.UtcNow.AddMilliseconds(1),
                    Text  = ex.ToString()
                };
                CurrentScenario.Log(errorRequest);

                if (BeforeStepFinished != null)
                {
                    BeforeStepFinished(this, new TestItemFinishedEventArgs(Bridge.Service, request, null));
                }
                if (AfterStepFinished != null)
                {
                    AfterStepFinished(this, new TestItemFinishedEventArgs(Bridge.Service, request, null));
                }
            }
        }
 public void SuiteFinished(TestResult result)
 {
     // finish the last suite in stack
     if (_suiteIds.Count != 0)
     {
         var requestFinishSuite = new FinishTestItemRequest
         {
             EndTime = DateTime.UtcNow,
             Status  = _statusMap[result.ResultState]
         };
         var suiteId  = _suiteIds.Pop();
         var eventArg = new TestItemFinishedEventArgs(Bridge.Service, requestFinishSuite, result, null, suiteId);
         if (BeforeSuiteFinished != null)
         {
             BeforeSuiteFinished(this, eventArg);
         }
         if (!eventArg.Canceled)
         {
             var message = Bridge.Service.FinishTestItem(suiteId, requestFinishSuite).Info;
             if (AfterSuiteFinished != null)
             {
                 AfterSuiteFinished(this, new TestItemFinishedEventArgs(Bridge.Service, requestFinishSuite, result, message, suiteId));
             }
         }
     }
 }
Beispiel #7
0
        private BeforeTestFinishingEventArgs NotifyFinishing(FinishTestItemRequest request)
        {
            var args = new BeforeTestFinishingEventArgs(_service, _configuration, request);

            Notify(() => ReportEventsSource.RaiseBeforeTestFinishing(_reportEventsSource, this, args));
            return(args);
        }
Beispiel #8
0
        public void TraceStepPending(BindingMatch match, object[] arguments)
        {
            if (CurrentStepId != null)
            {
                var request = new FinishTestItemRequest
                {
                    Status  = Status.Failed,
                    EndTime = DateTime.UtcNow,
                    Issue   = new Issue
                    {
                        Type    = IssueType.ToInvestigate,
                        Comment = "Pending"
                    }
                };

                if (BeforeStepFinished != null)
                {
                    BeforeStepFinished(this, new TestItemFinishedEventArgs(Bridge.Service, request));
                }
                var message = Bridge.Service.FinishTestItem(CurrentStepId, request).Info;
                if (AfterStepFinished != null)
                {
                    AfterStepFinished(this, new TestItemFinishedEventArgs(Bridge.Service, request, message));
                }

                CurrentStepId         = null;
                Bridge.Context.TestId = null;
            }
        }
Beispiel #9
0
        public async Task FinishTestWithAttributes()
        {
            var startTestItemRequest = new StartTestItemRequest
            {
                LaunchUuid = _fixture.LaunchUuid,
                Name       = "Test1",
                StartTime  = DateTime.UtcNow,
                Type       = TestItemType.Test
            };

            var test = await Service.TestItem.StartAsync(startTestItemRequest);

            var finishTestRequest = new FinishTestItemRequest
            {
                EndTime    = DateTime.UtcNow,
                Attributes = new List <ItemAttribute> {
                    new ItemAttribute {
                        Value = "v"
                    }
                }
            };

            await Service.TestItem.FinishAsync(test.Uuid, finishTestRequest);

            var getTest = await Service.TestItem.GetAsync(test.Uuid);

            getTest.Attributes.Should().NotBeEmpty();
        }
Beispiel #10
0
        public void TraceStepSkipped()
        {
            if (CurrentStepId != null)
            {
                var request = new FinishTestItemRequest
                {
                    Status  = Status.Skipped,
                    EndTime = DateTime.UtcNow,
                    Issue   = new Issue
                    {
                        Type = IssueType.NoDefect
                    }
                };

                if (BeforeStepFinished != null)
                {
                    BeforeStepFinished(this, new TestItemFinishedEventArgs(Bridge.Service, request));
                }
                var message = Bridge.Service.FinishTestItem(CurrentStepId, request).Info;
                if (AfterStepFinished != null)
                {
                    AfterStepFinished(this, new TestItemFinishedEventArgs(Bridge.Service, request, message));
                }

                CurrentStepId         = null;
                Bridge.Context.TestId = null;
            }
        }
Beispiel #11
0
        public void AfterStep()
        {
            try
            {
                var currentStep = ReportPortalAddin.GetStepTestReporter(this.StepContext);

                var stepFinishRequest = new FinishTestItemRequest
                {
                    EndTime = DateTime.UtcNow
                };

                if (this.ScenarioContext.ScenarioExecutionStatus == ScenarioExecutionStatus.TestError)
                {
                    stepFinishRequest.Status = Status.Failed;
                }

                var eventArg = new StepFinishedEventArgs(_service, stepFinishRequest, currentStep, this.FeatureContext, this.ScenarioContext, this.StepContext);
                ReportPortalAddin.OnBeforeStepFinished(this, eventArg);

                if (!eventArg.Canceled)
                {
                    currentStep.Finish(stepFinishRequest);
                    ReportPortalAddin.RemoveStepTestReporter(this.StepContext, currentStep);
                    ReportPortalAddin.OnAfterStepFinished(this, eventArg);
                }
            }
            catch (Exception exp)
            {
                _traceLogger.Error(exp.ToString());
            }
            finally
            {
                ContextAwareLogHandler.ActiveStepContext = null;
            }
        }
Beispiel #12
0
        public void TraceNoMatchingStepDefinition(StepInstance stepInstance, ProgrammingLanguage targetLanguage, System.Globalization.CultureInfo bindingCulture, List <BindingMatch> matchesWithoutScopeCheck)
        {
            if (CurrentStepId != null)
            {
                var request = new FinishTestItemRequest
                {
                    Status  = Status.Failed,
                    EndTime = DateTime.UtcNow,
                    Issue   = new Issue
                    {
                        Type    = IssueType.AutomationBug,
                        Comment = "No matching step definition."
                    }
                };

                if (BeforeStepFinished != null)
                {
                    BeforeStepFinished(this, new TestItemFinishedEventArgs(Bridge.Service, request));
                }
                var message = Bridge.Service.FinishTestItem(CurrentStepId, request).Info;
                if (AfterStepFinished != null)
                {
                    AfterStepFinished(this, new TestItemFinishedEventArgs(Bridge.Service, request, message));
                }

                CurrentStepId         = null;
                Bridge.Context.TestId = null;
            }
        }
Beispiel #13
0
        public void AfterScenario()
        {
            if (CurrentScenarioId != null)
            {
                var request = new FinishTestItemRequest
                {
                    EndTime = DateTime.UtcNow,
                };

                var eventArg = new TestItemFinishedEventArgs(Bridge.Service, request);
                if (BeforeScenarioFinished != null)
                {
                    BeforeScenarioFinished(this, eventArg);
                }
                if (!eventArg.Canceled)
                {
                    var message = Bridge.Service.FinishTestItem(CurrentScenarioId, request).Info;
                    if (AfterScenarioFinished != null)
                    {
                        AfterScenarioFinished(this, new TestItemFinishedEventArgs(Bridge.Service, request, message));
                    }

                    CurrentScenarioId = null;
                }
            }
        }
Beispiel #14
0
        public static void AfterFeature()
        {
            if (CurrentFeatureId != null)
            {
                var request = new FinishTestItemRequest
                {
                    EndTime = DateTime.UtcNow,
                };

                var eventArg = new TestItemFinishedEventArgs(Bridge.Service, request);
                if (BeforeFeatureFinished != null)
                {
                    BeforeFeatureFinished(null, eventArg);
                }
                if (!eventArg.Canceled)
                {
                    var message = Bridge.Service.FinishTestItem(CurrentFeatureId, request).Info;
                    if (AfterFeatureFinished != null)
                    {
                        AfterFeatureFinished(null, new TestItemFinishedEventArgs(Bridge.Service, request, message));
                    }

                    CurrentFeatureId = null;
                }
            }
        }
Beispiel #15
0
        public static void AfterFeature()
        {
            if (CurrentFeature != null)
            {
                var request = new FinishTestItemRequest
                {
                    EndTime = DateTime.UtcNow,
                    Status  = Status.Skipped
                };

                var eventArg = new TestItemFinishedEventArgs(Bridge.Service, request, CurrentFeature);
                if (BeforeFeatureFinished != null)
                {
                    BeforeFeatureFinished(null, eventArg);
                }
                if (!eventArg.Canceled)
                {
                    CurrentFeature.Finish(request);
                    if (AfterFeatureFinished != null)
                    {
                        AfterFeatureFinished(null,
                                             new TestItemFinishedEventArgs(Bridge.Service, request, CurrentFeature));
                    }
                }
            }
        }
        /// <summary>
        /// Finishes specified test item.
        /// </summary>
        /// <param name="id">ID of specified test item.</param>
        /// <param name="model">Information about representation of test item to finish.</param>
        /// <returns>A message from service.</returns>
        public virtual async Task <Message> FinishTestItemAsync(string id, FinishTestItemRequest model)
        {
            var uri      = BaseUri.Append($"{Project}/item/{id}");
            var body     = ModelSerializer.Serialize <FinishTestItemRequest>(model);
            var response = await _httpClient.PutAsync(uri, new StringContent(body, Encoding.UTF8, "application/json")).ConfigureAwait(false);

            response.VerifySuccessStatusCode();
            return(ModelSerializer.Deserialize <Message>(await response.Content.ReadAsStringAsync().ConfigureAwait(false)));
        }
Beispiel #17
0
        public async Task StartFinishFullTest()
        {
            var attributes = new List <ItemAttribute> {
                new ItemAttribute {
                    Key = "a1", Value = "v1"
                }, new ItemAttribute {
                    Key = "a2", Value = "v2"
                }, new ItemAttribute {
                    Value = "v3"
                }
            };
            var parameters = new List <KeyValuePair <string, string> > {
                new KeyValuePair <string, string>("a1", "v1")
            };
            var startTestItemRequest = new StartTestItemRequest
            {
                LaunchUuid    = _fixture.LaunchUuid,
                Name          = "Test1",
                StartTime     = DateTime.UtcNow,
                Type          = TestItemType.Test,
                Description   = "Desc for test",
                Attributes    = attributes,
                Parameters    = parameters,
                CodeReference = "SomeNamespace.SomeClassname.SomeMethodname"
            };

            var test = await Service.TestItem.StartAsync(startTestItemRequest);

            Assert.NotNull(test.Uuid);

            var getTest = await Service.TestItem.GetAsync(test.Uuid);

            Assert.Null(getTest.ParentId);
            Assert.Equal(startTestItemRequest.Name, getTest.Name);
            Assert.Equal(startTestItemRequest.StartTime, getTest.StartTime);
            Assert.Equal(startTestItemRequest.Type, getTest.Type);
            Assert.Equal(startTestItemRequest.Description, getTest.Description);
            Assert.Equal(parameters, getTest.Parameters);
            Assert.Equal("SomeNamespace.SomeClassname.SomeMethodname", getTest.CodeReference);
            getTest.Attributes.Should().BeEquivalentTo(attributes);

            var finishTestItemRequest = new FinishTestItemRequest
            {
                EndTime = DateTime.UtcNow,
                Status  = Status.Passed
            };

            var message = await Service.TestItem.FinishAsync(test.Uuid, finishTestItemRequest);

            Assert.Contains("successfully", message.Info);

            getTest = await Service.TestItem.GetAsync(test.Uuid);

            Assert.Equal(finishTestItemRequest.Status, getTest.Status);
            Assert.Equal(finishTestItemRequest.EndTime, getTest.EndTime);
        }
        private void DeleteTestReporter(IReadonlyNode <TestReporter> node, Status withStatus)
        {
            var finishTestItemRequest = new FinishTestItemRequest()
            {
                EndTime = DateTime.UtcNow,
                Status  = (Client.Models.Status)withStatus
            };

            node.Value.Finish(finishTestItemRequest);
        }
Beispiel #19
0
        public override async Task <Message> FinishTestItemAsync(string id, FinishTestItemRequest model)
        {
            lock (_finishTestItemCounterLockObj)
            {
                FinishTestItemCounter++;
            }
            await Task.Delay(RequestsDelay);

            return(await Task.FromResult(new Message()));
        }
        public void SuiteFinished(TestResult result)
        {
            var requestFinishSuite = new FinishTestItemRequest
            {
                EndTime = result.EndTime.UtcDateTime,
                Status  = _statusMap[result.Outcome]
            };

            _suiteId.Finish(requestFinishSuite);
        }
Beispiel #21
0
        public async Task StartFinishFullTest()
        {
            var attributes = new List <StartTestItemRequest.Attribute> {
                new StartTestItemRequest.Attribute {
                    Key = "a1", Value = "v1"
                }, new StartTestItemRequest.Attribute {
                    Key = "a2", Value = "v2"
                }
            };
            var parameters = new List <KeyValuePair <string, string> > {
                new KeyValuePair <string, string>("a1", "v1")
            };
            var startTestItemRequest = new StartTestItemRequest
            {
                LaunchUuid  = _fixture.LaunchUuid,
                Name        = "Test1",
                StartTime   = DateTime.UtcNow,
                Type        = TestItemType.Test,
                Description = "Desc for test",
                Attributes  = attributes,
                Parameters  = parameters,
                Tags        = new List <string> {
                    "b", "c"
                }
            };

            var test = await Service.TestItem.StartAsync(startTestItemRequest);

            Assert.NotNull(test.Uuid);

            var getTest = await Service.TestItem.GetAsync(test.Uuid);

            Assert.Null(getTest.ParentId);
            Assert.Equal(startTestItemRequest.Name, getTest.Name);
            Assert.Equal(startTestItemRequest.StartTime, getTest.StartTime);
            Assert.Equal(startTestItemRequest.Type, getTest.Type);
            Assert.Equal(startTestItemRequest.Description, getTest.Description);
            Assert.Equal(parameters, getTest.Parameters);
            Assert.Equal(attributes.Select(a => new { a.Key, a.Value }), getTest.Attributes.Select(a => new { a.Key, a.Value }));

            var finishTestItemRequest = new FinishTestItemRequest
            {
                EndTime = DateTime.UtcNow,
                Status  = Status.Passed
            };

            var message = await Service.TestItem.FinishAsync(test.Uuid, finishTestItemRequest);

            Assert.Contains("successfully", message.Info);

            getTest = await Service.TestItem.GetAsync(test.Uuid);

            Assert.Equal(finishTestItemRequest.Status, getTest.Status);
            Assert.Equal(finishTestItemRequest.EndTime, getTest.EndTime);
        }
Beispiel #22
0
        private void HandleEndScopeCommunicationMessage(EndScopeCommunicationMessage endScopeMessage)
        {
            var finishNestedStepRequest = new FinishTestItemRequest
            {
                EndTime = endScopeMessage.EndTime,
                Status  = _nestedStepStatusMap[endScopeMessage.Status]
            };

            _nestedScopes[endScopeMessage.Id].Finish(finishNestedStepRequest);
            _nestedScopes.Remove(endScopeMessage.Id);
        }
Beispiel #23
0
        public void Finish(FinishTestItemRequest request)
        {
            FinishTask = Task.Run(async() =>
            {
                StartTask.Wait();

                AdditionalTasks.ToList().ForEach(at => at.Wait());

                TestNodes.ToList().ForEach(tn => tn.FinishTask.Wait());

                await _service.FinishTestItemAsync(TestId, request);
            });
        }
Beispiel #24
0
        public override async Task <Message> FinishTestItemAsync(string id, FinishTestItemRequest model)
        {
            lock (_finishTestItemCounterLockObj)
            {
                if (_isFirstTimeFinishTestItem == false)
                {
                    _isFirstTimeFinishTestItem = true;
                    throw new Exception("FinishTestItemAsync first time fails");
                }
            }

            return(await base.FinishTestItemAsync(id, model));
        }
Beispiel #25
0
        private void Events_TestRunComplete(object sender, TestRunCompleteEventArgs e)
        {
            //TODO: apply smarter way to finish suites in real-time tests execution
            //finish suites

            while (_suitesflow.Count != 0)
            {
                var deeperKey = _suitesflow.Keys.OrderBy(s => s.Split('.').Length).Last();

                TraceLogger.Verbose($"Finishing namespace '{deeperKey}'");
                var deeperSuite = _suitesflow[deeperKey];

                var finishSuiteRequest = new FinishTestItemRequest
                {
                    EndTime = DateTime.UtcNow,
                    //TODO: identify correct suite status based on inner nodes
                    Status = Status.Passed
                };

                deeperSuite.Finish(finishSuiteRequest);
                _suitesflow.Remove(deeperKey);
            }

            // finish launch
            var requestFinishLaunch = new FinishLaunchRequest
            {
                EndTime = DateTime.UtcNow
            };

            _launchReporter.Finish(requestFinishLaunch);

            Stopwatch stopwatch = Stopwatch.StartNew();

            Console.Write("Finishing to send results to Report Portal...");

            try
            {
                _launchReporter.Sync();
            }
            catch (Exception exp)
            {
                Console.WriteLine(exp);
                throw;
            }

            stopwatch.Stop();
            Console.WriteLine($" Sync time: {stopwatch.Elapsed}");
        }
        public void TestFinished(TestResult result)
        {
            if (result.Message != null && _testId != null)
            {
                Bridge.Service.AddLogItem(new AddLogItemRequest
                {
                    TestItemId = _testId,
                    Time       = DateTime.UtcNow,
                    Level      = LogLevel.Error,
                    Text       = result.Message + "\n" + result.StackTrace
                });
            }

            var requestUpdateTest = new UpdateTestItemRequest
            {
                Description = result.Description,
                Tags        = (from object tag in result.Test.Categories select tag.ToString()).ToList()
            };

            Bridge.Service.UpdateTestItem(_testId, requestUpdateTest);

            var requestFinishTest = new FinishTestItemRequest
            {
                EndTime = DateTime.UtcNow,
                Status  = _statusMap[result.ResultState]
            };

            var eventArg = new TestItemFinishedEventArgs(Bridge.Service, requestFinishTest, result, null, _testId);

            if (BeforeTestFinished != null)
            {
                BeforeTestFinished(this, eventArg);
            }
            if (!eventArg.Canceled)
            {
                var message = Bridge.Service.FinishTestItem(_testId, requestFinishTest).Info;

                if (AfterTestFinished != null)
                {
                    AfterTestFinished(this, new TestItemFinishedEventArgs(Bridge.Service, requestFinishTest, result, message, _testId));
                }

                _testId = null;
                Bridge.Context.TestId = null;
            }
        }
Beispiel #27
0
        public void TraceError(Exception ex)
        {
            if (CurrentStepId != null)
            {
                var request = new FinishTestItemRequest
                {
                    Status  = Status.Failed,
                    EndTime = DateTime.UtcNow,
                    Issue   = new Issue
                    {
                        Type    = IssueType.ToInvestigate,
                        Comment = ex.Message
                    }
                };

                if (ex.GetType().Name == "IgnoreException")
                {
                    request.Status     = Status.Skipped;
                    request.Issue.Type = IssueType.NoDefect;
                }

                var errorRequest = new AddLogItemRequest
                {
                    TestItemId = CurrentStepId,
                    Level      = LogLevel.Error,
                    Time       = DateTime.UtcNow,
                    Text       = ex.ToString()
                };
                Bridge.Service.AddLogItem(errorRequest);

                if (BeforeStepFinished != null)
                {
                    BeforeStepFinished(this, new TestItemFinishedEventArgs(Bridge.Service, request));
                }
                var message = Bridge.Service.FinishTestItem(CurrentStepId, request).Info;
                if (AfterStepFinished != null)
                {
                    AfterStepFinished(this, new TestItemFinishedEventArgs(Bridge.Service, request, message));
                }

                CurrentStepId         = null;
                Bridge.Context.TestId = null;
            }
        }
Beispiel #28
0
        public void TraceStepDone(BindingMatch match, object[] arguments, TimeSpan duration)
        {
            if (CurrentScenario != null)
            {
                var request = new FinishTestItemRequest
                {
                    Status  = Status.Passed,
                    EndTime = DateTime.UtcNow.AddMilliseconds(1)
                };

                if (BeforeStepFinished != null)
                {
                    BeforeStepFinished(this, new TestItemFinishedEventArgs(Bridge.Service, request, null));
                }
                if (AfterStepFinished != null)
                {
                    AfterStepFinished(this, new TestItemFinishedEventArgs(Bridge.Service, request, null));
                }
            }
        }
Beispiel #29
0
        private void CommandsSource_OnEndLogScopeCommand(Shared.Execution.ILogContext logContext, Shared.Extensibility.Commands.CommandArgs.LogScopeCommandArgs args)
        {
            var logScope = args.LogScope;

            var finishRequest = new FinishTestItemRequest
            {
                EndTime = logScope.EndTime.Value,
                Status  = _nestedStepStatusMap[logScope.Status]
            };

            if (ReportPortalAddin.LogScopes.ContainsKey(logScope.Id))
            {
                ReportPortalAddin.LogScopes[logScope.Id].Finish(finishRequest);
                ReportPortalAddin.LogScopes.TryRemove(logScope.Id, out ITestReporter _);
            }
            else
            {
                _traceLogger.Warn($"Unknown current step context to end log scope with `{logScope.Id}` ID.");
            }
        }
Beispiel #30
0
        public static void AfterFeature(FeatureContext featureContext)
        {
            try
            {
                lock (LockHelper.GetLock(FeatureInfoEqualityComparer.GetFeatureInfoHashCode(featureContext.FeatureInfo)))
                {
                    var currentFeature       = ReportPortalAddin.GetFeatureTestReporter(featureContext);
                    var remainingThreadCount = ReportPortalAddin.DecrementFeatureThreadCount(featureContext);

                    if (currentFeature != null && currentFeature.FinishTask == null && remainingThreadCount == 0)
                    {
                        var request = new FinishTestItemRequest
                        {
                            EndTime = DateTime.UtcNow,
                            Status  = Status.Skipped
                        };

                        var eventArg = new TestItemFinishedEventArgs(_service, request, currentFeature, featureContext, null);
                        ReportPortalAddin.OnBeforeFeatureFinished(null, eventArg);

                        if (!eventArg.Canceled)
                        {
                            currentFeature.Finish(request);

                            ReportPortalAddin.OnAfterFeatureFinished(null, new TestItemFinishedEventArgs(_service, request, currentFeature, featureContext, null));
                        }

                        ReportPortalAddin.RemoveFeatureTestReporter(featureContext, currentFeature);
                    }
                }
            }
            catch (Exception exp)
            {
                _traceLogger.Error(exp.ToString());
            }
            finally
            {
                ContextAwareLogHandler.ActiveFeatureContext = null;
            }
        }