forked from Heleonix/Heleonix.Build
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Added Hx_HxReport target to generate test reports from TRX test…
… results using the https://heleonix.github.io/docs/Testing/Heleonix.Testing.Reporting/index.html.
- Loading branch information
1 parent
3f192b4
commit 09f51fe
Showing
26 changed files
with
368 additions
and
171 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
|
||
<!-- | ||
Example custom itemtype with particular meta-data required | ||
<xs:element name="MyItem" substitutionGroup="msb:Item"> | ||
<xs:complexType> | ||
<xs:complexContent> | ||
<xs:extension base="msb:SimpleItemType"> | ||
<xs:sequence maxOccurs="1"> | ||
<xs:choice> | ||
<xs:element name="MyMetaData" type="xs:string"/> | ||
</xs:choice> | ||
</xs:sequence> | ||
</xs:extension> | ||
</xs:complexContent> | ||
</xs:complexType> | ||
</xs:element> | ||
Example custom itemtype with NO meta-data | ||
<xs:element name="MySimpleItem" type="msb:SimpleItemType" substitutionGroup="msb:Item"/> | ||
Example custom itemtype with ANY meta-data | ||
<xs:element name="MyFlexibleItem" type="msb:GenericItemType" substitutionGroup="msb:Item"/> | ||
Example custom property that allows string content only | ||
<xs:element name="MySimpleProperty" type="msb:StringPropertyType" substitutionGroup="msb:Property"/> | ||
--> | ||
|
||
<xs:schema xmlns:msb="http://schemas.microsoft.com/developer/msbuild/2003" | ||
elementFormDefault="qualified" | ||
targetNamespace="http://schemas.microsoft.com/developer/msbuild/2003" | ||
xmlns:xs="http://www.w3.org/2001/XMLSchema"> | ||
<xs:element name="Hx_HxReport" type="xs:string"> | ||
<xs:annotation> | ||
<xs:documentation> | ||
Integrates the https://heleonix.github.io/docs/Testing/Heleonix.Testing.Reporting/index.html into the build framework. | ||
</xs:documentation> | ||
</xs:annotation> | ||
</xs:element> | ||
|
||
<xs:element name="Hx_HxReport_ArtifactsDir" type="msb:StringPropertyType" substitutionGroup="msb:Property"> | ||
<xs:annotation> | ||
<xs:documentation>A path to the HxReport artifacts directory. Default is '$Hx_Run_ArtifactsDir/HxReport'</xs:documentation> | ||
</xs:annotation> | ||
</xs:element> | ||
<xs:element name="Hx_HxReport_Formats" type="msb:StringPropertyType" substitutionGroup="msb:Property"> | ||
<xs:annotation> | ||
<xs:documentation>Formats of output reports to generate. Default is 'Html'.</xs:documentation> | ||
</xs:annotation> | ||
</xs:element> | ||
<xs:element name="Hx_HxReport_Merge" type="msb:StringPropertyType" substitutionGroup="msb:Property"> | ||
<xs:annotation> | ||
<xs:documentation> | ||
Defines whether the reports for input files should be merged into a single one | ||
or for every input file should be generated a separate report file. | ||
Default is 'true'.</xs:documentation> | ||
</xs:annotation> | ||
</xs:element> | ||
<xs:element name="Hx_HxReport_Verbosity" type="msb:StringPropertyType" substitutionGroup="msb:Property"> | ||
<xs:annotation> | ||
<xs:documentation> | ||
The verbosity level for loggingn of the report generation process. | ||
Can be 'Critical', 'Debug', 'Error', 'Information', 'None', 'Trace', 'Warning'. | ||
Default is 'Information'. | ||
</xs:documentation> | ||
</xs:annotation> | ||
</xs:element> | ||
|
||
<xs:element name="Hx_HxReport_TestResultFiles" type="msb:SimpleItemType" substitutionGroup="msb:Item"> | ||
<xs:annotation> | ||
<xs:documentation>The test results files. Defaults are '$Hx_Run_ArtifactsDir/*Test/**/*.trx'.</xs:documentation> | ||
</xs:annotation> | ||
</xs:element> | ||
<xs:element name="Hx_HxReport_Style" type="msb:SimpleItemType" substitutionGroup="msb:Item"> | ||
<xs:annotation> | ||
<xs:documentation> | ||
The MSBuild item containing style overrides in its metadata. | ||
The metadata keys are possible styles as described in https://heleonix.github.io/docs/Testing/Heleonix.Testing.Reporting/index.html. | ||
For example: 'color-primary', 'color-secondary' etc. | ||
</xs:documentation> | ||
</xs:annotation> | ||
</xs:element> | ||
<xs:element name="Hx_HxReport_Content" type="msb:SimpleItemType" substitutionGroup="msb:Item"> | ||
<xs:annotation> | ||
<xs:documentation> | ||
The MSBuild item containing content overrides in its metadata. | ||
The metadata keys are possible content overrides as described in https://heleonix.github.io/docs/Testing/Heleonix.Testing.Reporting/index.html. | ||
Metadata keys must have '_' instead of '.' in the content paths to be valid metadata keys. | ||
Underscores are replaced back with dots during the 'Hx_HxReport' target execution. | ||
For example: 'Footer_Text', 'Footer_Url', 'Result_Summary_Title', 'Result_Summary_Owner' etc. | ||
</xs:documentation> | ||
</xs:annotation> | ||
</xs:element> | ||
</xs:schema> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<Hx_HxReport_ArtifactsDir>$(Hx_Run_ArtifactsDir)/HxReport</Hx_HxReport_ArtifactsDir> | ||
</PropertyGroup> | ||
|
||
<Target Name="Hx_HxReport"> | ||
<Message Text="> RUNNING Hx_HxReport ..." Importance="high"/> | ||
|
||
<Hx_NetSetupTool DotnetExe="$(Hx_Sys_DotnetExe)" Name="hxreport"> | ||
<Output TaskParameter="ToolPath" PropertyName="_Hx_HxReport_HxReportExe"/> | ||
</Hx_NetSetupTool> | ||
|
||
<ItemGroup> | ||
<Hx_HxReport_TestResultFiles | ||
Condition="'@(Hx_HxReport_TestResultFiles)' == ''" | ||
Include="$(Hx_Run_ArtifactsDir)/*Test/**/*.trx"/> | ||
</ItemGroup> | ||
<PropertyGroup> | ||
<Hx_HxReport_Formats Condition="'$(Hx_HxReport_Formats)' == ''">Html</Hx_HxReport_Formats> | ||
<Hx_HxReport_Merge Condition="'$(Hx_HxReport_Merge)' == ''">true</Hx_HxReport_Merge> | ||
<Hx_HxReport_Verbosity Condition="'$(Hx_HxReport_Verbosity)' == ''">Information</Hx_HxReport_Verbosity> | ||
</PropertyGroup> | ||
<Hx_MetadataToCmdArgs Condition="'@(Hx_HxReport_Style)' != ''" Item="@(Hx_HxReport_Style)"> | ||
<Output TaskParameter="Result" PropertyName="_Hx_HxReport_StyleArg"/> | ||
</Hx_MetadataToCmdArgs> | ||
<Hx_MetadataToCmdArgs Condition="'@(Hx_HxReport_Content)' != ''" Item="@(Hx_HxReport_Content)" DottedKeys="true"> | ||
<Output TaskParameter="Result" PropertyName="_Hx_HxReport_ContentArg"/> | ||
</Hx_MetadataToCmdArgs> | ||
|
||
<Message Text="> 1/2: Creating the artifacts directory" Importance="high"/> | ||
<RemoveDir Directories="$(Hx_HxReport_ArtifactsDir)"/> | ||
<MakeDir Directories="$(Hx_HxReport_ArtifactsDir)"/> | ||
|
||
<Message Text="> 2/2: Generating report" Importance="high"/> | ||
<PropertyGroup> | ||
<_Hx_HxReport_Arg>--input @(Hx_HxReport_TestResultFiles->'"%(Identity)"', ' ')</_Hx_HxReport_Arg> | ||
<_Hx_HxReport_Arg Condition="'$(Hx_HxReport_Merge)' == 'true'">$(_Hx_HxReport_Arg) --output "$(Hx_HxReport_ArtifactsDir)/Report.ext"</_Hx_HxReport_Arg> | ||
<_Hx_HxReport_Arg Condition="'$(Hx_HxReport_Merge)' != 'true'">$(_Hx_HxReport_Arg) --output "$(Hx_HxReport_ArtifactsDir)"</_Hx_HxReport_Arg> | ||
<_Hx_HxReport_Arg Condition="'$(Hx_HxReport_Merge)' == 'true'">$(_Hx_HxReport_Arg) --merge</_Hx_HxReport_Arg> | ||
<_Hx_HxReport_Arg Condition="'$(_Hx_HxReport_StyleArg)' != ''">$(_Hx_HxReport_Arg) --style $(_Hx_HxReport_StyleArg)</_Hx_HxReport_Arg> | ||
<_Hx_HxReport_Arg Condition="'$(_Hx_HxReport_ContentArg)' != ''">$(_Hx_HxReport_Arg) --content $(_Hx_HxReport_ContentArg)</_Hx_HxReport_Arg> | ||
<_Hx_HxReport_Arg>$(_Hx_HxReport_Arg) --format $(Hx_HxReport_Formats.Replace(';', ' '))</_Hx_HxReport_Arg> | ||
<_Hx_HxReport_Arg>$(_Hx_HxReport_Arg) --verbosity $(Hx_HxReport_Verbosity)</_Hx_HxReport_Arg> | ||
</PropertyGroup> | ||
<Exec Command=""$(_Hx_HxReport_HxReportExe)" $(_Hx_HxReport_Arg)" /> | ||
|
||
<Message Text="> DONE Hx_HxReport" Importance="high"/> | ||
|
||
<OnError ExecuteTargets="Hx_OnError"/> | ||
</Target> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Empty file.
Oops, something went wrong.