Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test Results Files by Directory #407

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Pickles/.vs/config/applicationhost.config
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@
</site>
<site name="Pickles.BaseDhtmlFiles" id="2">
<application path="/" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" physicalPath="D:\wps\kpi\pickles_plv\src\Pickles\Pickles.BaseDhtmlFiles" /> </application>
<virtualDirectory path="/" physicalPath="C:\Users\aadams\Documents\ADP\pickles\src\Pickles\Pickles.BaseDhtmlFiles" /> </application>
<bindings>
<binding protocol="http" bindingInformation="*:52000:localhost" />
</bindings>
Expand Down
41 changes: 41 additions & 0 deletions src/Pickles/Pickles.CommandLine/Pickles.CommandLine.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,22 @@
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<TargetFrameworkProfile />
<PublishUrl>C:\Users\aadams\Documents\ADP\published_files\pickles\</PublishUrl>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need clickonce code in Pickles

<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
Expand All @@ -41,6 +57,18 @@
<PropertyGroup>
<StartupObject>PicklesDoc.Pickles.CommandLine.Program</StartupObject>
</PropertyGroup>
<PropertyGroup>
<ManifestCertificateThumbprint>58C81F2E680EB86FABDBEE60F94068CFF0846BAC</ManifestCertificateThumbprint>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also don't need this clickonce code in pickles

</PropertyGroup>
<PropertyGroup>
<ManifestKeyFile>Pickles.CommandLine_TemporaryKey.pfx</ManifestKeyFile>
</PropertyGroup>
<PropertyGroup>
<GenerateManifests>true</GenerateManifests>
</PropertyGroup>
<PropertyGroup>
<SignManifests>true</SignManifests>
</PropertyGroup>
<ItemGroup>
<Reference Include="Autofac, Version=4.3.0.0, Culture=neutral, PublicKeyToken=17863af14b0044da, processorArchitecture=MSIL">
<HintPath>..\packages\Autofac.4.3.0\lib\net45\Autofac.dll</HintPath>
Expand Down Expand Up @@ -92,8 +120,21 @@
<None Include="packages.config">
<SubType>Designer</SubType>
</None>
<None Include="Pickles.CommandLine_TemporaryKey.pfx" />
<None Include="Settings.StyleCop" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.5">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4.5 %28x86 and x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down
Binary file not shown.
1 change: 1 addition & 0 deletions src/Pickles/Pickles.CommandLine/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ private static int Main(string[] args)
{
if (Log.IsFatalEnabled)
{
Log.Info(ex.StackTrace);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one I like.

Log.Fatal(ex, "Pickles did not complete successfully");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,13 @@ public XElement Format(ScenarioOutline scenarioOutline, params string[] exampleV
{
if (this.configuration.HasTestResults)
{
TestResult exampleResult = this.results.GetExampleResult(scenarioOutline, exampleValues);
TestResult exampleResult = TestResult.Inconclusive;

try
{
exampleResult = this.results.GetExampleResult(scenarioOutline, exampleValues);
}
catch (Exception) { }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're swallowing an exception without handling it in any way. That's bad.


return this.BuildImageElement(exampleResult);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,14 @@ public class CucumberJsonSingleResultLoader : ISingleResultLoader
{
public SingleTestRunBase Load(FileInfoBase fileInfo)
{
return new CucumberJsonSingleResults(this.ReadResultsFile(fileInfo));
List<Feature> features = this.ReadResultsFile(fileInfo);
if (features == null)
{
Console.WriteLine("There was an issue with the results format for " + fileInfo.Name);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're writing to Console.WriteLine instead of using the Logging infrastructure.

features = new List<Feature>();
}

return new CucumberJsonSingleResults(features);
}

private List<Feature> ReadResultsFile(FileInfoBase testResultsFile)
Expand Down
31 changes: 23 additions & 8 deletions src/Pickles/Pickles/Runner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,23 +97,38 @@ private static void SetResultsForIndividualScenariosUnderFeature(FeatureNode fea

if (scenario != null)
{
featureElement.Result = testResults.GetScenarioResult(scenario);
try {
featureElement.Result = testResults.GetScenarioResult(scenario);
}
catch (Exception e)
{
Log.Error("An exception occured in aligning results with the feature for : " +
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're blindly logging all exceptions but not taking appropriate action. Not good.

featureTreeNode.Feature.Name +
" Message: " + e.Message);
}
continue;
}

var scenarioOutline = featureElement as ScenarioOutline;

if (scenarioOutline != null)
{
foreach (var example in scenarioOutline.Examples.SelectMany(e => e.TableArgument.DataRows))
try
{
example.Result = testResults.GetExampleResult(scenarioOutline, example.Cells.ToArray());
foreach (var example in scenarioOutline.Examples.SelectMany(e => e.TableArgument.DataRows))
{
example.Result = testResults.GetExampleResult(scenarioOutline, example.Cells.ToArray());
}

scenarioOutline.Result =
scenarioOutline.Examples.SelectMany(e => e.TableArgument.DataRows)
.Select(row => row.Result)
.Merge();
} catch (Exception e) {
Log.Error("An exception occured in aligning results with the feature for : " +
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again: you're blindly logging an exception but taking no appropriate action. You should at the very least rethrow the exception. You should also be more selective in which exceptions you catch.

featureTreeNode.Feature.Name +
" Message: " + e.Message);
}

scenarioOutline.Result =
scenarioOutline.Examples.SelectMany(e => e.TableArgument.DataRows)
.Select(row => row.Result)
.Merge();
}
}
}
Expand Down