@smartbear/one-report-publisher
Advanced tools
Comparing version 0.1.0 to 0.2.0
@@ -58,3 +58,3 @@ "use strict"; | ||
return __awaiter(this, void 0, void 0, function () { | ||
var organizationId, password, globs, baseUrl, zip, responseBodies; | ||
var organizationId, username, password, globs, baseUrl, zip, responseBodies; | ||
return __generator(this, function (_a) { | ||
@@ -64,2 +64,3 @@ switch (_a.label) { | ||
organizationId = core_1.default.getInput('organization-id'); | ||
username = core_1.default.getInput('username'); | ||
password = core_1.default.getInput('password'); | ||
@@ -69,3 +70,3 @@ globs = core_1.default.getMultilineInput('reports'); | ||
zip = core_1.default.getBooleanInput('zip'); | ||
return [4 /*yield*/, (0, index_js_1.publish)(globs, zip, organizationId, baseUrl, process.env, (0, index_js_1.vercelAuthenticator)(baseUrl, password))]; | ||
return [4 /*yield*/, (0, index_js_1.publish)(globs, zip, organizationId, baseUrl, process.env, (0, index_js_1.basicAuthAuthenticator)(username, password))]; | ||
case 1: | ||
@@ -72,0 +73,0 @@ responseBodies = _a.sent(); |
@@ -56,9 +56,10 @@ #!/usr/bin/env node | ||
program.requiredOption('-o, --organization-id <id>', 'OneReport organization id'); | ||
program.requiredOption('-u, --username <username>', 'OneReport username'); | ||
program.requiredOption('-p, --password <password>', 'OneReport password'); | ||
program.requiredOption('-r, --reports <glob...>', 'Glob to the files to publish'); | ||
program.option('-u, --url <url>', 'OneReport URL', 'https://one-report.vercel.app'); | ||
program.option('--url <url>', 'OneReport URL', 'https://one-report.vercel.app'); | ||
program.option('--no-zip', 'Do not zip non .zip files', false); | ||
function main() { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var _a, organizationId, password, globs, baseUrl, noZip, responseBodies; | ||
var _a, organizationId, username, password, globs, baseUrl, noZip, responseBodies; | ||
return __generator(this, function (_b) { | ||
@@ -68,4 +69,4 @@ switch (_b.label) { | ||
program.parse(process.argv); | ||
_a = program.opts(), organizationId = _a.organizationId, password = _a.password, globs = _a.reports, baseUrl = _a.url, noZip = _a.noZip; | ||
return [4 /*yield*/, (0, index_js_1.publish)(globs, !noZip, organizationId, baseUrl, process.env, (0, index_js_1.vercelAuthenticator)(baseUrl, password))]; | ||
_a = program.opts(), organizationId = _a.organizationId, username = _a.username, password = _a.password, globs = _a.reports, baseUrl = _a.url, noZip = _a.noZip; | ||
return [4 /*yield*/, (0, index_js_1.publish)(globs, !noZip, organizationId, baseUrl, process.env, (0, index_js_1.basicAuthAuthenticator)(username, password))]; | ||
case 1: | ||
@@ -72,0 +73,0 @@ responseBodies = _b.sent(); |
@@ -0,4 +1,4 @@ | ||
export * from './basicAuthAuthenticator.js'; | ||
export * from './publish.js'; | ||
export * from './types.js'; | ||
export * from './vercelAuthenticator.js'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -13,5 +13,5 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__exportStar(require("./basicAuthAuthenticator.js"), exports); | ||
__exportStar(require("./publish.js"), exports); | ||
__exportStar(require("./types.js"), exports); | ||
__exportStar(require("./vercelAuthenticator.js"), exports); | ||
//# sourceMappingURL=index.js.map |
@@ -71,3 +71,3 @@ "use strict"; | ||
baseUrl = "https://one-report.vercel.app"; | ||
return [4 /*yield*/, (0, index_js_1.publish)(['test/fixtures/*.{xml,json}'], true, process.env.ONE_REPORT_TEST_ORGANIZATION_ID, baseUrl, process.env, (0, index_js_1.vercelAuthenticator)(baseUrl, process.env.ONE_REPORT_PASSWORD))]; | ||
return [4 /*yield*/, (0, index_js_1.publish)(['test/fixtures/*.{xml,json}'], true, process.env.ONE_REPORT_TEST_ORGANIZATION_ID, baseUrl, process.env, (0, index_js_1.basicAuthAuthenticator)('anyone', process.env.ONE_REPORT_PASSWORD))]; | ||
case 1: | ||
@@ -74,0 +74,0 @@ responseBodies = _b.sent(); |
@@ -12,6 +12,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
import { URL } from 'url'; | ||
import { publish, vercelAuthenticator } from '../../src/index.js'; | ||
import { basicAuthAuthenticator, publish } from '../../src/index.js'; | ||
function main() { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const organizationId = core.getInput('organization-id'); | ||
const username = core.getInput('username'); | ||
const password = core.getInput('password'); | ||
@@ -21,3 +22,3 @@ const globs = core.getMultilineInput('reports'); | ||
const zip = core.getBooleanInput('zip'); | ||
const responseBodies = yield publish(globs, zip, organizationId, baseUrl, process.env, vercelAuthenticator(baseUrl, password)); | ||
const responseBodies = yield publish(globs, zip, organizationId, baseUrl, process.env, basicAuthAuthenticator(username, password)); | ||
return responseBodies.map((body) => new URL(`/organization/${organizationId}/executions/${body.testSetExecutionId}`, baseUrl).toString()); | ||
@@ -24,0 +25,0 @@ }); |
@@ -13,8 +13,9 @@ #!/usr/bin/env node | ||
import { URL } from 'url'; | ||
import { publish, vercelAuthenticator } from '../../src/index.js'; | ||
import { basicAuthAuthenticator, publish } from '../../src/index.js'; | ||
const program = new Command(); | ||
program.requiredOption('-o, --organization-id <id>', 'OneReport organization id'); | ||
program.requiredOption('-u, --username <username>', 'OneReport username'); | ||
program.requiredOption('-p, --password <password>', 'OneReport password'); | ||
program.requiredOption('-r, --reports <glob...>', 'Glob to the files to publish'); | ||
program.option('-u, --url <url>', 'OneReport URL', 'https://one-report.vercel.app'); | ||
program.option('--url <url>', 'OneReport URL', 'https://one-report.vercel.app'); | ||
program.option('--no-zip', 'Do not zip non .zip files', false); | ||
@@ -24,4 +25,4 @@ function main() { | ||
program.parse(process.argv); | ||
const { organizationId, password, reports: globs, url: baseUrl, noZip } = program.opts(); | ||
const responseBodies = yield publish(globs, !noZip, organizationId, baseUrl, process.env, vercelAuthenticator(baseUrl, password)); | ||
const { organizationId, username, password, reports: globs, url: baseUrl, noZip } = program.opts(); | ||
const responseBodies = yield publish(globs, !noZip, organizationId, baseUrl, process.env, basicAuthAuthenticator(username, password)); | ||
return responseBodies.map((body) => new URL(`/organization/${organizationId}/executions/${body.testSetExecutionId}`, baseUrl).toString()); | ||
@@ -28,0 +29,0 @@ }); |
@@ -0,4 +1,4 @@ | ||
export * from './basicAuthAuthenticator.js'; | ||
export * from './publish.js'; | ||
export * from './types.js'; | ||
export * from './vercelAuthenticator.js'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -0,4 +1,4 @@ | ||
export * from './basicAuthAuthenticator.js'; | ||
export * from './publish.js'; | ||
export * from './types.js'; | ||
export * from './vercelAuthenticator.js'; | ||
//# sourceMappingURL=index.js.map |
@@ -11,3 +11,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
import assert from 'assert'; | ||
import { publish, vercelAuthenticator } from '../src/index.js'; | ||
import { basicAuthAuthenticator, publish } from '../src/index.js'; | ||
describe('oneReportPublish', () => { | ||
@@ -24,3 +24,3 @@ it('publishes to one-report.vercel.app', () => __awaiter(void 0, void 0, void 0, function* () { | ||
const baseUrl = `https://one-report.vercel.app`; | ||
const responseBodies = yield publish(['test/fixtures/*.{xml,json}'], true, process.env.ONE_REPORT_TEST_ORGANIZATION_ID, baseUrl, process.env, vercelAuthenticator(baseUrl, process.env.ONE_REPORT_PASSWORD)); | ||
const responseBodies = yield publish(['test/fixtures/*.{xml,json}'], true, process.env.ONE_REPORT_TEST_ORGANIZATION_ID, baseUrl, process.env, basicAuthAuthenticator('anyone', process.env.ONE_REPORT_PASSWORD)); | ||
assert.strictEqual(responseBodies.length, 2); | ||
@@ -27,0 +27,0 @@ for (const responseBody of responseBodies) { |
{ | ||
"name": "@smartbear/one-report-publisher", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"description": "Publish Test Results to SmartBear OneReport", | ||
@@ -57,6 +57,6 @@ "type": "module", | ||
"@types/mocha": "9.1.0", | ||
"@types/node": "17.0.13", | ||
"@typescript-eslint/eslint-plugin": "5.10.1", | ||
"@typescript-eslint/parser": "5.10.1", | ||
"esbuild": "0.14.14", | ||
"@types/node": "17.0.16", | ||
"@typescript-eslint/eslint-plugin": "5.11.0", | ||
"@typescript-eslint/parser": "5.11.0", | ||
"esbuild": "0.14.20", | ||
"eslint": "8.8.0", | ||
@@ -74,3 +74,3 @@ "eslint-config-prettier": "8.3.0", | ||
"pretty-quick": "3.1.3", | ||
"ts-node": "10.4.0", | ||
"ts-node": "10.5.0", | ||
"typescript": "4.5.5" | ||
@@ -77,0 +77,0 @@ }, |
@@ -30,5 +30,6 @@ [![Run Tests](https://github.com/SmartBear/one-report-publisher/actions/workflows/test.yaml/badge.svg)](https://github.com/SmartBear/one-report-publisher/actions/workflows/test.yaml) | ||
if: ${{ always() }} | ||
uses: smartbear/one-report-publisher@v0.1.0 | ||
uses: smartbear/one-report-publisher@v0.2.0 | ||
with: | ||
organization-id: F5222E06-BA05-4C82-949A-2FE537B6F59F | ||
username: anyone | ||
password: ${{ secrets.ONE_REPORT_PASSWORD }} | ||
@@ -47,4 +48,5 @@ reports: ./reports/**/*.{xml,json,ndjson,zip} | ||
command: | | ||
npx @smartbear/one-report-publisher@0.1.0 \ | ||
npx @smartbear/one-report-publisher@0.2.0 \ | ||
--organization-id F5222E06-BA05-4C82-949A-2FE537B6F59F \ | ||
--username anyone \ | ||
--password ${ONE_REPORT_PASSWORD} \ | ||
@@ -59,3 +61,3 @@ --reports ./reports/**/*.{xml,json,ndjson,zip} | ||
``` | ||
npx @smartbear/one-report-publisher@v0.1.0 --help | ||
npx @smartbear/one-report-publisher@v0.2.0 --help | ||
@@ -66,5 +68,6 @@ Usage: one-report-publisher [options] | ||
-o, --organization-id <id> OneReport organization id | ||
-u, --username <username> OneReport username | ||
-p, --password <password> OneReport password | ||
-r, --reports <glob...> Glob to the files to publish | ||
-u, --url <url> OneReport URL (default: "https://one-report.vercel.app") | ||
--url <url> OneReport URL (default: "https://one-report.vercel.app") | ||
--no-zip Do not zip non .zip files | ||
@@ -77,3 +80,3 @@ -h, --help display help for command | ||
``` | ||
npx @smartbear/one-report-publisher@0.1.0 \ | ||
npx @smartbear/one-report-publisher@0.2.0 \ | ||
--organization-id F5222E06-BA05-4C82-949A-2FE537B6F59F \ | ||
@@ -80,0 +83,0 @@ --password ${ONE_REPORT_PASSWORD} \ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
215636
2197
81