Invalid tag structure message when running custom nunit and specflow report generation on team city
build result shows: Tests failed: 1 (1 new), passed: 46 Invalid tag structure: ["task"; "target"; "target"].
We are using FAKE to run specflow tests in the following way ...targeting SpecFlowTests:
r "System.Xml.Linq"
r "FAKE\Nuget.Core.dll"
r "FAKE\FakeLib.dll"
load "./AcceptanceTestHelper.fsx"
open NuGet open Fake open System open System.IO open AcceptanceTestHelper
let nugetVersion = environVar "nuget_version" let timeOut = System.TimeSpan.FromMinutes 45. let workingDirectory = currentDirectory @@ "AcceptanceTestsSpecFlow." + nugetVersion @@ "Content" let acceptanceTestOutput = workingDirectory @@ "TestResult-acceptance.xml" let specflowExecutionReport = workingDirectory @@ "SpecFlowExecutionReport.html" let clientCode = environVar "client_code" let acceptanceTestProject = workingDirectory @@ "FifteenBelow.AcceptanceTests.Features.csproj"
Target "GetSpecFlowAcceptanceTests" (fun _ -> GetSpecFlowAcceptanceTests nugetVersion )
Target "SpecFlowTests" (fun _ ->
try
RunSpecFlowTests clientCode acceptanceTestOutput workingDirectory
with
| _ -> ()
PublishSpecFlowTests acceptanceTestOutput specflowExecutionReport acceptanceTestProject workingDirectory
)
Target "Default" DoNothing
"GetSpecFlowAcceptanceTests"
==> "SpecFlowTests"
==> "Default"
RunParameterTargetOrDefault "target" "Default"
AcceptanceTestHelper snippet:
let RunSpecFlowTests clientCode acceptanceTestOutput workingDirectory =
!+ (sprintf @"*__.Features.dll")
|> Scan
|> NUnit (fun defaults -> { defaults with
IncludeCategory = clientCode
ToolPath = workingDirectory @@ "build" @@ "Tools" @@ "NUnit" @@ "net-2.0"
DisableShadowCopy = true
ShowLabels = true
TimeOut = TimeSpan.FromMinutes 60.
OutputFile = acceptanceTestOutput
})
let PublishSpecFlowTests acceptanceTestOutputXmlPath specflowExecutionReportPath acceptanceTestProjectPath workingDirectory =
DeleteFile specflowExecutionReportPath
let testFiles = !! (sprintf "%s/*acceptance.xml" workingDirectory)
testFiles |> Log "Found test result file: "
let timeOut = TimeSpan.FromMinutes 5.
ExecProcess (fun info ->
info.FileName <- workingDirectory @@ "build" @@ "Tools" @@ "SpecFlow" @@ "SpecFlow.exe"
info.WorkingDirectory <- workingDirectory
info.Arguments <- "nunitexecutionreport " + acceptanceTestProjectPath + " /xmlTestResult:" + acceptanceTestOutputXmlPath + " /out:" + specflowExecutionReportPath) timeOut
|> ignore
PublishArticfact ((specflowExecutionReportPath) + " => Results")
I assume this runs on local build and you can't give the sources?!
What do you need from me?. We are running this via our team city server. The whole process runs fine except that team city has picked up the fact that an exception has occurred and displays this on the team city result line.
Mhm. The problem is I have absolutly no idea how to reproduce this.
Can you try to create a mini repro sample?
okay will try to recreate locally
See mail