Skip to content

Skipped tests are marked as successful in junit output #9

@williamdenton

Description

@williamdenton

This block of code needs to handle the skipped case and emit a skipped element. Currently anything not Failed is considered successful.

private static XElement CreateTestCaseElement(TestResultInfo result)
{
var element = new XElement("testcase",
new XAttribute("classname", result.Type),
new XAttribute("name", result.Name),
new XAttribute("time", result.Time.TotalSeconds.ToString("N7", CultureInfo.InvariantCulture)));
if (result.Outcome == TestOutcome.Failed)
{
var failure = new XElement("error");
failure.SetAttributeValue("message", RemoveInvalidXmlChar(result.ErrorMessage));
failure.Value = RemoveInvalidXmlChar(result.ErrorStackTrace);
element.Add(failure);
}
return element;
}

some speculative code that might fix this:

     if (result.Outcome == TestOutcome.Skipped) 
     { 
         var skipped = new XElement("skipped");   
         element.Add(skipped); 
     } 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions