-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Save test results in junit format and add test reporter action (#49)
* Break tests into different tasks and upload tests results Signed-off-by: Raul Sanchez-Mateos <[email protected]> * Use PR branches for testing Signed-off-by: Raul Sanchez-Mateos <[email protected]> * Fix linux path and windows packages string Signed-off-by: Raul Sanchez-Mateos <[email protected]> * Test ubuntu action Signed-off-by: Raul Sanchez-Mateos <[email protected]> * Add test results path as action output Signed-off-by: Raul Sanchez-Mateos <[email protected]> * Add test-reporter as external action Signed-off-by: Raul Sanchez-Mateos <[email protected]> * Document new test-reporter external action Signed-off-by: Raul Sanchez-Mateos <[email protected]> * Reorder actions in readme Signed-off-by: Raul Sanchez-Mateos <[email protected]> * Update actions branch to main Signed-off-by: Raul Sanchez-Mateos <[email protected]> --------- Signed-off-by: Raul Sanchez-Mateos <[email protected]>
- Loading branch information
1 parent
65e4129
commit 27c98f2
Showing
9 changed files
with
315 additions
and
19 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,157 @@ | ||
name: 'test-reporter' | ||
description: 'https://github.com/dorny/test-reporter' | ||
|
||
inputs: | ||
artifact: | ||
description: > | ||
Name or regex of artifact containing test results. | ||
Regular expression must be enclosed in '/'. | ||
Values from captured groups will replace occurrences of $N in report name. | ||
Example: | ||
artifact: /test-results-(.*)/ | ||
name: 'Test report $1' | ||
-> Artifact 'test-result-ubuntu' would create report 'Test report ubuntu' | ||
required: false | ||
default: '' | ||
|
||
name: | ||
description: > | ||
Name of the Check Run which will be created | ||
required: false | ||
default: '' | ||
|
||
path: | ||
description: > | ||
Comma-separated list of paths to test results | ||
Supports wildcards via [fast-glob](https://github.com/mrmlnc/fast-glob) | ||
All matched result files must be of the same format | ||
required: false | ||
default: '' | ||
|
||
path-replace-backslashes: | ||
description: > | ||
The fast-glob library that is internally used interprets backslashes as escape characters. | ||
If enabled, all backslashes in provided path will be replaced by forward slashes and act as directory separators. | ||
It might be useful when path input variable is composed dynamically from existing directory paths on Windows. | ||
required: false | ||
default: 'false' | ||
|
||
reporter: | ||
description: > | ||
Format of test results. Supported options: | ||
dart-json | ||
dotnet-trx | ||
flutter-json | ||
java-junit (default) | ||
jest-junit | ||
mocha-json | ||
required: false | ||
default: 'java-junit' | ||
|
||
only-summary: | ||
description: > | ||
Allows you to generate only the summary. | ||
If enabled, the report will contain a table listing each test results file and the number of passed, failed, and skipped tests. | ||
Detailed listing of test suites and test cases will be skipped. | ||
required: false | ||
default: 'false' | ||
|
||
list-suites: | ||
description: > | ||
Limits which test suites are listed: | ||
all | ||
failed | ||
required: false | ||
default: 'all' | ||
|
||
list-tests: | ||
description: > | ||
Limits which test cases are listed: | ||
all | ||
failed | ||
none | ||
required: false | ||
default: 'all' | ||
|
||
max-annotations: | ||
description: > | ||
Limits number of created annotations with error message and stack trace captured during test execution. | ||
Must be less or equal to 50. | ||
required: false | ||
default: '10' | ||
|
||
fail-on-error: | ||
description: > | ||
Set action as failed if test report contains any failed test | ||
required: false | ||
default: 'true' | ||
|
||
fail-on-empty: | ||
description: > | ||
Set this action as failed if no test results were found | ||
required: false | ||
default: 'true' | ||
|
||
working-directory: | ||
description: > | ||
Relative path under $GITHUB_WORKSPACE where the repository was checked out. | ||
required: false | ||
default: '' | ||
|
||
token: | ||
description: > | ||
Personal access token used to interact with Github API | ||
Default: github.token | ||
required: false | ||
default: ${{ github.token }} | ||
|
||
outputs: | ||
conclusion: | ||
description: "Success or failure" | ||
value: ${{ steps.generate_test_report.outputs.conclusion }} | ||
|
||
passed: | ||
description: "Count of passed tests" | ||
value: ${{ steps.generate_test_report.outputs.passed }} | ||
|
||
failed: | ||
description: "Count of failed tests" | ||
value: ${{ steps.generate_test_report.outputs.failed }} | ||
|
||
skipped: | ||
description: "Count of skipped tests" | ||
value: ${{ steps.generate_test_report.outputs.skipped }} | ||
|
||
time: | ||
description: "Test execution time [ms]" | ||
value: ${{ steps.generate_test_report.outputs.time }} | ||
|
||
url: | ||
description: "Check run URL" | ||
value: ${{ steps.generate_test_report.outputs.url }} | ||
|
||
url_html: | ||
description: "Check run URL HTML" | ||
value: ${{ steps.generate_test_report.outputs.url_html }} | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
|
||
- name: Generate Test Report | ||
id: generate_test_report | ||
uses: dorny/test-reporter@v1 | ||
with: | ||
artifact: ${{ inputs.artifact }} | ||
name: ${{ inputs.name }} | ||
path: ${{ inputs.path }} | ||
path-replace-backslashes: ${{ inputs.path-replace-backslashes }} | ||
reporter: ${{ inputs.reporter }} | ||
only-summary: ${{ inputs.only-summary }} | ||
list-suites: ${{ inputs.list-suites }} | ||
list-tests: ${{ inputs.list-tests }} | ||
max-annotations: ${{ inputs.max-annotations }} | ||
fail-on-error: ${{ inputs.fail-on-error }} | ||
fail-on-empty: ${{ inputs.fail-on-empty }} | ||
working-directory: ${{ inputs.working-directory }} | ||
token: ${{ inputs.token }} |
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
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.