From 99a22697ee7c2acd4ca717dc6c9d86bccd1c3cdb Mon Sep 17 00:00:00 2001 From: Jonas Courteau Date: Wed, 24 Aug 2022 14:25:34 -0700 Subject: [PATCH 1/8] Add some support for `error`; add outputs Bazel generates JUnit-like output, but it uses the `error` key instead of `failure`. Also added some Github outputs; this can be useful in other actions. --- src/index.ts | 6 ++++++ src/test_parser.ts | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index 90e0ae2..3776fee 100644 --- a/src/index.ts +++ b/src/index.ts @@ -115,6 +115,12 @@ async function run(): Promise { const writefile = util.promisify(fs.writeFile) await writefile(outputFile, output) } + + core.setOutput('passed', total.counts.passed) + core.setOutput('failed', total.counts.failed) + core.setOutput('skipped', total.counts.skipped) + core.setOutput('total', total.counts.passed + total.counts.failed + total.counts.skipped) + } catch (error) { if (error instanceof Error) { core.setFailed(error.message) diff --git a/src/test_parser.ts b/src/test_parser.ts index bc79e42..3d114b0 100644 --- a/src/test_parser.ts +++ b/src/test_parser.ts @@ -241,9 +241,9 @@ async function parseJunitXml(xml: any): Promise { status = TestStatus.Skip counts.skipped++ - } else if (testcase.failure) { + } else if (testcase.failure || testcase.error) { status = TestStatus.Fail - details = testcase.failure[0]._ + details = (testcase.failure || testcase.error)[0]._ counts.failed++ } else { From 4b5ceb02de68a132e810be2f37ca21d45c2cb156 Mon Sep 17 00:00:00 2001 From: Jonas Courteau Date: Wed, 24 Aug 2022 15:13:15 -0700 Subject: [PATCH 2/8] add README and tests * added other outstanding features to the README * added the fact that the default output is now job summary * added docs for show * added docs for new outputs * added a Bazel Junit test output file * added test coverage for the above --- README.md | 56 ++++++++++++++++++++++--- test/junit.ts | 19 +++++++++ test/resources/junit/04-bazel-junit.xml | 29 +++++++++++++ 3 files changed, 99 insertions(+), 5 deletions(-) create mode 100644 test/resources/junit/04-bazel-junit.xml diff --git a/README.md b/README.md index 4b384c6..85e30a5 100644 --- a/README.md +++ b/README.md @@ -9,11 +9,13 @@ Produce an easy-to-read summary of your project's test data as part of your GitH * Integrates easily with your existing GitHub Actions workflow * Produces summaries from JUnit XML and TAP test output * Compatible with most testing tools for most development platforms -* Customizable to show just a summary, just failed tests, or all test results. +* Produces step outputs, so you can pass summary data to other actions +* Customizable to show just a summary, just failed tests, or all test results +* Output can go to the [Github job summary](https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary) (default) or to a file or `stdout` Getting Started --------------- -To set up the test summary action, just add a few lines of YAML to your GitHub Actions workflow. For example, if your test harness produces JUnit XML outputs in the `test/results/` directory, and you want to produce a test summary in a file named `test-summary.md`, add a new step to your workflow YAML after your build and test step: +To set up the test summary action, just add a few lines of YAML to your GitHub Actions workflow. For example, if your test harness produces JUnit XML outputs in the `test/results/` directory, and you want the output attached to the job summary, add a new step to your workflow YAML after your build and test step: ```yaml - name: Test Summary @@ -37,11 +39,20 @@ Update `paths` to match the test output file(s) that your test harness produces. > Note the `if: always()` conditional in this workflow step: you should always use this so that the test summary creation step runs _even if_ the previous steps have failed. This allows your test step to fail -- due to failing tests -- but still produce a test summary. -Upload the markdown -------------------- -The prior "getting started" step generates a summary in GitHub-flavored Markdown (GFM). Once the markdown is generated, you can upload it as a build artifact, add it to a pull request comment, or add it to an issue. For example, to upload the markdown generated in the prior example as a build artifact: +Generating and uploading a markdown file +---------------------------------------- +You can also generate the summary in a GitHub-flavored Markdown (GFM) file, and upload it as a build artifact, add it to a pull request comment, or add it to an issue. Use the `output` parameter to define the target file. + +For example, to create a summary and upload the markdown as a build artifact: ```yaml +- name: Test Summary + uses: test-summary/action@v1 + with: + paths: "test/results/**/TEST-*.xml" + output: test-summary.md + if: always() + - name: Upload test summary uses: actions/upload-artifact@v3 with: @@ -50,6 +61,30 @@ The prior "getting started" step generates a summary in GitHub-flavored Markdown if: always() ``` +Outputs +------- +This action also generates several outputs you can reference in other steps, or even from your job or workflow. These outputs are `passed`, `failed`, `skipped`, and `total`. + +For example, you may want to send a summary to Slack: + +```yaml +- name: Test Summary + id: test_summary + uses: test-summary/action@v1 + with: + paths: "test/results/**/TEST-*.xml" + if: always() +- name: Notify Slack + uses: slackapi/slack-github-action@v1.19.0 + with: + payload: |- + { + "message": "${{ steps.test_summary.outputs.passed }}/${{ steps.test_summary.outputs.total }} tests passed" + } + if: always() +``` + + Examples -------- There are examples for setting up a GitHub Actions step with many different platforms [in the examples repository](https://github.com/test-summary/examples). @@ -94,6 +129,7 @@ Options are specified on the [`with` map](https://docs.github.com/en/actions/usi ```yaml - uses: test-summary/action@v1 with: + paths: "test/results/**/TEST-*.xml" output: "test/results/summary.md" ``` @@ -101,6 +137,16 @@ Options are specified on the [`with` map](https://docs.github.com/en/actions/usi This file is [GitHub Flavored Markdown (GFM)](https://github.github.com/gfm/) and may include permitted HTML. +* **`show`: the test results to summarize in a table** (optional) + This controls whether a test summary table is created or not, as well as what tests are included. It could be `all`, `none`, `pass`, `skip`, or `fail`. The default is `fail` - that is, the summary table will only show the failed tests. For example, if you wanted to show failed and skipped tests: + + ```yaml + - uses: test-summary/action@v1 + with: + paths: "test/results/**/TEST-*.xml" + show: "fail, skip" + ``` + FAQ --- * **How is the summary graphic generated? Does any of my data ever leave GitHub?** diff --git a/test/junit.ts b/test/junit.ts index 8680f54..24859d8 100644 --- a/test/junit.ts +++ b/test/junit.ts @@ -87,4 +87,23 @@ describe("junit", async () => { expect(result.suites[0].cases[8].name).to.eql("skipsTestNine") expect(result.suites[0].cases[9].name).to.eql("skipsTestTen") }) + + it("parses bazel", async() => { + // Not a perfect example of Bazel JUnit output - it typically does one file + // per test target, and aggregates all the test cases from the test tooling + // into one Junit testsuite / testcase. This does depend on the actual + // test platform; my experience is mostly with py_test() targets. + const result = await parseJunitFile(`${resourcePath}/04-bazel-junit.xml`) + + expect(result.counts.passed).to.eql(1) + expect(result.counts.failed).to.eql(1) + expect(result.counts.skipped).to.eql(0) + + expect(result.suites.length).to.eql(2) + + expect(result.suites[0].cases[0].name).to.eql("dummy/path/to/project/and/failing_test_target") + expect(result.suites[0].cases[0].status).to.eql(TestStatus.Fail) + expect(result.suites[1].cases[0].name).to.eql("dummy/path/to/project/and/passing_test_target") + expect(result.suites[1].cases[0].status).to.eql(TestStatus.Pass) + }) }) diff --git a/test/resources/junit/04-bazel-junit.xml b/test/resources/junit/04-bazel-junit.xml new file mode 100644 index 0000000..15daaf1 --- /dev/null +++ b/test/resources/junit/04-bazel-junit.xml @@ -0,0 +1,29 @@ + + + + + +Generated test.log (if the file is not UTF-8, then this may be unreadable): + + + + + + +Generated test.log (if the file is not UTF-8, then this may be unreadable): + + + + From 83dcb33af10db84e69e78844b87fbadf45805a8f Mon Sep 17 00:00:00 2001 From: Jonas Courteau Date: Wed, 24 Aug 2022 15:22:29 -0700 Subject: [PATCH 3/8] minor fix in test output --- test/resources/junit/04-bazel-junit.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/resources/junit/04-bazel-junit.xml b/test/resources/junit/04-bazel-junit.xml index 15daaf1..400af08 100644 --- a/test/resources/junit/04-bazel-junit.xml +++ b/test/resources/junit/04-bazel-junit.xml @@ -5,7 +5,7 @@ Generated test.log (if the file is not UTF-8, then this may be unreadable): Generated test.log (if the file is not UTF-8, then this may be unreadable): Date: Tue, 11 Oct 2022 17:45:30 +0200 Subject: [PATCH 4/8] Switch to using NodeJS v16 as a action runtime NodeJS v12 is EOL and it's been deprecated since April 2022. It will stop being available in GitHub Actions CI/CD workflows by the summer 2023. But it already triggers deprecation warnings that show up on the workflow summary page: https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/ This patch fixes that. Resolves #15 --- .github/workflows/main.yml | 8 ++++---- action.yml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 11d38da..510bc66 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,9 +18,9 @@ jobs: - name: Check out source uses: actions/checkout@v3 - name: Set up Node.js - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: - node-version: '12' + node-version: '16' - name: Build run: | npm ci @@ -54,9 +54,9 @@ jobs: ref: 'dist' path: 'dist' - name: Set up Node.js - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: - node-version: '12' + node-version: '16' - name: Build run: | npm ci diff --git a/action.yml b/action.yml index 00b1569..5226eb2 100644 --- a/action.yml +++ b/action.yml @@ -10,7 +10,7 @@ inputs: show: description: Types of tests to show in the results table runs: - using: 'node12' + using: 'node16' main: 'index.js' branding: icon: check-square From 6be43aac800e8c610afbe510145bd8eb2533ab70 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Tue, 11 Oct 2022 17:33:10 +0200 Subject: [PATCH 5/8] Use HTTPS to link SVG images --- README.md | 6 +++--- src/index.ts | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 85e30a5..b3c320f 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ Test Summary ============ -![Test dashboard: 42 tests passed](http://svg.test-summary.com/dashboard.svg?p=42) -![Test dashboard: 42 tests failed](http://svg.test-summary.com/dashboard.svg?f=42) -![Test dashboard: 42 tests passed, 8 tests failed, 18 tests skipped](http://svg.test-summary.com/dashboard.svg?p=42&f=8&s=18) +![Test dashboard: 42 tests passed](https://svg.test-summary.com/dashboard.svg?p=42) +![Test dashboard: 42 tests failed](https://svg.test-summary.com/dashboard.svg?f=42) +![Test dashboard: 42 tests passed, 8 tests failed, 18 tests skipped](https://svg.test-summary.com/dashboard.svg?p=42&f=8&s=18) Produce an easy-to-read summary of your project's test data as part of your GitHub Actions CI/CD workflow. This helps you understand at-a-glance the impact to the changes in your pull requests, and see which changes are introducing new problems. diff --git a/src/index.ts b/src/index.ts index 3776fee..8e91ba2 100644 --- a/src/index.ts +++ b/src/index.ts @@ -5,11 +5,11 @@ import * as glob from "glob-promise" import { TestResult, TestStatus, parseFile } from "./test_parser" -const dashboardUrl = 'http://svg.test-summary.com/dashboard.svg' -const passIconUrl = 'http://svg.test-summary.com/icon/pass.svg?s=12' -const failIconUrl = 'http://svg.test-summary.com/icon/fail.svg?s=12' -const skipIconUrl = 'http://svg.test-summary.com/icon/skip.svg?s=12' -const noneIconUrl = 'http://svg.test-summary.com/icon/none.svg?s=12' +const dashboardUrl = 'https://svg.test-summary.com/dashboard.svg' +const passIconUrl = 'https://svg.test-summary.com/icon/pass.svg?s=12' +const failIconUrl = 'https://svg.test-summary.com/icon/fail.svg?s=12' +const skipIconUrl = 'https://svg.test-summary.com/icon/skip.svg?s=12' +const noneIconUrl = 'https://svg.test-summary.com/icon/none.svg?s=12' const footer = `This test report was produced by the test-summary action.  Made with ❤️ in Cambridge.` From a16ab037e44097048d3996811bbb917ef54de3de Mon Sep 17 00:00:00 2001 From: Edward Thomson Date: Thu, 13 Oct 2022 22:37:14 +0100 Subject: [PATCH 6/8] Update README Update README to point to v2 --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index b3c320f..90dcef8 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ To set up the test summary action, just add a few lines of YAML to your GitHub A ```yaml - name: Test Summary - uses: test-summary/action@v1 + uses: test-summary/action@v2 with: paths: "test/results/**/TEST-*.xml" if: always() @@ -29,7 +29,7 @@ Update `paths` to match the test output file(s) that your test harness produces. ```yaml - name: Test Summary - uses: test-summary/action@v1 + uses: test-summary/action@v2 with: paths: | test-one/**/TEST-*.xml @@ -99,7 +99,7 @@ Options are specified on the [`with` map](https://docs.github.com/en/actions/usi * To specify a single file, provide it directly as a string value to the `paths` key. For example: ```yaml - - uses: test-summary/action@v1 + - uses: test-summary/action@v2 with: paths: "tests/results.xml" ``` @@ -107,7 +107,7 @@ Options are specified on the [`with` map](https://docs.github.com/en/actions/usi * To specify multiple files, provide them as a multi-line string value to the `paths` key. For example: ```yaml - - uses: test-summary/action@v1 + - uses: test-summary/action@v2 with: paths: | tests-one/results.xml @@ -118,7 +118,7 @@ Options are specified on the [`with` map](https://docs.github.com/en/actions/usi * You can specify files as a [glob patterns](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet), allowing you to use wildcards to match multiple files. For example, to match all files named `TEST-*.xml` beneath the `tests` folder, recursively: ```yaml - - uses: test-summary/action@v1 + - uses: test-summary/action@v2 with: paths: "test/results/**/TEST-*.xml" ``` @@ -127,7 +127,7 @@ Options are specified on the [`with` map](https://docs.github.com/en/actions/usi This is the path to the output file to populate with the test summary markdown data. For example: ```yaml - - uses: test-summary/action@v1 + - uses: test-summary/action@v2 with: paths: "test/results/**/TEST-*.xml" output: "test/results/summary.md" From b8266f66111ea914cee92e04aa9a4e22f6d19fa0 Mon Sep 17 00:00:00 2001 From: Jonas Courteau Date: Mon, 7 Nov 2022 09:37:52 -0800 Subject: [PATCH 7/8] Bump actions/core to 1.10, mocha to 9.2.2 * actions/core - setOutput has changed under the hood; pre-1.10 versions are deprecated * mocha - resolve a "high" vulnerability in a dependency --- package-lock.json | 97 +++++++++++++++++++++++++++-------------------- package.json | 4 +- 2 files changed, 58 insertions(+), 43 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8116fde..3da7c08 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "0.0.1", "license": "MIT", "dependencies": { - "@actions/core": "^1.6.0", + "@actions/core": "^1.10.0", "glob": "^7.2.0", "glob-promise": "^4.2.2", "xml2js": "^0.4.23" @@ -27,7 +27,7 @@ "eslint-plugin-github": "^4.3.5", "eslint-plugin-jest": "^26.1.1", "jest": "^27.5.1", - "mocha": "^9.2.1", + "mocha": "^9.2.2", "mocha-junit-reporter": "^2.0.2", "mocha-multi-reporters": "^1.5.1", "prettier": "^2.5.1", @@ -36,19 +36,20 @@ } }, "node_modules/@actions/core": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.6.0.tgz", - "integrity": "sha512-NB1UAZomZlCV/LmJqkLhNTqtKfFXJZAUPcfl/zqG7EfsQdeUJtaWO98SGbuQ3pydJ3fHl2CvI/51OKYlCYYcaw==", + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.0.tgz", + "integrity": "sha512-2aZDDa3zrrZbP5ZYg159sNoLRb61nQ7awl5pSvIq5Qpj81vwDzdMRKzkWJGJuwVvWpvZKx7vspJALyvaaIQyug==", "dependencies": { - "@actions/http-client": "^1.0.11" + "@actions/http-client": "^2.0.1", + "uuid": "^8.3.2" } }, "node_modules/@actions/http-client": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-1.0.11.tgz", - "integrity": "sha512-VRYHGQV1rqnROJqdMvGUbY/Kn8vriQe/F9HR2AlYHzmKuM/p3kjNuXhmdBfcVgsvRWTz5C5XW5xvndZrVBuAYg==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.0.1.tgz", + "integrity": "sha512-PIXiMVtz6VvyaRsGY268qvj57hXQEpsYogYOu2nrQhlf+XCGmZstmuZBbAybUl1nQGnvS1k1eEsQ69ZoD7xlSw==", "dependencies": { - "tunnel": "0.0.6" + "tunnel": "^0.0.6" } }, "node_modules/@ampproject/remapping": { @@ -5028,9 +5029,9 @@ } }, "node_modules/mocha": { - "version": "9.2.1", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.2.1.tgz", - "integrity": "sha512-T7uscqjJVS46Pq1XDXyo9Uvey9gd3huT/DD9cYBb4K2Xc/vbKRPUWK067bxDQRK0yIz6Jxk73IrnimvASzBNAQ==", + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.2.2.tgz", + "integrity": "sha512-L6XC3EdwT6YrIk0yXpavvLkn8h+EU+Y5UcCHKECyMbdUIxyMuZj4bX4U9e1nvnvUUvQVsV2VHQr5zLdcUkhW/g==", "dev": true, "dependencies": { "@ungap/promise-all-settled": "1.1.2", @@ -5046,9 +5047,9 @@ "he": "1.2.0", "js-yaml": "4.1.0", "log-symbols": "4.1.0", - "minimatch": "3.0.4", + "minimatch": "4.2.1", "ms": "2.1.3", - "nanoid": "3.2.0", + "nanoid": "3.3.1", "serialize-javascript": "6.0.0", "strip-json-comments": "3.1.1", "supports-color": "8.1.1", @@ -5149,15 +5150,15 @@ } }, "node_modules/mocha/node_modules/minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-4.2.1.tgz", + "integrity": "sha512-9Uq1ChtSZO+Mxa/CL1eGizn2vRn3MlLgzhT0Iz8zaY8NdvxvB0d5QdPFmCKf7JKA9Lerx5vRrnwO03jsSfGG9g==", "dev": true, "dependencies": { "brace-expansion": "^1.1.7" }, "engines": { - "node": "*" + "node": ">=10" } }, "node_modules/mocha/node_modules/ms": { @@ -5236,9 +5237,9 @@ "dev": true }, "node_modules/nanoid": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.2.0.tgz", - "integrity": "sha512-fmsZYa9lpn69Ad5eDn7FMcnnSR+8R34W9qJEijxYhTbfOWzr22n1QxCMzXLK+ODyW2973V3Fux959iQoUxzUIA==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.1.tgz", + "integrity": "sha512-n6Vs/3KGyxPQd6uO0eH4Bv0ojGSUvuLlIHtC3Y0kEO23YRge8H9x1GCzLn28YX0H66pMkxuaeESFq4tKISKwdw==", "dev": true, "bin": { "nanoid": "bin/nanoid.cjs" @@ -6463,6 +6464,14 @@ "punycode": "^2.1.0" } }, + "node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/v8-compile-cache": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", @@ -6798,19 +6807,20 @@ }, "dependencies": { "@actions/core": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.6.0.tgz", - "integrity": "sha512-NB1UAZomZlCV/LmJqkLhNTqtKfFXJZAUPcfl/zqG7EfsQdeUJtaWO98SGbuQ3pydJ3fHl2CvI/51OKYlCYYcaw==", + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.0.tgz", + "integrity": "sha512-2aZDDa3zrrZbP5ZYg159sNoLRb61nQ7awl5pSvIq5Qpj81vwDzdMRKzkWJGJuwVvWpvZKx7vspJALyvaaIQyug==", "requires": { - "@actions/http-client": "^1.0.11" + "@actions/http-client": "^2.0.1", + "uuid": "^8.3.2" } }, "@actions/http-client": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-1.0.11.tgz", - "integrity": "sha512-VRYHGQV1rqnROJqdMvGUbY/Kn8vriQe/F9HR2AlYHzmKuM/p3kjNuXhmdBfcVgsvRWTz5C5XW5xvndZrVBuAYg==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.0.1.tgz", + "integrity": "sha512-PIXiMVtz6VvyaRsGY268qvj57hXQEpsYogYOu2nrQhlf+XCGmZstmuZBbAybUl1nQGnvS1k1eEsQ69ZoD7xlSw==", "requires": { - "tunnel": "0.0.6" + "tunnel": "^0.0.6" } }, "@ampproject/remapping": { @@ -10586,9 +10596,9 @@ } }, "mocha": { - "version": "9.2.1", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.2.1.tgz", - "integrity": "sha512-T7uscqjJVS46Pq1XDXyo9Uvey9gd3huT/DD9cYBb4K2Xc/vbKRPUWK067bxDQRK0yIz6Jxk73IrnimvASzBNAQ==", + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.2.2.tgz", + "integrity": "sha512-L6XC3EdwT6YrIk0yXpavvLkn8h+EU+Y5UcCHKECyMbdUIxyMuZj4bX4U9e1nvnvUUvQVsV2VHQr5zLdcUkhW/g==", "dev": true, "requires": { "@ungap/promise-all-settled": "1.1.2", @@ -10604,9 +10614,9 @@ "he": "1.2.0", "js-yaml": "4.1.0", "log-symbols": "4.1.0", - "minimatch": "3.0.4", + "minimatch": "4.2.1", "ms": "2.1.3", - "nanoid": "3.2.0", + "nanoid": "3.3.1", "serialize-javascript": "6.0.0", "strip-json-comments": "3.1.1", "supports-color": "8.1.1", @@ -10637,9 +10647,9 @@ } }, "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-4.2.1.tgz", + "integrity": "sha512-9Uq1ChtSZO+Mxa/CL1eGizn2vRn3MlLgzhT0Iz8zaY8NdvxvB0d5QdPFmCKf7JKA9Lerx5vRrnwO03jsSfGG9g==", "dev": true, "requires": { "brace-expansion": "^1.1.7" @@ -10739,9 +10749,9 @@ "dev": true }, "nanoid": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.2.0.tgz", - "integrity": "sha512-fmsZYa9lpn69Ad5eDn7FMcnnSR+8R34W9qJEijxYhTbfOWzr22n1QxCMzXLK+ODyW2973V3Fux959iQoUxzUIA==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.1.tgz", + "integrity": "sha512-n6Vs/3KGyxPQd6uO0eH4Bv0ojGSUvuLlIHtC3Y0kEO23YRge8H9x1GCzLn28YX0H66pMkxuaeESFq4tKISKwdw==", "dev": true }, "natural-compare": { @@ -11622,6 +11632,11 @@ "punycode": "^2.1.0" } }, + "uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" + }, "v8-compile-cache": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", diff --git a/package.json b/package.json index 8201f94..ba546fb 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "author": "Edward Thomson", "license": "MIT", "dependencies": { - "@actions/core": "^1.6.0", + "@actions/core": "^1.10.0", "glob": "^7.2.0", "glob-promise": "^4.2.2", "xml2js": "^0.4.23" @@ -47,7 +47,7 @@ "eslint-plugin-github": "^4.3.5", "eslint-plugin-jest": "^26.1.1", "jest": "^27.5.1", - "mocha": "^9.2.1", + "mocha": "^9.2.2", "mocha-junit-reporter": "^2.0.2", "mocha-multi-reporters": "^1.5.1", "prettier": "^2.5.1", From 1462004fb565aaf3b8a8b4c5a3f7eba6d474e242 Mon Sep 17 00:00:00 2001 From: Edward Thomson Date: Wed, 25 Jan 2023 10:04:03 +0000 Subject: [PATCH 8/8] Apply suggestions from code review --- README.md | 2 +- test/junit.ts | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 90dcef8..04f66c3 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Produce an easy-to-read summary of your project's test data as part of your GitH * Compatible with most testing tools for most development platforms * Produces step outputs, so you can pass summary data to other actions * Customizable to show just a summary, just failed tests, or all test results -* Output can go to the [Github job summary](https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary) (default) or to a file or `stdout` +* Output can go to the [GitHub job summary](https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary) (default), to a file or `stdout` Getting Started --------------- diff --git a/test/junit.ts b/test/junit.ts index 24859d8..841326d 100644 --- a/test/junit.ts +++ b/test/junit.ts @@ -89,11 +89,11 @@ describe("junit", async () => { }) it("parses bazel", async() => { - // Not a perfect example of Bazel JUnit output - it typically does one file - // per test target, and aggregates all the test cases from the test tooling - // into one Junit testsuite / testcase. This does depend on the actual - // test platform; my experience is mostly with py_test() targets. - const result = await parseJunitFile(`${resourcePath}/04-bazel-junit.xml`) + // Not a perfect example of Bazel JUnit output - it typically does one file + // per test target, and aggregates all the test cases from the test tooling + // into one Junit testsuite / testcase. This does depend on the actual + // test platform; my experience is mostly with py_test() targets. + const result = await parseJunitFile(`${resourcePath}/04-bazel-junit.xml`) expect(result.counts.passed).to.eql(1) expect(result.counts.failed).to.eql(1)