mirror of
https://github.com/dorny/test-reporter.git
synced 2025-12-16 06:17:10 +01:00
Updates to README and info logs
This commit is contained in:
parent
efb99aed01
commit
9c4a2c56d7
7 changed files with 12 additions and 78 deletions
|
|
@ -149,7 +149,8 @@ Or with (undocumented) CLI argument:
|
||||||
|
|
||||||
|
|
||||||
According to documentation `dart_test.yaml` should be at the root of the package, next to the package's pubspec.
|
According to documentation `dart_test.yaml` should be at the root of the package, next to the package's pubspec.
|
||||||
It works in dart projects but the file is ignored by flutter. With flutter it works when `dart_test.yaml` is placed inside your `test` folder.
|
On current `stable` and `beta` channels it doesn't work and you have to put `dart_test.yaml` inside your `test` folder.
|
||||||
|
On `dev` channel it's already fixed.
|
||||||
|
|
||||||
For more information see:
|
For more information see:
|
||||||
- [test package](https://pub.dev/packages/test)
|
- [test package](https://pub.dev/packages/test)
|
||||||
|
|
|
||||||
74
dist/index.js
generated
vendored
74
dist/index.js
generated
vendored
|
|
@ -75,10 +75,11 @@ async function main() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (workDirInput) {
|
if (workDirInput) {
|
||||||
core.info(`Changing directory to ${workDirInput}`);
|
core.info(`Changing directory to '${workDirInput}'`);
|
||||||
process.chdir(workDirInput);
|
process.chdir(workDirInput);
|
||||||
}
|
}
|
||||||
const workDir = file_utils_1.normalizeDirPath(process.cwd(), true);
|
const workDir = file_utils_1.normalizeDirPath(process.cwd(), true);
|
||||||
|
core.info(`Using working-directory '${workDir}'`);
|
||||||
const octokit = github.getOctokit(token);
|
const octokit = github.getOctokit(token);
|
||||||
const sha = github_utils_1.getCheckRunSha();
|
const sha = github_utils_1.getCheckRunSha();
|
||||||
// We won't need tracked files if we are not going to create annotations
|
// We won't need tracked files if we are not going to create annotations
|
||||||
|
|
@ -98,7 +99,7 @@ async function main() {
|
||||||
}
|
}
|
||||||
const results = [];
|
const results = [];
|
||||||
for (const file of files) {
|
for (const file of files) {
|
||||||
core.info(`Processing test report ${file}`);
|
core.info(`Processing test report '${file}'`);
|
||||||
const content = await fs.promises.readFile(file, { encoding: 'utf8' });
|
const content = await fs.promises.readFile(file, { encoding: 'utf8' });
|
||||||
const tr = await parser.parse(file, content);
|
const tr = await parser.parse(file, content);
|
||||||
results.push(tr);
|
results.push(tr);
|
||||||
|
|
@ -162,32 +163,12 @@ run();
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ 4528:
|
/***/ 4528:
|
||||||
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
||||||
if (k2 === undefined) k2 = k;
|
|
||||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
||||||
}) : (function(o, m, k, k2) {
|
|
||||||
if (k2 === undefined) k2 = k;
|
|
||||||
o[k2] = m[k];
|
|
||||||
}));
|
|
||||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
||||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
||||||
}) : function(o, v) {
|
|
||||||
o["default"] = v;
|
|
||||||
});
|
|
||||||
var __importStar = (this && this.__importStar) || function (mod) {
|
|
||||||
if (mod && mod.__esModule) return mod;
|
|
||||||
var result = {};
|
|
||||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
||||||
__setModuleDefault(result, mod);
|
|
||||||
return result;
|
|
||||||
};
|
|
||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
exports.DartJsonParser = void 0;
|
exports.DartJsonParser = void 0;
|
||||||
const core = __importStar(__nccwpck_require__(2186));
|
|
||||||
const file_utils_1 = __nccwpck_require__(2711);
|
const file_utils_1 = __nccwpck_require__(2711);
|
||||||
const dart_json_types_1 = __nccwpck_require__(7887);
|
const dart_json_types_1 = __nccwpck_require__(7887);
|
||||||
const test_results_1 = __nccwpck_require__(2768);
|
const test_results_1 = __nccwpck_require__(2768);
|
||||||
|
|
@ -243,7 +224,6 @@ class DartJsonParser {
|
||||||
return Promise.resolve(result);
|
return Promise.resolve(result);
|
||||||
}
|
}
|
||||||
getTestRun(path, content) {
|
getTestRun(path, content) {
|
||||||
core.info(`Parsing content of '${path}'`);
|
|
||||||
const lines = content.split(/\n\r?/g);
|
const lines = content.split(/\n\r?/g);
|
||||||
const events = lines
|
const events = lines
|
||||||
.map((str, i) => {
|
.map((str, i) => {
|
||||||
|
|
@ -409,32 +389,12 @@ exports.isDoneEvent = isDoneEvent;
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ 2664:
|
/***/ 2664:
|
||||||
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
||||||
if (k2 === undefined) k2 = k;
|
|
||||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
||||||
}) : (function(o, m, k, k2) {
|
|
||||||
if (k2 === undefined) k2 = k;
|
|
||||||
o[k2] = m[k];
|
|
||||||
}));
|
|
||||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
||||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
||||||
}) : function(o, v) {
|
|
||||||
o["default"] = v;
|
|
||||||
});
|
|
||||||
var __importStar = (this && this.__importStar) || function (mod) {
|
|
||||||
if (mod && mod.__esModule) return mod;
|
|
||||||
var result = {};
|
|
||||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
||||||
__setModuleDefault(result, mod);
|
|
||||||
return result;
|
|
||||||
};
|
|
||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
exports.DotnetTrxParser = void 0;
|
exports.DotnetTrxParser = void 0;
|
||||||
const core = __importStar(__nccwpck_require__(2186));
|
|
||||||
const xml2js_1 = __nccwpck_require__(6189);
|
const xml2js_1 = __nccwpck_require__(6189);
|
||||||
const file_utils_1 = __nccwpck_require__(2711);
|
const file_utils_1 = __nccwpck_require__(2711);
|
||||||
const parse_utils_1 = __nccwpck_require__(7811);
|
const parse_utils_1 = __nccwpck_require__(7811);
|
||||||
|
|
@ -474,7 +434,6 @@ class DotnetTrxParser {
|
||||||
return tr;
|
return tr;
|
||||||
}
|
}
|
||||||
async getTrxReport(path, content) {
|
async getTrxReport(path, content) {
|
||||||
core.info(`Parsing content of '${path}'`);
|
|
||||||
try {
|
try {
|
||||||
return (await xml2js_1.parseStringPromise(content));
|
return (await xml2js_1.parseStringPromise(content));
|
||||||
}
|
}
|
||||||
|
|
@ -571,32 +530,12 @@ exports.DotnetTrxParser = DotnetTrxParser;
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ 1113:
|
/***/ 1113:
|
||||||
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
||||||
if (k2 === undefined) k2 = k;
|
|
||||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
||||||
}) : (function(o, m, k, k2) {
|
|
||||||
if (k2 === undefined) k2 = k;
|
|
||||||
o[k2] = m[k];
|
|
||||||
}));
|
|
||||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
||||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
||||||
}) : function(o, v) {
|
|
||||||
o["default"] = v;
|
|
||||||
});
|
|
||||||
var __importStar = (this && this.__importStar) || function (mod) {
|
|
||||||
if (mod && mod.__esModule) return mod;
|
|
||||||
var result = {};
|
|
||||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
||||||
__setModuleDefault(result, mod);
|
|
||||||
return result;
|
|
||||||
};
|
|
||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
exports.JestJunitParser = void 0;
|
exports.JestJunitParser = void 0;
|
||||||
const core = __importStar(__nccwpck_require__(2186));
|
|
||||||
const xml2js_1 = __nccwpck_require__(6189);
|
const xml2js_1 = __nccwpck_require__(6189);
|
||||||
const file_utils_1 = __nccwpck_require__(2711);
|
const file_utils_1 = __nccwpck_require__(2711);
|
||||||
const test_results_1 = __nccwpck_require__(2768);
|
const test_results_1 = __nccwpck_require__(2768);
|
||||||
|
|
@ -609,7 +548,6 @@ class JestJunitParser {
|
||||||
return this.getTestRunResult(path, ju);
|
return this.getTestRunResult(path, ju);
|
||||||
}
|
}
|
||||||
async getJunitReport(path, content) {
|
async getJunitReport(path, content) {
|
||||||
core.info(`Parsing content of '${path}'`);
|
|
||||||
try {
|
try {
|
||||||
return (await xml2js_1.parseStringPromise(content));
|
return (await xml2js_1.parseStringPromise(content));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
2
dist/index.js.map
generated
vendored
2
dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
|
|
@ -52,11 +52,12 @@ async function main(): Promise<void> {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (workDirInput) {
|
if (workDirInput) {
|
||||||
core.info(`Changing directory to ${workDirInput}`)
|
core.info(`Changing directory to '${workDirInput}'`)
|
||||||
process.chdir(workDirInput)
|
process.chdir(workDirInput)
|
||||||
}
|
}
|
||||||
|
|
||||||
const workDir = normalizeDirPath(process.cwd(), true)
|
const workDir = normalizeDirPath(process.cwd(), true)
|
||||||
|
core.info(`Using working-directory '${workDir}'`)
|
||||||
const octokit = github.getOctokit(token)
|
const octokit = github.getOctokit(token)
|
||||||
const sha = getCheckRunSha()
|
const sha = getCheckRunSha()
|
||||||
|
|
||||||
|
|
@ -81,7 +82,7 @@ async function main(): Promise<void> {
|
||||||
|
|
||||||
const results: TestRunResult[] = []
|
const results: TestRunResult[] = []
|
||||||
for (const file of files) {
|
for (const file of files) {
|
||||||
core.info(`Processing test report ${file}`)
|
core.info(`Processing test report '${file}'`)
|
||||||
const content = await fs.promises.readFile(file, {encoding: 'utf8'})
|
const content = await fs.promises.readFile(file, {encoding: 'utf8'})
|
||||||
const tr = await parser.parse(file, content)
|
const tr = await parser.parse(file, content)
|
||||||
results.push(tr)
|
results.push(tr)
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
import * as core from '@actions/core'
|
|
||||||
import {ParseOptions, TestParser} from '../../test-parser'
|
import {ParseOptions, TestParser} from '../../test-parser'
|
||||||
|
|
||||||
import {normalizeFilePath} from '../../utils/file-utils'
|
import {normalizeFilePath} from '../../utils/file-utils'
|
||||||
|
|
@ -78,7 +77,6 @@ export class DartJsonParser implements TestParser {
|
||||||
}
|
}
|
||||||
|
|
||||||
private getTestRun(path: string, content: string): TestRun {
|
private getTestRun(path: string, content: string): TestRun {
|
||||||
core.info(`Parsing content of '${path}'`)
|
|
||||||
const lines = content.split(/\n\r?/g)
|
const lines = content.split(/\n\r?/g)
|
||||||
const events = lines
|
const events = lines
|
||||||
.map((str, i) => {
|
.map((str, i) => {
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
import * as core from '@actions/core'
|
|
||||||
import {parseStringPromise} from 'xml2js'
|
import {parseStringPromise} from 'xml2js'
|
||||||
|
|
||||||
import {ErrorInfo, Outcome, TestMethod, TrxReport} from './dotnet-trx-types'
|
import {ErrorInfo, Outcome, TestMethod, TrxReport} from './dotnet-trx-types'
|
||||||
|
|
@ -52,7 +51,6 @@ export class DotnetTrxParser implements TestParser {
|
||||||
}
|
}
|
||||||
|
|
||||||
private async getTrxReport(path: string, content: string): Promise<TrxReport> {
|
private async getTrxReport(path: string, content: string): Promise<TrxReport> {
|
||||||
core.info(`Parsing content of '${path}'`)
|
|
||||||
try {
|
try {
|
||||||
return (await parseStringPromise(content)) as TrxReport
|
return (await parseStringPromise(content)) as TrxReport
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
import * as core from '@actions/core'
|
|
||||||
import {ParseOptions, TestParser} from '../../test-parser'
|
import {ParseOptions, TestParser} from '../../test-parser'
|
||||||
import {parseStringPromise} from 'xml2js'
|
import {parseStringPromise} from 'xml2js'
|
||||||
|
|
||||||
|
|
@ -23,7 +22,6 @@ export class JestJunitParser implements TestParser {
|
||||||
}
|
}
|
||||||
|
|
||||||
private async getJunitReport(path: string, content: string): Promise<JunitReport> {
|
private async getJunitReport(path: string, content: string): Promise<JunitReport> {
|
||||||
core.info(`Parsing content of '${path}'`)
|
|
||||||
try {
|
try {
|
||||||
return (await parseStringPromise(content)) as JunitReport
|
return (await parseStringPromise(content)) as JunitReport
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue