-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: add parameters to cli tool (#31)
* feature: add parameters to cli tool * fix: fix issue with globbing working folder * docs: add basic readme text on package description * ci: add script for local verification, update script docs * docs: add per project readme, trim package docs to basic text * ci: bump minor version
- Loading branch information
1 parent
6efa9ef
commit 8cde737
Showing
26 changed files
with
450 additions
and
94 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
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,48 @@ | ||
## Additional Cli Samples | ||
|
||
|
||
|
||
**File glob pattern relative to current directory** | ||
|
||
```bash | ||
liquid --inputs "File=**/*sample.trx" --output-file report.md | ||
``` | ||
|
||
**File glob pattern using specific directory** | ||
```bash | ||
liquid --inputs "File=**/*sample.trx;Folder=C:\MyTestFolder" --output-file report.md | ||
``` | ||
|
||
**Report from single input, with a custom title** - [Sample Output](./samples/cli/CustomTitle.md) | ||
|
||
``` bash | ||
liquid --inputs "File=xUnit-net461-sample.trx" --output-file CustomTitle.md --title "Test Run 2021" | ||
``` | ||
|
||
**Report from two inputs** - [Sample Output](./samples/cli/TwoInputs.md) | ||
|
||
``` bash | ||
liquid --inputs "File=xUnit-net461-sample.trx" "File=xUnit-netcoreapp3.1-sample.trx" --output-file TwoInputs.md | ||
``` | ||
|
||
**Grouped results** - [Sample Output](./samples/cli/GroupUnitTests.md) | ||
Report with two inputs, and results grouped under the same section "Unit Tests": | ||
|
||
``` bash | ||
liquid --inputs "File=xUnit-net461-sample.trx;GroupTitle=Unit Tests" "File=xUnit-netcoreapp3.1-sample.trx;GroupTitle=Unit Tests" --output-file GroupUnitTests.md | ||
``` | ||
|
||
**Grouped results with test name suffix** - [Sample Output](./samples/cli/GroupAndSuffix.md) | ||
|
||
Report from two inputs, grouped under the same section "Unit Tests", with the tests from `xUnit-netcoreapp3.1-sample.trx` having (3.1) appended to the test names | ||
eg `SampleProject.xUnit.TestServiceTests` becomes `SampleProject.xUnit.TestServiceTests.PassingTest(3.1)` | ||
|
||
``` bash | ||
liquid --inputs "File=xUnit-net461-sample.trx;GroupTitle=Unit Tests" "File=xUnit-netcoreapp3.1-sample.trx;GroupTitle=Unit Tests;TestSuffix=(3.1)" --output-file GroupAndSuffix.md | ||
``` | ||
|
||
**Custom template and parameter**- [Sample Input](./samples/cli/InputTemplate.md) [Sample_Output](./samples/cli/CustomParameters.md) | ||
|
||
```bash | ||
liquid --inputs "File=**/*sample.trx;Format=Trx;RunId=123" --template="InputTemplate.md" --parameters="Environment=UAT;TicketId=abc123" --output-file CustomParameters.md | ||
``` |
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,43 @@ | ||
# Test Run | ||
### Run Summary | ||
|
||
|
||
- Test Environment: UAT | ||
- Ticket Reference: abc123 | ||
- Overall Result: ❌ Fail | ||
- Pass Rate: 33.33% | ||
- Total Tests: 36 | ||
|
||
|
||
--- | ||
|
||
|
||
#### SampleProject.MSTest.dll | ||
|
||
Run Id: 123 | ||
Pass Rate: 33.33% | ||
Tests: 12 | ||
|
||
--- | ||
|
||
|
||
#### SampleProject.NUnit.dll | ||
|
||
Run Id: 123 | ||
Pass Rate: 33.33% | ||
Tests: 12 | ||
|
||
--- | ||
|
||
|
||
#### SampleProject.xUnit.dll | ||
|
||
Run Id: 123 | ||
Pass Rate: 33.33% | ||
Tests: 12 | ||
|
||
--- | ||
|
||
|
||
|
||
[Created using Liquid Test Reports](https://github.com/kurtmkurtm/LiquidTestReports) |
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,43 @@ | ||
{%- assign passed = run.test_run_statistics.passed_count -%} | ||
{%- assign failed = run.test_run_statistics.failed_count -%} | ||
{%- assign skipped = run.test_run_statistics.skipped_count -%} | ||
{%- assign total = run.test_run_statistics.executed_tests_count -%} | ||
{%- assign pass_percentage = passed | divided_by: total | times: 100.0 | round: 2 *-%} | ||
{%- if passed == total -%} | ||
{%- assign overall = '✔️ Pass' *-%} | ||
{%- elsif failed == 0 -%} | ||
{%- assign overall = '⚠️ Indeterminate' *-%} | ||
{%- else -%} | ||
{%- assign overall = '❌ Fail' *-%} | ||
{%- endif -%} | ||
# {{ library.parameters.Title }} | ||
### Run Summary | ||
|
||
|
||
- Test Environment: {{ parameters.Environment }} | ||
- Ticket Reference: {{ parameters.TicketId }} | ||
- Overall Result: {{overall}} | ||
- Pass Rate: {{pass_percentage}}% | ||
- Total Tests: {{total}} | ||
|
||
|
||
--- | ||
|
||
{%- for set in run.result_sets -%} {%- assign groups = set.results | group: 'outcome' *-%} | ||
{%- assign group_total = set.results | size *-%} | ||
{%- assign passed_total = groups.Passed | size *-%} | ||
{%- assign failed_total = groups.Failed | size *-%} | ||
{%- assign skipped_total = groups.Skipped | size *-%} | ||
|
||
#### {{ set.source }} | ||
|
||
Run Id: {{ set.parameters.RunId }} | ||
Pass Rate: {{ passed_total | divide_by_decimal: group_total | times: 100.0 | round: 2 }}% | ||
Tests: {{ set.results | size }} | ||
|
||
--- | ||
|
||
{%- endfor -%} | ||
|
||
|
||
[{{ library.text }}]({{ library.link }}) |
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 |
---|---|---|
@@ -1,11 +1,21 @@ | ||
# Scripts | ||
|
||
### createtrxfiles | ||
|
||
Runs sample project unit tests with NUnit, xUnit, and MSTest to regenerate trx files for use in CLI integration tests | ||
|
||
### createjuitfiles | ||
|
||
Runs sample project unit tests with NUnit, xUnit, and MSTest to regenerate junit files for use in CLI integration tests | ||
|
||
### updateproperties | ||
|
||
Runs sample project unit tests with xUnit to populate sample output for documentation | ||
|
||
### regenerateschema | ||
|
||
Regenerates models from xml schema for JUnit and VSTS | ||
Regenerates models from xml schema for JUnit and VSTS | ||
|
||
### clilocaltest | ||
|
||
Uninstalls local packages and installs specified cli build then runs test, requires manual modification for package version |
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,12 @@ | ||
dotnet tool uninstall LiquidTestReports.Cli -g # remove old version | ||
dotnet tool install --global --add-source ./ LiquidTestReports.Cli --version latest # must be specified for beta eg 1.3.5-beta | ||
|
||
liquid ` | ||
--inputs "File=**/*sample.trx;Folder=../Test/LiquidTestReports.Cli.Tests/TrxTestInput" ` | ||
--output-file report.md | ||
|
||
liquid ` | ||
--inputs "File=**/*sample.trx;Folder=../Test/LiquidTestReports.Cli.Tests/TrxTestInput;Format=Trx;RunId=123" ` | ||
--template "../Test/LiquidTestReports.Cli.Tests/TemplateTestInput/example.md" ` | ||
--parameters "Environment=UAT;TicketId=abc123" ` | ||
--output-file custom.md |
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
Oops, something went wrong.