mirror of
https://github.com/dorny/test-reporter.git
synced 2025-12-17 06:47:09 +01:00
Merge pull request #1 from cviddy/notick-addShowHTMLURLInput
Notick | Add show html output as an input
This commit is contained in:
commit
8d5df2711e
6 changed files with 101 additions and 6781 deletions
1
.github/workflows/test-report.yml
vendored
1
.github/workflows/test-report.yml
vendored
|
|
@ -18,3 +18,4 @@ jobs:
|
||||||
name: Workflow Report
|
name: Workflow Report
|
||||||
path: '*.xml'
|
path: '*.xml'
|
||||||
reporter: jest-junit
|
reporter: jest-junit
|
||||||
|
show-html-notice: true
|
||||||
|
|
|
||||||
|
|
@ -60,6 +60,10 @@ inputs:
|
||||||
working-directory:
|
working-directory:
|
||||||
description: Relative path under $GITHUB_WORKSPACE where the repository was checked out
|
description: Relative path under $GITHUB_WORKSPACE where the repository was checked out
|
||||||
required: false
|
required: false
|
||||||
|
show-html-notice:
|
||||||
|
description: Show the link to the html results in the form of a notice on the summary page. This was created to combat a GHA bug of not always displaying the results in the right action.
|
||||||
|
required: false
|
||||||
|
default: 'false'
|
||||||
only-summary:
|
only-summary:
|
||||||
description: |
|
description: |
|
||||||
Allows you to generate only the summary.
|
Allows you to generate only the summary.
|
||||||
|
|
|
||||||
5
dist/index.js
generated
vendored
5
dist/index.js
generated
vendored
|
|
@ -295,6 +295,7 @@ class TestReporter {
|
||||||
this.failOnError = core.getInput('fail-on-error', { required: true }) === 'true';
|
this.failOnError = core.getInput('fail-on-error', { required: true }) === 'true';
|
||||||
this.workDirInput = core.getInput('working-directory', { required: false });
|
this.workDirInput = core.getInput('working-directory', { required: false });
|
||||||
this.onlySummary = core.getInput('only-summary', { required: false }) === 'true';
|
this.onlySummary = core.getInput('only-summary', { required: false }) === 'true';
|
||||||
|
this.showHTMLNotice = core.getInput('show-html-notice', { required: false }) === 'true';
|
||||||
this.token = core.getInput('token', { required: true });
|
this.token = core.getInput('token', { required: true });
|
||||||
this.context = (0, github_utils_1.getCheckRunContext)();
|
this.context = (0, github_utils_1.getCheckRunContext)();
|
||||||
this.octokit = github.getOctokit(this.token);
|
this.octokit = github.getOctokit(this.token);
|
||||||
|
|
@ -411,6 +412,10 @@ class TestReporter {
|
||||||
core.info(`Check run create response: ${resp.status}`);
|
core.info(`Check run create response: ${resp.status}`);
|
||||||
core.info(`Check run URL: ${resp.data.url}`);
|
core.info(`Check run URL: ${resp.data.url}`);
|
||||||
core.info(`Check run HTML: ${resp.data.html_url}`);
|
core.info(`Check run HTML: ${resp.data.html_url}`);
|
||||||
|
if (this.showHTMLNotice) {
|
||||||
|
core.info('*** showhtmlnotice set to true');
|
||||||
|
console.log(`::notice title=Test Results::${resp.data.html_url}`);
|
||||||
|
}
|
||||||
return results;
|
return results;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
81
jest-junit.xml
Normal file
81
jest-junit.xml
Normal file
|
|
@ -0,0 +1,81 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<testsuites name="jest tests" tests="32" failures="0" errors="0" time="7.089">
|
||||||
|
<testsuite name="__tests__/java-junit.test.ts" errors="0" failures="0" skipped="0" timestamp="2023-03-20T14:58:14" time="3.494" tests="4">
|
||||||
|
<testcase classname="java-junit tests" name="produces empty test run result when there are no test cases" time="0.006">
|
||||||
|
</testcase>
|
||||||
|
<testcase classname="java-junit tests" name="report from apache/pulsar single suite test results matches snapshot" time="0.019">
|
||||||
|
</testcase>
|
||||||
|
<testcase classname="java-junit tests" name="report from apache/pulsar test results matches snapshot" time="0.125">
|
||||||
|
</testcase>
|
||||||
|
<testcase classname="java-junit tests" name="parses empty failures in test results" time="0.006">
|
||||||
|
</testcase>
|
||||||
|
</testsuite>
|
||||||
|
<testsuite name="__tests__/jest-junit.test.ts" errors="0" failures="0" skipped="0" timestamp="2023-03-20T14:58:18" time="1.703" tests="4">
|
||||||
|
<testcase classname="jest-junit tests" name="produces empty test run result when there are no test cases in the testsuites element" time="0.005">
|
||||||
|
</testcase>
|
||||||
|
<testcase classname="jest-junit tests" name="produces empty test run result when there are no test cases in a nested testsuite element" time="0.001">
|
||||||
|
</testcase>
|
||||||
|
<testcase classname="jest-junit tests" name="report from ./reports/jest test results matches snapshot" time="0.008">
|
||||||
|
</testcase>
|
||||||
|
<testcase classname="jest-junit tests" name="report from facebook/jest test results matches snapshot" time="0.254">
|
||||||
|
</testcase>
|
||||||
|
</testsuite>
|
||||||
|
<testsuite name="__tests__/dotnet-trx.test.ts" errors="0" failures="0" skipped="0" timestamp="2023-03-20T14:58:19" time="0.702" tests="4">
|
||||||
|
<testcase classname="dotnet-trx tests" name="produces empty test run result when there are no test cases" time="0.007">
|
||||||
|
</testcase>
|
||||||
|
<testcase classname="dotnet-trx tests" name="matches report snapshot" time="0.017">
|
||||||
|
</testcase>
|
||||||
|
<testcase classname="dotnet-trx tests" name="report from FluentValidation test results matches snapshot" time="0.238">
|
||||||
|
</testcase>
|
||||||
|
<testcase classname="dotnet-trx tests" name="report from SilentNotes test results matches snapshot" time="0.061">
|
||||||
|
</testcase>
|
||||||
|
</testsuite>
|
||||||
|
<testsuite name="__tests__/dart-json.test.ts" errors="0" failures="0" skipped="0" timestamp="2023-03-20T14:58:20" time="0.379" tests="3">
|
||||||
|
<testcase classname="dart-json tests" name="produces empty test run result when there are no test cases" time="0.003">
|
||||||
|
</testcase>
|
||||||
|
<testcase classname="dart-json tests" name="matches report snapshot" time="0.006">
|
||||||
|
</testcase>
|
||||||
|
<testcase classname="dart-json tests" name="report from rrousselGit/provider test results matches snapshot" time="0.012">
|
||||||
|
</testcase>
|
||||||
|
</testsuite>
|
||||||
|
<testsuite name="__tests__/mocha-json.test.ts" errors="0" failures="0" skipped="0" timestamp="2023-03-20T14:58:21" time="0.322" tests="3">
|
||||||
|
<testcase classname="mocha-json tests" name="produces empty test run result when there are no test cases" time="0.002">
|
||||||
|
</testcase>
|
||||||
|
<testcase classname="mocha-json tests" name="report from ./reports/mocha-json test results matches snapshot" time="0.007">
|
||||||
|
</testcase>
|
||||||
|
<testcase classname="mocha-json tests" name="report from mochajs/mocha test results matches snapshot" time="0.043">
|
||||||
|
</testcase>
|
||||||
|
</testsuite>
|
||||||
|
<testsuite name="__tests__/java-stack-trace-element-parser.test.ts" errors="0" failures="0" skipped="0" timestamp="2023-03-20T14:58:21" time="0.209" tests="7">
|
||||||
|
<testcase classname="parseStackTraceLine tests" name="empty line is not parsed" time="0.002">
|
||||||
|
</testcase>
|
||||||
|
<testcase classname="parseStackTraceLine tests › java class" name="simple" time="0.001">
|
||||||
|
</testcase>
|
||||||
|
<testcase classname="parseStackTraceLine tests › java class" name="inner class" time="0.001">
|
||||||
|
</testcase>
|
||||||
|
<testcase classname="parseStackTraceLine tests › java class" name="starts with whitespaces" time="0">
|
||||||
|
</testcase>
|
||||||
|
<testcase classname="parseStackTraceLine tests › java class › since Java 9" name="with classloader and module" time="0.001">
|
||||||
|
</testcase>
|
||||||
|
<testcase classname="parseStackTraceLine tests › java class › since Java 9" name="with classloader" time="0.004">
|
||||||
|
</testcase>
|
||||||
|
<testcase classname="parseStackTraceLine tests › Kotlin class" name="method name containing whitespaces" time="0">
|
||||||
|
</testcase>
|
||||||
|
</testsuite>
|
||||||
|
<testsuite name="__tests__/utils/parse-utils.test.ts" errors="0" failures="0" skipped="0" timestamp="2023-03-20T14:58:21" time="0.188" tests="7">
|
||||||
|
<testcase classname="parseNetDuration" name="returns 0 for 00:00:00" time="0.002">
|
||||||
|
</testcase>
|
||||||
|
<testcase classname="parseNetDuration" name="returns 0 for 00:00:00.0000000" time="0">
|
||||||
|
</testcase>
|
||||||
|
<testcase classname="parseNetDuration" name="returns 123 for 00:00:00.123" time="0.001">
|
||||||
|
</testcase>
|
||||||
|
<testcase classname="parseNetDuration" name="returns 12 * 1000 for 00:00:12" time="0">
|
||||||
|
</testcase>
|
||||||
|
<testcase classname="parseNetDuration" name="returns 12 * 60 * 1000 for 00:12:00" time="0.001">
|
||||||
|
</testcase>
|
||||||
|
<testcase classname="parseNetDuration" name="returns 12 * 60 * 60 * 1000 for 12:00:00" time="0">
|
||||||
|
</testcase>
|
||||||
|
<testcase classname="parseNetDuration" name="throws when string has invalid format" time="0.007">
|
||||||
|
</testcase>
|
||||||
|
</testsuite>
|
||||||
|
</testsuites>
|
||||||
6786
package-lock.json
generated
6786
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -42,6 +42,7 @@ class TestReporter {
|
||||||
readonly failOnError = core.getInput('fail-on-error', {required: true}) === 'true'
|
readonly failOnError = core.getInput('fail-on-error', {required: true}) === 'true'
|
||||||
readonly workDirInput = core.getInput('working-directory', {required: false})
|
readonly workDirInput = core.getInput('working-directory', {required: false})
|
||||||
readonly onlySummary = core.getInput('only-summary', {required: false}) === 'true'
|
readonly onlySummary = core.getInput('only-summary', {required: false}) === 'true'
|
||||||
|
readonly showHTMLNotice = core.getInput('show-html-notice', {required: false}) === 'true'
|
||||||
readonly token = core.getInput('token', {required: true})
|
readonly token = core.getInput('token', {required: true})
|
||||||
readonly octokit: InstanceType<typeof GitHub>
|
readonly octokit: InstanceType<typeof GitHub>
|
||||||
readonly context = getCheckRunContext()
|
readonly context = getCheckRunContext()
|
||||||
|
|
@ -198,6 +199,10 @@ class TestReporter {
|
||||||
core.info(`Check run create response: ${resp.status}`)
|
core.info(`Check run create response: ${resp.status}`)
|
||||||
core.info(`Check run URL: ${resp.data.url}`)
|
core.info(`Check run URL: ${resp.data.url}`)
|
||||||
core.info(`Check run HTML: ${resp.data.html_url}`)
|
core.info(`Check run HTML: ${resp.data.html_url}`)
|
||||||
|
if (this.showHTMLNotice) {
|
||||||
|
core.info('*** showhtmlnotice set to true')
|
||||||
|
console.log(`::notice title=Test Results::${resp.data.html_url}`)
|
||||||
|
}
|
||||||
|
|
||||||
return results
|
return results
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue