Skip to content

Commit

Permalink
WIP: Fix: XUnit failed, if multiple TestResults.xml were used (#336)
Browse files Browse the repository at this point in the history
* Fix: XUnit failed, if multiple TestResults.xml were used

* Add new results with examples, which contain Regexes

* Add unit tests for XUnit2 examples with regular expression as example.

* Fix failing tests

* Add Tests for NUnit and XUnit for Regexes as Example values

* Add Tests for MSTest for Regexes as Example values

* Add Tests for Cucumber and CucumberJS for Regexes as Example values

* Add Tests for SpecRun for Regexes as Example values

* Add Tests for NUnit3 for Regexes as Example values

* Deliberately breaking the CI build by adding the TestFramework-UnitTests to build.fsx and test.fsx

* Added missing method in StandardTestSuiteForScenarioOutlines.cs but deliberately failing it for trying to break the CI build

* Fix the failing test
  • Loading branch information
magicmonty authored and dirkrombauts committed May 9, 2016
1 parent fdcc5ca commit 68af1eb
Show file tree
Hide file tree
Showing 27 changed files with 1,405 additions and 150 deletions.
7 changes: 7 additions & 0 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ Target "BuildTest" (fun _ ->
|> Log "AppBuild-Output: "
)

Target "BuildTest.TestFrameworks" (fun _ ->
!! "src/Pickles/Pickles.TestFrameworks.UnitTests/Pickles.TestFrameworks.UnitTests.csproj"
|> MSBuildRelease testDir "Build"
|> Log "AppBuild-Output: "
)

let createZip (packageType : string) =
!! (buildDir + "/" + packageType + "/*.*") -- "*.zip"
|> Zip (buildDir + packageType) (deployDir + "Pickles-" + packageType + "-" + version + ".zip")
Expand All @@ -87,6 +93,7 @@ Target "Default" (fun _ ->
==> "BuildPowerShell"
==> "BuildGui"
==> "BuildTest"
==> "BuildTest.TestFrameworks"
==> "Zip"
==> "Default"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
// </copyright>
// --------------------------------------------------------------------------------------------------------------------

using System;

using NUnit.Framework;

Expand Down Expand Up @@ -57,5 +56,11 @@ public WhenParsingCucumberJsonFromJSResultsFileWithIndividualResults()
{
base.ThenCanReadIndividualResultsFromScenarioOutline_MultipleExampleSections_ShouldBeTestResultFailed();
}

[Test]
public new void ThenCanReadExamplesWithRegexValuesFromScenarioOutline_ShouldBeTestResultPassed()
{
base.ThenCanReadExamplesWithRegexValuesFromScenarioOutline_ShouldBeTestResultPassed();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
// </copyright>
// --------------------------------------------------------------------------------------------------------------------

using System;

using NUnit.Framework;

Expand Down Expand Up @@ -57,5 +56,11 @@ public WhenParsingCucumberJsonFromRubyResultsFileWithIndividualResults()
{
base.ThenCanReadIndividualResultsFromScenarioOutline_MultipleExampleSections_ShouldBeTestResultFailed();
}

[Test]
public new void ThenCanReadExamplesWithRegexValuesFromScenarioOutline_ShouldBeTestResultPassed()
{
base.ThenCanReadExamplesWithRegexValuesFromScenarioOutline_ShouldBeTestResultPassed();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1496,6 +1496,328 @@
}
}
]
},
{
"name": "This scenario contains examples with Regex-special characters",
"id": "Scenarios-With-Special-Characters;this-scenario-contains-examples-with-regex-special-characters",
"line": 27,
"keyword": "Scenario",
"description": "",
"type": "scenario",
"steps": [
{
"name": "the calculator has clean memory",
"line": 5,
"keyword": "Given ",
"result": {
"status": "passed",
"duration": 79258
},
"match": {
"location": "D:\\Work\\pickles-testresults\\TestHarness\\CucumberJS\\features\\stepdefinitions\\AdditionSteps.js:10"
}
},
{
"name": "I have special characters for regexes in the value, for example a '**'",
"line": 22,
"keyword": "When ",
"result": {
"status": "passed",
"duration": 80969
},
"match": {
"location": "D:\\Work\\pickles-testresults\\TestHarness\\CucumberJS\\features\\stepdefinitions\\ScenarioOutlineSteps.js:32"
}
},
{
"name": "the scenario will 'pass_1'",
"line": 23,
"keyword": "Then ",
"result": {
"status": "passed",
"duration": 56450
},
"match": {
"location": "D:\\Work\\pickles-testresults\\TestHarness\\CucumberJS\\features\\stepdefinitions\\ScenarioOutlineSteps.js:7"
}
}
]
},
{
"name": "This scenario contains examples with Regex-special characters",
"id": "Scenarios-With-Special-Characters;this-scenario-contains-examples-with-regex-special-characters",
"line": 28,
"keyword": "Scenario",
"description": "",
"type": "scenario",
"steps": [
{
"name": "the calculator has clean memory",
"line": 5,
"keyword": "Given ",
"result": {
"status": "passed",
"duration": 197574
},
"match": {
"location": "D:\\Work\\pickles-testresults\\TestHarness\\CucumberJS\\features\\stepdefinitions\\AdditionSteps.js:10"
}
},
{
"name": "I have special characters for regexes in the value, for example a '++'",
"line": 22,
"keyword": "When ",
"result": {
"status": "passed",
"duration": 62436
},
"match": {
"location": "D:\\Work\\pickles-testresults\\TestHarness\\CucumberJS\\features\\stepdefinitions\\ScenarioOutlineSteps.js:32"
}
},
{
"name": "the scenario will 'pass_1'",
"line": 23,
"keyword": "Then ",
"result": {
"status": "passed",
"duration": 55595
},
"match": {
"location": "D:\\Work\\pickles-testresults\\TestHarness\\CucumberJS\\features\\stepdefinitions\\ScenarioOutlineSteps.js:7"
}
}
]
},
{
"name": "This scenario contains examples with Regex-special characters",
"id": "Scenarios-With-Special-Characters;this-scenario-contains-examples-with-regex-special-characters",
"line": 29,
"keyword": "Scenario",
"description": "",
"type": "scenario",
"steps": [
{
"name": "the calculator has clean memory",
"line": 5,
"keyword": "Given ",
"result": {
"status": "passed",
"duration": 84674
},
"match": {
"location": "D:\\Work\\pickles-testresults\\TestHarness\\CucumberJS\\features\\stepdefinitions\\AdditionSteps.js:10"
}
},
{
"name": "I have special characters for regexes in the value, for example a '.*'",
"line": 22,
"keyword": "When ",
"result": {
"status": "passed",
"duration": 61011
},
"match": {
"location": "D:\\Work\\pickles-testresults\\TestHarness\\CucumberJS\\features\\stepdefinitions\\ScenarioOutlineSteps.js:32"
}
},
{
"name": "the scenario will 'pass_1'",
"line": 23,
"keyword": "Then ",
"result": {
"status": "passed",
"duration": 66713
},
"match": {
"location": "D:\\Work\\pickles-testresults\\TestHarness\\CucumberJS\\features\\stepdefinitions\\ScenarioOutlineSteps.js:7"
}
}
]
},
{
"name": "This scenario contains examples with Regex-special characters",
"id": "Scenarios-With-Special-Characters;this-scenario-contains-examples-with-regex-special-characters",
"line": 30,
"keyword": "Scenario",
"description": "",
"type": "scenario",
"steps": [
{
"name": "the calculator has clean memory",
"line": 5,
"keyword": "Given ",
"result": {
"status": "passed",
"duration": 69849
},
"match": {
"location": "D:\\Work\\pickles-testresults\\TestHarness\\CucumberJS\\features\\stepdefinitions\\AdditionSteps.js:10"
}
},
{
"name": "I have special characters for regexes in the value, for example a '[]'",
"line": 22,
"keyword": "When ",
"result": {
"status": "passed",
"duration": 51318
},
"match": {
"location": "D:\\Work\\pickles-testresults\\TestHarness\\CucumberJS\\features\\stepdefinitions\\ScenarioOutlineSteps.js:32"
}
},
{
"name": "the scenario will 'pass_1'",
"line": 23,
"keyword": "Then ",
"result": {
"status": "passed",
"duration": 65573
},
"match": {
"location": "D:\\Work\\pickles-testresults\\TestHarness\\CucumberJS\\features\\stepdefinitions\\ScenarioOutlineSteps.js:7"
}
}
]
},
{
"name": "This scenario contains examples with Regex-special characters",
"id": "Scenarios-With-Special-Characters;this-scenario-contains-examples-with-regex-special-characters",
"line": 31,
"keyword": "Scenario",
"description": "",
"type": "scenario",
"steps": [
{
"name": "the calculator has clean memory",
"line": 5,
"keyword": "Given ",
"result": {
"status": "passed",
"duration": 66429
},
"match": {
"location": "D:\\Work\\pickles-testresults\\TestHarness\\CucumberJS\\features\\stepdefinitions\\AdditionSteps.js:10"
}
},
{
"name": "I have special characters for regexes in the value, for example a '{}'",
"line": 22,
"keyword": "When ",
"result": {
"status": "passed",
"duration": 51888
},
"match": {
"location": "D:\\Work\\pickles-testresults\\TestHarness\\CucumberJS\\features\\stepdefinitions\\ScenarioOutlineSteps.js:32"
}
},
{
"name": "the scenario will 'pass_1'",
"line": 23,
"keyword": "Then ",
"result": {
"status": "passed",
"duration": 75266
},
"match": {
"location": "D:\\Work\\pickles-testresults\\TestHarness\\CucumberJS\\features\\stepdefinitions\\ScenarioOutlineSteps.js:7"
}
}
]
},
{
"name": "This scenario contains examples with Regex-special characters",
"id": "Scenarios-With-Special-Characters;this-scenario-contains-examples-with-regex-special-characters",
"line": 32,
"keyword": "Scenario",
"description": "",
"type": "scenario",
"steps": [
{
"name": "the calculator has clean memory",
"line": 5,
"keyword": "Given ",
"result": {
"status": "passed",
"duration": 65003
},
"match": {
"location": "D:\\Work\\pickles-testresults\\TestHarness\\CucumberJS\\features\\stepdefinitions\\AdditionSteps.js:10"
}
},
{
"name": "I have special characters for regexes in the value, for example a '()'",
"line": 22,
"keyword": "When ",
"result": {
"status": "passed",
"duration": 139414
},
"match": {
"location": "D:\\Work\\pickles-testresults\\TestHarness\\CucumberJS\\features\\stepdefinitions\\ScenarioOutlineSteps.js:32"
}
},
{
"name": "the scenario will 'pass_1'",
"line": 23,
"keyword": "Then ",
"result": {
"status": "passed",
"duration": 213540
},
"match": {
"location": "D:\\Work\\pickles-testresults\\TestHarness\\CucumberJS\\features\\stepdefinitions\\ScenarioOutlineSteps.js:7"
}
}
]
},
{
"name": "This scenario contains examples with Regex-special characters",
"id": "Scenarios-With-Special-Characters;this-scenario-contains-examples-with-regex-special-characters",
"line": 33,
"keyword": "Scenario",
"description": "",
"type": "scenario",
"steps": [
{
"name": "the calculator has clean memory",
"line": 5,
"keyword": "Given ",
"result": {
"status": "passed",
"duration": 310474
},
"match": {
"location": "D:\\Work\\pickles-testresults\\TestHarness\\CucumberJS\\features\\stepdefinitions\\AdditionSteps.js:10"
}
},
{
"name": "I have special characters for regexes in the value, for example a '^.*(?<foo>BAR)\\s[^0-9]{3,4}A+$'",
"line": 22,
"keyword": "When ",
"result": {
"status": "passed",
"duration": 74982
},
"match": {
"location": "D:\\Work\\pickles-testresults\\TestHarness\\CucumberJS\\features\\stepdefinitions\\ScenarioOutlineSteps.js:32"
}
},
{
"name": "the scenario will 'pass_1'",
"line": 23,
"keyword": "Then ",
"result": {
"status": "passed",
"duration": 56165
},
"match": {
"location": "D:\\Work\\pickles-testresults\\TestHarness\\CucumberJS\\features\\stepdefinitions\\ScenarioOutlineSteps.js:7"
}
}
]
}
]
}
Expand Down
Loading

0 comments on commit 68af1eb

Please sign in to comment.