From 82444f65e54647e2a3e0d185e91781ee29494360 Mon Sep 17 00:00:00 2001 From: Dustin Hershman Date: Wed, 30 Dec 2020 13:57:38 -0500 Subject: [PATCH 1/5] Added classname argument for cli --- bin/tap-junit | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/tap-junit b/bin/tap-junit index de8657c..0da6959 100755 --- a/bin/tap-junit +++ b/bin/tap-junit @@ -3,6 +3,7 @@ /* Modules */ const parsedArgs = require('minimist')(process.argv.slice(2), { alias: { + c: 'classname', o: 'output', n: 'name', s: 'suite', From 7fdfc7dab4354891405c5085643a7e5850760705 Mon Sep 17 00:00:00 2001 From: Dustin Hershman Date: Wed, 30 Dec 2020 13:57:46 -0500 Subject: [PATCH 2/5] Use argument in serialization --- src/serialize.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/serialize.js b/src/serialize.js index d6b2719..358f0b5 100644 --- a/src/serialize.js +++ b/src/serialize.js @@ -58,7 +58,7 @@ function buildFailureParams (fail, comment) { return failObj } -module.exports = (testCases, output, comments, { name = 'Tap-Junit', pretty }) => { +module.exports = (testCases, output, comments, { name = 'Tap-Junit', pretty, classname = 'Tap-Junit-Suite' }) => { const len = testCases.length const xmlObj = { testsuites: { @@ -66,6 +66,7 @@ module.exports = (testCases, output, comments, { name = 'Tap-Junit', pretty }) = '@name': name, '@failures': output.fail, testsuite: { + '@name': classname, '@tests': output.count, '@skipped': output.skip, '@failures': output.fail, From b6e2a66b9f7aa001d648688b2aca3274449a4453 Mon Sep 17 00:00:00 2001 From: Dustin Hershman Date: Wed, 30 Dec 2020 13:57:54 -0500 Subject: [PATCH 3/5] added more tests --- tests/j-tap.tap | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 tests/j-tap.tap diff --git a/tests/j-tap.tap b/tests/j-tap.tap new file mode 100644 index 0000000..6cd2efd --- /dev/null +++ b/tests/j-tap.tap @@ -0,0 +1,9 @@ +TAP version 13 +# @scope/package +ok 1 - Package @scope/package is using registered runtime dependency @angular/core +ok 2 - Package @scope/package is using registered runtime dependency @angular/cdk +ok 3 - Package @scope/package is using registered runtime dependency rxjs +ok 4 - Package @scope/package's dependency @angular/cdk is used +ok 5 - Package @scope/package's dependency @angular/core is used +ok 6 - Package @scope/package's dependency rxjs is used +1..6 From 9ff3fecd7bb7efe9798e2de8c8fc02d1c474aea1 Mon Sep 17 00:00:00 2001 From: Dustin Hershman Date: Wed, 30 Dec 2020 13:58:11 -0500 Subject: [PATCH 4/5] updated markdown files --- .github/ISSUE_TEMPLATE/bug_report.md | 8 +++++++- README.md | 1 + changelog.md | 15 +++++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 07bbcbb..8c35899 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -1,6 +1,6 @@ --- name: Bug report -about: Create a report to help us improve +about: Create a report to help tap-junit improve --- @@ -17,6 +17,12 @@ Steps to reproduce the behavior: **Expected behavior** A clear and concise description of what you expected to happen. +**Command Line Usage** +If you're able please specify the command line format you used for tap-junit for example: +```cli +tap-junit -o output -n dependencies.xml -i tests/j-tap.tap +``` + **Screenshots** If applicable, add screenshots to help explain your problem. diff --git a/README.md b/README.md index ae0766d..50abff4 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ You can checkout the changelog at: https://github.com/dhershman1/tap-junit/blob/ ## Parameters +- `-c, --classname` - The name you want to apply to the `testsuite` element (if not set no name is given to the output testsuite) - `-o, --output` - designate where you want the .xml results to output - If you do not specify an output then results will be displayed within the terminal - `-n, --name` - value provided will be the name of the `output.xml` file, otherwise defaults to `tap.xml` diff --git a/changelog.md b/changelog.md index 5c45ec4..b6ca9ca 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,20 @@ # Changelog +## v4.1.0 + +### New + +- Added the `-c` argument which sets the `testsuite` (NOT `testsuites`) name + - This should fix [#32](https://github.com/dhershman1/tap-junit/issues/32) for the jenkins plugin it uses + +### Improved + +- Tweaked the github bug report template a little to ask for the CLI use of tap-junit + +### Fixed + +- Removed the old `xmlbuilder` dependency, woops + ## v4.0.0 ### BREAKING CHANGES From 2a40becc63afb170f682eca7eed8992c9294f283 Mon Sep 17 00:00:00 2001 From: Dustin Hershman Date: Wed, 30 Dec 2020 13:58:18 -0500 Subject: [PATCH 5/5] Version bump to 4.1.0 --- package-lock.json | 7 +------ package.json | 4 ++-- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index c9c9695..b078420 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "tap-junit", - "version": "4.0.0", + "version": "4.1.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -2976,11 +2976,6 @@ "mkdirp": "^0.5.1" } }, - "xmlbuilder": { - "version": "15.1.0", - "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-15.1.0.tgz", - "integrity": "sha512-xae5hmPQnmSFhpiuV3NGXq+FWGOvWy/rIzxVLnRtSSABbPZWltTQCe6WlHDpCq5pGvnGwNsWnS1FdkW7Tx9FNQ==" - }, "xmlbuilder2": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/xmlbuilder2/-/xmlbuilder2-2.4.0.tgz", diff --git a/package.json b/package.json index ec2bddc..21e4fb0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tap-junit", - "version": "4.0.0", + "version": "4.1.0", "description": "Silly small, silly easy junit output formatter for tap.", "main": "src/index.js", "bin": { @@ -15,6 +15,7 @@ "test:nontape": "cross-env bin/tap-junit --output output/test --name nontape.xml < tests/non-tape.tap", "test:nooutput": "tape tests/pass.js | cross-env bin/tap-junit", "test:skip": "tape tests/skip.js | bin/tap-junit -o output/test -n skip", + "test:jtap": "bin/tap-junit -o output -n dependencies.xml -i tests/j-tap.tap -c jenkins-deps", "tape": "tape tests/pass.js", "tapx": "bin/tap-junit -i tests/tapX.tap -o output/test -n tapx", "bat": "bin/tap-junit -i tests/bats-1.0.0.txt -o output/test -n bat -p", @@ -47,7 +48,6 @@ "dependencies": { "minimist": "1.2.5", "tap-parser": "10.1.0", - "xmlbuilder": "15.1.0", "xmlbuilder2": "2.4.0" }, "devDependencies": {