diff --git a/dist/index.js b/dist/index.js index 773e3e1..76396e5 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,3254 +1,9 @@ -/******/ (() => { // webpackBootstrap -/******/ var __webpack_modules__ = ({ - -/***/ 4548: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (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 () { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function (o) { - var ar = []; - for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys(o); - }; - return function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); - __setModuleDefault(result, mod); - return result; - }; -})(); -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ArtifactProvider = void 0; -const core = __importStar(__nccwpck_require__(7484)); -const github = __importStar(__nccwpck_require__(3228)); -const adm_zip_1 = __importDefault(__nccwpck_require__(1316)); -const picomatch_1 = __importDefault(__nccwpck_require__(4006)); -const github_utils_1 = __nccwpck_require__(6667); -class ArtifactProvider { - octokit; - artifact; - name; - pattern; - sha; - runId; - token; - artifactNameMatch; - fileNameMatch; - getReportName; - constructor(octokit, artifact, name, pattern, sha, runId, token) { - this.octokit = octokit; - this.artifact = artifact; - this.name = name; - this.pattern = pattern; - this.sha = sha; - this.runId = runId; - this.token = token; - if (this.artifact.startsWith('/')) { - const endIndex = this.artifact.lastIndexOf('/'); - const rePattern = this.artifact.substring(1, endIndex); - const reOpts = this.artifact.substring(endIndex + 1); - const re = new RegExp(rePattern, reOpts); - this.artifactNameMatch = (str) => re.test(str); - this.getReportName = (str) => { - const match = str.match(re); - if (match === null) { - throw new Error(`Artifact name '${str}' does not match regex ${this.artifact}`); - } - let reportName = this.name; - for (let i = 1; i < match.length; i++) { - reportName = reportName.replace(new RegExp(`\\$${i}`, 'g'), match[i]); - } - return reportName; - }; - } - else { - this.artifactNameMatch = (str) => str === this.artifact; - this.getReportName = () => this.name; - } - this.fileNameMatch = (0, picomatch_1.default)(pattern); - } - async load() { - const result = {}; - const allArtifacts = await this.octokit.paginate(this.octokit.rest.actions.listWorkflowRunArtifacts, { - ...github.context.repo, - run_id: this.runId - }); - if (allArtifacts.length === 0) { - core.warning(`No artifacts found in run ${this.runId}`); - return {}; - } - const artifacts = allArtifacts.filter(a => this.artifactNameMatch(a.name)); - if (artifacts.length === 0) { - core.warning(`No artifact matches ${this.artifact}`); - return {}; - } - for (const art of artifacts) { - const fileName = `${art.name}.zip`; - await (0, github_utils_1.downloadArtifact)(this.octokit, art.id, fileName, this.token); - core.startGroup(`Reading archive ${fileName}`); - try { - const reportName = this.getReportName(art.name); - core.info(`Report name: ${reportName}`); - const files = []; - const zip = new adm_zip_1.default(fileName); - for (const entry of zip.getEntries()) { - const file = entry.entryName; - if (entry.isDirectory) { - core.info(`Skipping ${file}: entry is a directory`); - continue; - } - if (!this.fileNameMatch(file)) { - core.info(`Skipping ${file}: filename does not match pattern`); - continue; - } - const content = zip.readAsText(entry); - files.push({ file, content }); - core.info(`Read ${file}: ${content.length} chars`); - } - if (result[reportName]) { - result[reportName].push(...files); - } - else { - result[reportName] = files; - } - } - finally { - core.endGroup(); - } - } - return result; - } - async listTrackedFiles() { - return (0, github_utils_1.listFiles)(this.octokit, this.sha); - } -} -exports.ArtifactProvider = ArtifactProvider; - - -/***/ }), - -/***/ 922: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (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 () { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function (o) { - var ar = []; - for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys(o); - }; - return function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); - __setModuleDefault(result, mod); - return result; - }; -})(); -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.LocalFileProvider = void 0; -const fs = __importStar(__nccwpck_require__(9896)); -const fast_glob_1 = __importDefault(__nccwpck_require__(5648)); -const git_1 = __nccwpck_require__(5454); -class LocalFileProvider { - name; - pattern; - constructor(name, pattern) { - this.name = name; - this.pattern = pattern; - } - async load() { - const result = []; - for (const pat of this.pattern) { - const paths = await (0, fast_glob_1.default)(pat, { dot: true }); - for (const file of paths) { - const content = await fs.promises.readFile(file, { encoding: 'utf8' }); - result.push({ file, content }); - } - } - return { [this.name]: result }; - } - async listTrackedFiles() { - return (0, git_1.listFiles)(); - } -} -exports.LocalFileProvider = LocalFileProvider; - - -/***/ }), - -/***/ 5915: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (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 () { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function (o) { - var ar = []; - for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys(o); - }; - return function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); - __setModuleDefault(result, mod); - return result; - }; -})(); -Object.defineProperty(exports, "__esModule", ({ value: true })); -const core = __importStar(__nccwpck_require__(7484)); -const github = __importStar(__nccwpck_require__(3228)); -const artifact_provider_1 = __nccwpck_require__(4548); -const local_file_provider_1 = __nccwpck_require__(922); -const get_annotations_1 = __nccwpck_require__(4400); -const get_report_1 = __nccwpck_require__(7070); -const dart_json_parser_1 = __nccwpck_require__(1254); -const dotnet_nunit_parser_1 = __nccwpck_require__(6394); -const dotnet_trx_parser_1 = __nccwpck_require__(1658); -const golang_json_parser_1 = __nccwpck_require__(5162); -const java_junit_parser_1 = __nccwpck_require__(8342); -const jest_junit_parser_1 = __nccwpck_require__(1042); -const mocha_json_parser_1 = __nccwpck_require__(5402); -const phpunit_junit_parser_1 = __nccwpck_require__(2674); -const python_xunit_parser_1 = __nccwpck_require__(6578); -const rspec_json_parser_1 = __nccwpck_require__(9768); -const swift_xunit_parser_1 = __nccwpck_require__(7330); -const tester_junit_parser_1 = __nccwpck_require__(7816); -const path_utils_1 = __nccwpck_require__(6751); -const github_utils_1 = __nccwpck_require__(6667); -async function main() { - try { - const testReporter = new TestReporter(); - await testReporter.run(); - } - catch (error) { - if (error instanceof Error) - core.setFailed(error); - else - core.setFailed(JSON.stringify(error)); - } -} -class TestReporter { - artifact = core.getInput('artifact', { required: false }); - name = core.getInput('name', { required: true }); - path = core.getInput('path', { required: true }); - pathReplaceBackslashes = core.getInput('path-replace-backslashes', { required: false }) === 'true'; - reporter = core.getInput('reporter', { required: true }); - listSuites = core.getInput('list-suites', { required: true }); - listTests = core.getInput('list-tests', { required: true }); - maxAnnotations = parseInt(core.getInput('max-annotations', { required: true })); - failOnError = core.getInput('fail-on-error', { required: true }) === 'true'; - failOnEmpty = core.getInput('fail-on-empty', { required: true }) === 'true'; - workDirInput = core.getInput('working-directory', { required: false }); - onlySummary = core.getInput('only-summary', { required: false }) === 'true'; - useActionsSummary = core.getInput('use-actions-summary', { required: false }) === 'true'; - badgeTitle = core.getInput('badge-title', { required: false }); - reportTitle = core.getInput('report-title', { required: false }); - collapsed = core.getInput('collapsed', { required: false }); - token = core.getInput('token', { required: true }); - octokit; - context = (0, github_utils_1.getCheckRunContext)(); - constructor() { - this.octokit = github.getOctokit(this.token); - if (this.listSuites !== 'all' && this.listSuites !== 'failed' && this.listSuites !== 'none') { - core.setFailed(`Input parameter 'list-suites' has invalid value`); - return; - } - if (this.listTests !== 'all' && this.listTests !== 'failed' && this.listTests !== 'none') { - core.setFailed(`Input parameter 'list-tests' has invalid value`); - return; - } - if (this.collapsed !== 'auto' && this.collapsed !== 'always' && this.collapsed !== 'never') { - core.setFailed(`Input parameter 'collapsed' has invalid value`); - return; - } - if (isNaN(this.maxAnnotations) || this.maxAnnotations < 0 || this.maxAnnotations > 50) { - core.setFailed(`Input parameter 'max-annotations' has invalid value`); - return; - } - } - async run() { - if (this.workDirInput) { - core.info(`Changing directory to '${this.workDirInput}'`); - process.chdir(this.workDirInput); - } - core.info(`Check runs will be created with SHA=${this.context.sha}`); - // Split path pattern by ',' and optionally convert all backslashes to forward slashes - // fast-glob (micromatch) always interprets backslashes as escape characters instead of directory separators - const pathsList = this.path.split(','); - const pattern = this.pathReplaceBackslashes ? pathsList.map(path_utils_1.normalizeFilePath) : pathsList; - const inputProvider = this.artifact - ? new artifact_provider_1.ArtifactProvider(this.octokit, this.artifact, this.name, pattern, this.context.sha, this.context.runId, this.token) - : new local_file_provider_1.LocalFileProvider(this.name, pattern); - const parseErrors = this.maxAnnotations > 0; - const trackedFiles = parseErrors ? await inputProvider.listTrackedFiles() : []; - const workDir = this.artifact ? undefined : (0, path_utils_1.normalizeDirPath)(process.cwd(), true); - if (parseErrors) - core.info(`Found ${trackedFiles.length} files tracked by GitHub`); - const options = { - workDir, - trackedFiles, - parseErrors - }; - core.info(`Using test report parser '${this.reporter}'`); - const parser = this.getParser(this.reporter, options); - const results = []; - const input = await inputProvider.load(); - for (const [reportName, files] of Object.entries(input)) { - try { - core.startGroup(`Creating test report ${reportName}`); - const tr = await this.createReport(parser, reportName, files); - results.push(...tr); - } - finally { - core.endGroup(); - } - } - const isFailed = results.some(tr => tr.result === 'failed'); - const conclusion = isFailed ? 'failure' : 'success'; - const passed = results.reduce((sum, tr) => sum + tr.passed, 0); - const failed = results.reduce((sum, tr) => sum + tr.failed, 0); - const skipped = results.reduce((sum, tr) => sum + tr.skipped, 0); - const time = results.reduce((sum, tr) => sum + tr.time, 0); - core.setOutput('conclusion', conclusion); - core.setOutput('passed', passed); - core.setOutput('failed', failed); - core.setOutput('skipped', skipped); - core.setOutput('time', time); - if (this.failOnError && isFailed) { - core.setFailed(`Failed test were found and 'fail-on-error' option is set to ${this.failOnError}`); - return; - } - if (results.length === 0 && this.failOnEmpty) { - core.setFailed(`No test report files were found`); - return; - } - } - async createReport(parser, name, files) { - if (files.length === 0) { - core.warning(`No file matches path ${this.path}`); - return []; - } - core.info(`Processing test results for check run ${name}`); - const results = []; - for (const { file, content } of files) { - try { - const tr = await parser.parse(file, content); - results.push(tr); - } - catch (error) { - core.error(`Processing test results from ${file} failed`); - throw error; - } - } - const { listSuites, listTests, onlySummary, useActionsSummary, badgeTitle, reportTitle, collapsed } = this; - const passed = results.reduce((sum, tr) => sum + tr.passed, 0); - const failed = results.reduce((sum, tr) => sum + tr.failed, 0); - const skipped = results.reduce((sum, tr) => sum + tr.skipped, 0); - const shortSummary = `${passed} passed, ${failed} failed and ${skipped} skipped `; - let baseUrl = ''; - if (this.useActionsSummary) { - const summary = (0, get_report_1.getReport)(results, { - listSuites, - listTests, - baseUrl, - onlySummary, - useActionsSummary, - badgeTitle, - reportTitle, - collapsed - }, shortSummary); - core.info('Summary content:'); - core.info(summary); - await core.summary.addRaw(summary).write(); - } - else { - core.info(`Creating check run ${name}`); - const createResp = await this.octokit.rest.checks.create({ - head_sha: this.context.sha, - name, - status: 'in_progress', - output: { - title: name, - summary: '' - }, - ...github.context.repo - }); - core.info('Creating report summary'); - baseUrl = createResp.data.html_url; - const summary = (0, get_report_1.getReport)(results, { - listSuites, - listTests, - baseUrl, - onlySummary, - useActionsSummary, - badgeTitle, - reportTitle, - collapsed - }); - core.info('Creating annotations'); - const annotations = (0, get_annotations_1.getAnnotations)(results, this.maxAnnotations); - const isFailed = this.failOnError && results.some(tr => tr.result === 'failed'); - const conclusion = isFailed ? 'failure' : 'success'; - core.info(`Updating check run conclusion (${conclusion}) and output`); - const resp = await this.octokit.rest.checks.update({ - check_run_id: createResp.data.id, - conclusion, - status: 'completed', - output: { - title: shortSummary, - summary, - annotations - }, - ...github.context.repo - }); - core.info(`Check run create response: ${resp.status}`); - core.info(`Check run URL: ${resp.data.url}`); - core.info(`Check run HTML: ${resp.data.html_url}`); - core.setOutput('url', resp.data.url); - core.setOutput('url_html', resp.data.html_url); - } - return results; - } - getParser(reporter, options) { - switch (reporter) { - case 'dart-json': - return new dart_json_parser_1.DartJsonParser(options, 'dart'); - case 'dotnet-nunit': - return new dotnet_nunit_parser_1.DotnetNunitParser(options); - case 'dotnet-trx': - return new dotnet_trx_parser_1.DotnetTrxParser(options); - case 'golang-json': - return new golang_json_parser_1.GolangJsonParser(options); - case 'flutter-json': - return new dart_json_parser_1.DartJsonParser(options, 'flutter'); - case 'java-junit': - return new java_junit_parser_1.JavaJunitParser(options); - case 'jest-junit': - return new jest_junit_parser_1.JestJunitParser(options); - case 'mocha-json': - return new mocha_json_parser_1.MochaJsonParser(options); - case 'phpunit-junit': - return new phpunit_junit_parser_1.PhpunitJunitParser(options); - case 'python-xunit': - return new python_xunit_parser_1.PythonXunitParser(options); - case 'rspec-json': - return new rspec_json_parser_1.RspecJsonParser(options); - case 'swift-xunit': - return new swift_xunit_parser_1.SwiftXunitParser(options); - case 'tester-junit': - return new tester_junit_parser_1.NetteTesterJunitParser(options); - default: - throw new Error(`Input variable 'reporter' is set to invalid value '${reporter}'`); - } - } -} -main(); - - -/***/ }), - -/***/ 1254: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DartJsonParser = void 0; -const path_utils_1 = __nccwpck_require__(6751); -const dart_json_types_1 = __nccwpck_require__(7064); -const test_results_1 = __nccwpck_require__(613); -class TestRun { - path; - suites; - success; - time; - constructor(path, suites, success, time) { - this.path = path; - this.suites = suites; - this.success = success; - this.time = time; - } -} -class TestSuite { - suite; - constructor(suite) { - this.suite = suite; - } - groups = {}; -} -class TestGroup { - group; - constructor(group) { - this.group = group; - } - tests = []; -} -class TestCase { - testStart; - constructor(testStart) { - this.testStart = testStart; - this.groupId = testStart.test.groupIDs[testStart.test.groupIDs.length - 1]; - } - groupId; - print = []; - testDone; - error; - get result() { - if (this.testDone?.skipped) { - return 'skipped'; - } - if (this.testDone?.result === 'success') { - return 'success'; - } - if (this.testDone?.result === 'error' || this.testDone?.result === 'failure') { - return 'failed'; - } - return undefined; - } - get time() { - return this.testDone !== undefined ? this.testDone.time - this.testStart.time : 0; - } -} -class DartJsonParser { - options; - sdk; - assumedWorkDir; - constructor(options, sdk) { - this.options = options; - this.sdk = sdk; - } - async parse(path, content) { - const tr = this.getTestRun(path, content); - const result = this.getTestRunResult(tr); - return Promise.resolve(result); - } - getTestRun(path, content) { - const lines = content.split(/\n\r?/g); - const events = lines - .map((str, i) => { - if (str.trim() === '') { - return null; - } - try { - return JSON.parse(str); - } - catch (e) { - const errWithCol = e; - const col = errWithCol.columnNumber !== undefined ? `:${errWithCol.columnNumber}` : ''; - throw new Error(`Invalid JSON at ${path}:${i + 1}${col}\n\n${e}`); - } - }) - .filter(evt => evt != null); - let success = false; - let totalTime = 0; - const suites = {}; - const tests = {}; - for (const evt of events) { - if ((0, dart_json_types_1.isSuiteEvent)(evt)) { - suites[evt.suite.id] = new TestSuite(evt.suite); - } - else if ((0, dart_json_types_1.isGroupEvent)(evt)) { - suites[evt.group.suiteID].groups[evt.group.id] = new TestGroup(evt.group); - } - else if ((0, dart_json_types_1.isTestStartEvent)(evt) && evt.test.url !== null) { - const test = new TestCase(evt); - const suite = suites[evt.test.suiteID]; - const group = suite.groups[evt.test.groupIDs[evt.test.groupIDs.length - 1]]; - group.tests.push(test); - tests[evt.test.id] = test; - } - else if ((0, dart_json_types_1.isTestDoneEvent)(evt) && tests[evt.testID]) { - tests[evt.testID].testDone = evt; - } - else if ((0, dart_json_types_1.isErrorEvent)(evt) && tests[evt.testID]) { - tests[evt.testID].error = evt; - } - else if ((0, dart_json_types_1.isMessageEvent)(evt) && tests[evt.testID]) { - tests[evt.testID].print.push(evt); - } - else if ((0, dart_json_types_1.isDoneEvent)(evt)) { - success = evt.success; - totalTime = evt.time; - } - } - return new TestRun(path, Object.values(suites), success, totalTime); - } - getTestRunResult(tr) { - const suites = tr.suites.map(s => { - return new test_results_1.TestSuiteResult(this.getRelativePath(s.suite.path), this.getGroups(s)); - }); - return new test_results_1.TestRunResult(tr.path, suites, tr.time); - } - getGroups(suite) { - const groups = Object.values(suite.groups).filter(grp => grp.tests.length > 0); - groups.sort((a, b) => (a.group.line ?? 0) - (b.group.line ?? 0)); - return groups.map(group => { - group.tests.sort((a, b) => (a.testStart.test.line ?? 0) - (b.testStart.test.line ?? 0)); - const tests = group.tests - .filter(tc => !tc.testDone?.hidden) - .map(tc => { - const error = this.getError(suite, tc); - const testName = group.group.name !== undefined && tc.testStart.test.name.startsWith(group.group.name) - ? tc.testStart.test.name.slice(group.group.name.length).trim() - : tc.testStart.test.name.trim(); - return new test_results_1.TestCaseResult(testName, tc.result, tc.time, error); - }); - return new test_results_1.TestGroupResult(group.group.name, tests); - }); - } - getError(testSuite, test) { - if (!this.options.parseErrors || !test.error) { - return undefined; - } - const { trackedFiles } = this.options; - const stackTrace = test.error?.stackTrace ?? ''; - const print = test.print - .filter(p => p.messageType === 'print') - .map(p => p.message) - .join('\n'); - const details = [print, stackTrace].filter(str => str !== '').join('\n'); - const src = this.exceptionThrowSource(details, trackedFiles); - const message = this.getErrorMessage(test.error?.error ?? '', print); - let path; - let line; - if (src !== undefined) { - path = src.path; - line = src.line; - } - else { - const testStartPath = this.getRelativePath(testSuite.suite.path); - if (trackedFiles.includes(testStartPath)) { - path = testStartPath; - line = test.testStart.test.root_line ?? test.testStart.test.line ?? undefined; - } - } - return { - path, - line, - message, - details - }; - } - getErrorMessage(message, print) { - if (this.sdk === 'flutter') { - const uselessMessageRe = /^Test failed\. See exception logs above\.\nThe test description was:/m; - const flutterPrintRe = /^══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞═+\s+(.*)\s+When the exception was thrown, this was the stack:/ms; - if (uselessMessageRe.test(message)) { - const match = print.match(flutterPrintRe); - if (match !== null) { - return match[1]; - } - } - } - return message || print; - } - exceptionThrowSource(ex, trackedFiles) { - const lines = ex.split(/\r?\n/g); - // regexp to extract file path and line number from stack trace - const dartRe = /^(?!package:)(.*)\s+(\d+):\d+\s+/; - const flutterRe = /^#\d+\s+.*\((?!package:)(.*):(\d+):\d+\)$/; - const re = this.sdk === 'dart' ? dartRe : flutterRe; - for (const str of lines) { - const match = str.match(re); - if (match !== null) { - const [_, pathStr, lineStr] = match; - const path = (0, path_utils_1.normalizeFilePath)(this.getRelativePath(pathStr)); - if (trackedFiles.includes(path)) { - const line = parseInt(lineStr); - return { path, line }; - } - } - } - } - getRelativePath(path) { - const prefix = 'file://'; - if (path.startsWith(prefix)) { - path = path.substring(prefix.length); - } - path = (0, path_utils_1.normalizeFilePath)(path); - const workDir = this.getWorkDir(path); - if (workDir !== undefined && path.startsWith(workDir)) { - path = path.substring(workDir.length); - } - return path; - } - getWorkDir(path) { - return (this.options.workDir ?? - this.assumedWorkDir ?? - (this.assumedWorkDir = (0, path_utils_1.getBasePath)(path, this.options.trackedFiles))); - } -} -exports.DartJsonParser = DartJsonParser; - - -/***/ }), - -/***/ 7064: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/// reflects documentation at https://github.com/dart-lang/test/blob/master/pkgs/test/doc/json_reporter.md -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isSuiteEvent = isSuiteEvent; -exports.isGroupEvent = isGroupEvent; -exports.isTestStartEvent = isTestStartEvent; -exports.isTestDoneEvent = isTestDoneEvent; -exports.isErrorEvent = isErrorEvent; -exports.isDoneEvent = isDoneEvent; -exports.isMessageEvent = isMessageEvent; -function isSuiteEvent(event) { - return event.type === 'suite'; -} -function isGroupEvent(event) { - return event.type === 'group'; -} -function isTestStartEvent(event) { - return event.type === 'testStart'; -} -function isTestDoneEvent(event) { - return event.type === 'testDone'; -} -function isErrorEvent(event) { - return event.type === 'error'; -} -function isDoneEvent(event) { - return event.type === 'done'; -} -function isMessageEvent(event) { - return event.type === 'print'; -} - - -/***/ }), - -/***/ 6394: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DotnetNunitParser = void 0; -const xml2js_1 = __nccwpck_require__(758); -const node_utils_1 = __nccwpck_require__(5384); -const path_utils_1 = __nccwpck_require__(6751); -const test_results_1 = __nccwpck_require__(613); -class DotnetNunitParser { - options; - assumedWorkDir; - constructor(options) { - this.options = options; - } - async parse(path, content) { - const ju = await this.getNunitReport(path, content); - return this.getTestRunResult(path, ju); - } - async getNunitReport(path, content) { - try { - return (await (0, xml2js_1.parseStringPromise)(content)); - } - catch (e) { - throw new Error(`Invalid XML at ${path}\n\n${e}`); - } - } - getTestRunResult(path, nunit) { - const suites = []; - const time = parseFloat(nunit['test-run'].$.duration) * 1000; - this.populateTestCasesRecursive(suites, [], nunit['test-run']['test-suite']); - return new test_results_1.TestRunResult(path, suites, time); - } - populateTestCasesRecursive(result, suitePath, testSuites) { - if (testSuites === undefined) { - return; - } - for (const suite of testSuites) { - suitePath.push(suite); - this.populateTestCasesRecursive(result, suitePath, suite['test-suite']); - const testcases = suite['test-case']; - if (testcases !== undefined) { - for (const testcase of testcases) { - this.addTestCase(result, suitePath, testcase); - } - } - suitePath.pop(); - } - } - addTestCase(result, suitePath, testCase) { - // The last suite in the suite path is the "group". - // The rest are concatenated together to form the "suite". - // But ignore "Theory" suites. - const suitesWithoutTheories = suitePath.filter(suite => suite.$.type !== 'Theory'); - const suiteName = suitesWithoutTheories - .slice(0, suitesWithoutTheories.length - 1) - .map(suite => suite.$.name) - .join('.'); - const groupName = suitesWithoutTheories[suitesWithoutTheories.length - 1].$.name; - let existingSuite = result.find(suite => suite.name === suiteName); - if (existingSuite === undefined) { - existingSuite = new test_results_1.TestSuiteResult(suiteName, []); - result.push(existingSuite); - } - let existingGroup = existingSuite.groups.find(group => group.name === groupName); - if (existingGroup === undefined) { - existingGroup = new test_results_1.TestGroupResult(groupName, []); - existingSuite.groups.push(existingGroup); - } - existingGroup.tests.push(new test_results_1.TestCaseResult(testCase.$.name, this.getTestExecutionResult(testCase), parseFloat(testCase.$.duration) * 1000, this.getTestCaseError(testCase))); - } - getTestExecutionResult(test) { - if (test.$.result === 'Failed' || test.failure) - return 'failed'; - if (test.$.result === 'Skipped') - return 'skipped'; - return 'success'; - } - getTestCaseError(tc) { - if (!this.options.parseErrors || !tc.failure || tc.failure.length === 0) { - return undefined; - } - const details = tc.failure[0]; - let path; - let line; - if (details['stack-trace'] !== undefined && details['stack-trace'].length > 0) { - const src = (0, node_utils_1.getExceptionSource)(details['stack-trace'][0], this.options.trackedFiles, file => this.getRelativePath(file)); - if (src) { - path = src.path; - line = src.line; - } - } - return { - path, - line, - message: details.message && details.message.length > 0 ? details.message[0] : '', - details: details['stack-trace'] && details['stack-trace'].length > 0 ? details['stack-trace'][0] : '' - }; - } - getRelativePath(path) { - path = (0, path_utils_1.normalizeFilePath)(path); - const workDir = this.getWorkDir(path); - if (workDir !== undefined && path.startsWith(workDir)) { - path = path.substring(workDir.length); - } - return path; - } - getWorkDir(path) { - return (this.options.workDir ?? - this.assumedWorkDir ?? - (this.assumedWorkDir = (0, path_utils_1.getBasePath)(path, this.options.trackedFiles))); - } -} -exports.DotnetNunitParser = DotnetNunitParser; - - -/***/ }), - -/***/ 1658: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DotnetTrxParser = void 0; -const xml2js_1 = __nccwpck_require__(758); -const path_utils_1 = __nccwpck_require__(6751); -const parse_utils_1 = __nccwpck_require__(9633); -const test_results_1 = __nccwpck_require__(613); -class TestClass { - name; - constructor(name) { - this.name = name; - } - tests = []; -} -class Test { - name; - outcome; - duration; - error; - constructor(name, outcome, duration, error) { - this.name = name; - this.outcome = outcome; - this.duration = duration; - this.error = error; - } - get result() { - switch (this.outcome) { - case 'Passed': - return 'success'; - case 'NotExecuted': - return 'skipped'; - case 'Failed': - return 'failed'; - } - } -} -class DotnetTrxParser { - options; - assumedWorkDir; - constructor(options) { - this.options = options; - } - async parse(path, content) { - const trx = await this.getTrxReport(path, content); - const tc = this.getTestClasses(trx); - const tr = this.getTestRunResult(path, trx, tc); - tr.sort(true); - return tr; - } - async getTrxReport(path, content) { - try { - return (await (0, xml2js_1.parseStringPromise)(content)); - } - catch (e) { - throw new Error(`Invalid XML at ${path}\n\n${e}`); - } - } - getTestClasses(trx) { - if (trx.TestRun.TestDefinitions === undefined || trx.TestRun.Results === undefined || - !trx.TestRun.TestDefinitions.some(td => td.UnitTest && Array.isArray(td.UnitTest))) { - return []; - } - const unitTests = {}; - for (const td of trx.TestRun.TestDefinitions) { - for (const ut of td.UnitTest) { - unitTests[ut.$.id] = ut; - } - } - const unitTestsResults = trx.TestRun.Results.flatMap(r => r.UnitTestResult).flatMap(result => ({ - result, - test: unitTests[result.$.testId] - })); - const testClasses = {}; - for (const r of unitTestsResults) { - const className = r.test.TestMethod[0].$.className ?? "Unclassified"; - let tc = testClasses[className]; - if (tc === undefined) { - tc = new TestClass(className); - testClasses[tc.name] = tc; - } - const error = this.getErrorInfo(r.result); - const durationAttr = r.result.$.duration; - const duration = durationAttr ? (0, parse_utils_1.parseNetDuration)(durationAttr) : 0; - const resultTestName = r.result.$.testName; - const testName = resultTestName.startsWith(className) && resultTestName[className.length] === '.' - ? resultTestName.substring(className.length + 1) - : resultTestName; - const test = new Test(testName, r.result.$.outcome, duration, error); - tc.tests.push(test); - } - const result = Object.values(testClasses); - return result; - } - getTestRunResult(path, trx, testClasses) { - const times = trx.TestRun.Times[0].$; - const totalTime = (0, parse_utils_1.parseIsoDate)(times.finish).getTime() - (0, parse_utils_1.parseIsoDate)(times.start).getTime(); - const suites = testClasses.map(testClass => { - const tests = testClass.tests.map(test => { - const error = this.getError(test); - return new test_results_1.TestCaseResult(test.name, test.result, test.duration, error); - }); - const group = new test_results_1.TestGroupResult(null, tests); - return new test_results_1.TestSuiteResult(testClass.name, [group]); - }); - return new test_results_1.TestRunResult(path, suites, totalTime); - } - getErrorInfo(testResult) { - if (testResult.$.outcome !== 'Failed') { - return undefined; - } - const output = testResult.Output; - const error = output?.length > 0 && output[0].ErrorInfo?.length > 0 ? output[0].ErrorInfo[0] : undefined; - return error; - } - getError(test) { - if (!this.options.parseErrors || !test.error) { - return undefined; - } - const error = test.error; - if (!Array.isArray(error.Message) || - error.Message.length === 0 || - !Array.isArray(error.StackTrace) || - error.StackTrace.length === 0) { - return undefined; - } - const stackTrace = test.error.StackTrace[0]; - const message = `${test.error.Message[0]}\n${stackTrace}`; - let path; - let line; - const src = this.exceptionThrowSource(stackTrace); - if (src) { - path = src.path; - line = src.line; - } - return { - path, - line, - message, - details: `${message}` - }; - } - exceptionThrowSource(stackTrace) { - const lines = stackTrace.split(/\r*\n/); - const re = / in (.+):line (\d+)$/; - const { trackedFiles } = this.options; - for (const str of lines) { - const match = str.match(re); - if (match !== null) { - const [_, fileStr, lineStr] = match; - const filePath = (0, path_utils_1.normalizeFilePath)(fileStr); - const workDir = this.getWorkDir(filePath); - if (workDir) { - const file = filePath.substring(workDir.length); - if (trackedFiles.includes(file)) { - const line = parseInt(lineStr); - return { path: file, line }; - } - } - } - } - } - getWorkDir(path) { - return (this.options.workDir ?? - this.assumedWorkDir ?? - (this.assumedWorkDir = (0, path_utils_1.getBasePath)(path, this.options.trackedFiles))); - } -} -exports.DotnetTrxParser = DotnetTrxParser; - - -/***/ }), - -/***/ 5162: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.GolangJsonParser = void 0; -const test_results_1 = __nccwpck_require__(613); -class GolangJsonParser { - options; - assumedWorkDir; - constructor(options) { - this.options = options; - } - async parse(path, content) { - const events = await this.getGolangTestEvents(path, content); - return this.getTestRunResult(path, events); - } - async getGolangTestEvents(path, content) { - return content.trim().split('\n').map((line, index) => { - try { - return JSON.parse(line); - } - catch (e) { - throw new Error(`Invalid JSON at ${path} line ${index + 1}\n\n${e}`); - } - }); - } - getTestRunResult(path, events) { - const eventGroups = new Map(); - for (const event of events) { - if (!event.Test) { - continue; - } - const k = `${event.Package}/${event.Test}`; - let g = eventGroups.get(k); - if (!g) { - g = []; - eventGroups.set(k, g); - } - g.push(event); - } - const suites = []; - for (const eventGroup of eventGroups.values()) { - const event = eventGroup[0]; - let suite = suites.find(s => s.name === event.Package); - if (!suite) { - suite = new test_results_1.TestSuiteResult(event.Package, []); - suites.push(suite); - } - if (!event.Test) { - continue; - } - let groupName; - let rest; - [groupName, ...rest] = event.Test.split('/'); - let testName = rest.join('/'); - if (!testName) { - testName = groupName; - groupName = null; - } - let group = suite.groups.find(g => g.name === groupName); - if (!group) { - group = new test_results_1.TestGroupResult(groupName, []); - suite.groups.push(group); - } - const lastEvent = eventGroup.at(-1); - const result = lastEvent.Action === 'pass' ? 'success' - : lastEvent.Action === 'skip' ? 'skipped' - : 'failed'; - if (lastEvent.Elapsed === undefined) { - throw new Error('missing elapsed on final test event'); - } - const time = lastEvent.Elapsed * 1000; - let error = undefined; - if (result !== 'success') { - const outputEvents = eventGroup - .filter(e => e.Action === 'output') - .map(e => e.Output ?? '') - // Go output prepends indentation to help group tests - remove it - .map(o => o.replace(/^ /, '')); - // First and last lines will be generic "test started" and "test finished" lines - remove them - outputEvents.splice(0, 1); - outputEvents.splice(-1, 1); - const details = outputEvents.join(''); - error = { - message: details, - details: details - }; - } - group.tests.push(new test_results_1.TestCaseResult(testName, result, time, error)); - } - return new test_results_1.TestRunResult(path, suites); - } -} -exports.GolangJsonParser = GolangJsonParser; - - -/***/ }), - -/***/ 8342: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (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 () { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function (o) { - var ar = []; - for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys(o); - }; - return function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); - __setModuleDefault(result, mod); - return result; - }; -})(); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.JavaJunitParser = void 0; -const path = __importStar(__nccwpck_require__(6928)); -const xml2js_1 = __nccwpck_require__(758); -const java_stack_trace_element_parser_1 = __nccwpck_require__(8105); -const path_utils_1 = __nccwpck_require__(6751); -const test_results_1 = __nccwpck_require__(613); -class JavaJunitParser { - options; - trackedFiles; - constructor(options) { - this.options = options; - // Map to efficient lookup of all paths with given file name - this.trackedFiles = {}; - for (const filePath of options.trackedFiles) { - const fileName = path.basename(filePath); - const files = this.trackedFiles[fileName] ?? (this.trackedFiles[fileName] = []); - files.push((0, path_utils_1.normalizeFilePath)(filePath)); - } - } - async parse(filePath, content) { - const reportOrSuite = await this.getJunitReport(filePath, content); - const isReport = reportOrSuite.testsuites !== undefined; - // XML might contain: - // - multiple suites under root node - // - single as root node - let ju; - if (isReport) { - ju = reportOrSuite; - } - else { - // Make it behave the same way as if suite was inside root node - const suite = reportOrSuite.testsuite; - ju = { - testsuites: { - $: { time: suite.$.time }, - testsuite: [suite] - } - }; - } - return this.getTestRunResult(filePath, ju); - } - async getJunitReport(filePath, content) { - try { - return await (0, xml2js_1.parseStringPromise)(content); - } - catch (e) { - throw new Error(`Invalid XML at ${filePath}\n\n${e}`); - } - } - getTestRunResult(filePath, junit) { - const suites = junit.testsuites.testsuite === undefined - ? [] - : junit.testsuites.testsuite.map(ts => { - const name = ts.$.name.trim(); - const time = parseFloat(ts.$.time) * 1000; - const sr = new test_results_1.TestSuiteResult(name, this.getGroups(ts), time); - return sr; - }); - const seconds = parseFloat(junit.testsuites.$?.time); - const time = isNaN(seconds) ? undefined : seconds * 1000; - return new test_results_1.TestRunResult(filePath, suites, time); - } - getGroups(suite) { - if (suite.testcase === undefined) { - return []; - } - const groups = []; - for (const tc of suite.testcase) { - // Normally classname is same as suite name - both refer to same Java class - // Therefore it doesn't make sense to process it as a group - // and tests will be added to default group with empty name - const className = tc.$.classname === suite.$.name ? '' : tc.$.classname; - let grp = groups.find(g => g.name === className); - if (grp === undefined) { - grp = { name: className, tests: [] }; - groups.push(grp); - } - grp.tests.push(tc); - } - return groups.map(grp => { - const tests = grp.tests.map(tc => { - const name = tc.$.name.trim(); - const result = this.getTestCaseResult(tc); - const time = parseFloat(tc.$.time) * 1000; - const error = this.getTestCaseError(tc); - return new test_results_1.TestCaseResult(name, result, time, error); - }); - return new test_results_1.TestGroupResult(grp.name, tests); - }); - } - getTestCaseResult(test) { - if (test.failure || test.error) - return 'failed'; - if (test.skipped) - return 'skipped'; - return 'success'; - } - getTestCaseError(tc) { - if (!this.options.parseErrors) { - return undefined; - } - // We process and the same way - const failures = tc.failure ?? tc.error; - if (!failures) { - return undefined; - } - const failure = failures[0]; - const details = typeof failure === 'object' ? failure._ : failure; - let filePath; - let line; - if (details != null) { - const src = this.exceptionThrowSource(details); - if (src) { - filePath = src.filePath; - line = src.line; - } - } - let message; - if (typeof failure === 'object') { - message = failure.$.message; - if (failure.$?.type) { - message = failure.$.type + ': ' + message; - } - } - return { - path: filePath, - line, - details, - message - }; - } - exceptionThrowSource(stackTrace) { - const lines = stackTrace.split(/\r?\n/); - for (const str of lines) { - const stackTraceElement = (0, java_stack_trace_element_parser_1.parseStackTraceElement)(str); - if (stackTraceElement) { - const { tracePath, fileName, lineStr } = stackTraceElement; - const filePath = this.getFilePath(tracePath, fileName); - if (filePath !== undefined) { - const line = parseInt(lineStr); - return { filePath, line }; - } - } - } - } - // Stacktrace in Java doesn't contain full paths to source file. - // There are only package, file name and line. - // Assuming folder structure matches package name (as it should in Java), - // we can try to match tracked file. - getFilePath(tracePath, fileName) { - // Check if there is any tracked file with given name - const files = this.trackedFiles[fileName]; - if (files === undefined) { - return undefined; - } - // Remove class name and method name from trace. - // Take parts until first item with capital letter - package names are lowercase while class name is CamelCase. - const packageParts = tracePath.split(/\./g); - const packageIndex = packageParts.findIndex(part => part[0] <= 'Z'); - if (packageIndex !== -1) { - packageParts.splice(packageIndex, packageParts.length - packageIndex); - } - if (packageParts.length === 0) { - return undefined; - } - // Get right file - // - file name matches - // - parent folders structure must reflect the package name - for (const filePath of files) { - const dirs = path.dirname(filePath).split(/\//g); - if (packageParts.length > dirs.length) { - continue; - } - // get only N parent folders, where N = length of package name parts - if (dirs.length > packageParts.length) { - dirs.splice(0, dirs.length - packageParts.length); - } - // check if parent folder structure matches package name - const isMatch = packageParts.every((part, i) => part === dirs[i]); - if (isMatch) { - return filePath; - } - } - return undefined; - } -} -exports.JavaJunitParser = JavaJunitParser; - - -/***/ }), - -/***/ 8105: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.parseStackTraceElement = parseStackTraceElement; -// classloader and module name are optional: -// at //(:) -// https://github.com/eclipse-openj9/openj9/issues/11452#issuecomment-754946992 -const re = /^\s*at (\S+\/\S*\/)?(.*)\((.*):(\d+)\)$/; -function parseStackTraceElement(stackTraceLine) { - const match = stackTraceLine.match(re); - if (match !== null) { - const [_, maybeClassLoaderAndModuleNameAndVersion, tracePath, fileName, lineStr] = match; - const { classLoader, moduleNameAndVersion } = parseClassLoaderAndModule(maybeClassLoaderAndModuleNameAndVersion); - return { - classLoader, - moduleNameAndVersion, - tracePath, - fileName, - lineStr - }; - } - return undefined; -} -function parseClassLoaderAndModule(maybeClassLoaderAndModuleNameAndVersion) { - if (maybeClassLoaderAndModuleNameAndVersion) { - const res = maybeClassLoaderAndModuleNameAndVersion.split('/'); - const classLoader = res[0]; - let moduleNameAndVersion = res[1]; - if (moduleNameAndVersion === '') { - moduleNameAndVersion = undefined; - } - return { classLoader, moduleNameAndVersion }; - } - return { classLoader: undefined, moduleNameAndVersion: undefined }; -} - - -/***/ }), - -/***/ 1042: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.JestJunitParser = void 0; -const xml2js_1 = __nccwpck_require__(758); -const node_utils_1 = __nccwpck_require__(5384); -const path_utils_1 = __nccwpck_require__(6751); -const test_results_1 = __nccwpck_require__(613); -class JestJunitParser { - options; - assumedWorkDir; - constructor(options) { - this.options = options; - } - async parse(path, content) { - const ju = await this.getJunitReport(path, content); - return this.getTestRunResult(path, ju); - } - async getJunitReport(path, content) { - try { - return (await (0, xml2js_1.parseStringPromise)(content)); - } - catch (e) { - throw new Error(`Invalid XML at ${path}\n\n${e}`); - } - } - getTestRunResult(path, junit) { - const suites = junit.testsuites.testsuite === undefined - ? [] - : junit.testsuites.testsuite.map(ts => { - const name = this.escapeCharacters(ts.$.name.trim()); - const time = parseFloat(ts.$.time) * 1000; - const sr = new test_results_1.TestSuiteResult(name, this.getGroups(ts), time); - return sr; - }); - const time = junit.testsuites.$ && parseFloat(junit.testsuites.$.time) * 1000; - return new test_results_1.TestRunResult(path, suites, time); - } - getGroups(suite) { - if (!suite.testcase) { - return []; - } - const groups = []; - for (const tc of suite.testcase) { - let grp = groups.find(g => g.describe === tc.$.classname); - if (grp === undefined) { - grp = { describe: tc.$.classname, tests: [] }; - groups.push(grp); - } - grp.tests.push(tc); - } - return groups.map(grp => { - const tests = grp.tests.map(tc => { - const name = tc.$.name.trim(); - const result = this.getTestCaseResult(tc); - const time = parseFloat(tc.$.time) * 1000; - const error = this.getTestCaseError(tc); - return new test_results_1.TestCaseResult(name, result, time, error); - }); - return new test_results_1.TestGroupResult(grp.describe, tests); - }); - } - getTestCaseResult(test) { - if (test.failure) - return 'failed'; - if (test.skipped) - return 'skipped'; - return 'success'; - } - getTestCaseError(tc) { - if (!this.options.parseErrors || !tc.failure) { - return undefined; - } - const details = typeof tc.failure[0] === 'string' ? tc.failure[0] : tc.failure[0]['_']; - let path; - let line; - const src = (0, node_utils_1.getExceptionSource)(details, this.options.trackedFiles, file => this.getRelativePath(file)); - if (src) { - path = src.path; - line = src.line; - } - return { - path, - line, - details - }; - } - getRelativePath(path) { - path = (0, path_utils_1.normalizeFilePath)(path); - const workDir = this.getWorkDir(path); - if (workDir !== undefined && path.startsWith(workDir)) { - path = path.substring(workDir.length); - } - return path; - } - getWorkDir(path) { - return (this.options.workDir ?? - this.assumedWorkDir ?? - (this.assumedWorkDir = (0, path_utils_1.getBasePath)(path, this.options.trackedFiles))); - } - escapeCharacters(s) { - return s.replace(/([<>])/g, '\\$1'); - } -} -exports.JestJunitParser = JestJunitParser; - - -/***/ }), - -/***/ 5402: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.MochaJsonParser = void 0; -const test_results_1 = __nccwpck_require__(613); -const node_utils_1 = __nccwpck_require__(5384); -const path_utils_1 = __nccwpck_require__(6751); -class MochaJsonParser { - options; - assumedWorkDir; - constructor(options) { - this.options = options; - } - async parse(path, content) { - const mocha = this.getMochaJson(path, content); - const result = this.getTestRunResult(path, mocha); - result.sort(true); - return Promise.resolve(result); - } - getMochaJson(path, content) { - try { - return JSON.parse(content); - } - catch (e) { - throw new Error(`Invalid JSON at ${path}\n\n${e}`); - } - } - getTestRunResult(resultsPath, mocha) { - const suitesMap = {}; - const getSuite = (test) => { - const path = this.getRelativePath(test.file); - return suitesMap[path] ?? (suitesMap[path] = new test_results_1.TestSuiteResult(path, [])); - }; - for (const test of mocha.passes) { - const suite = getSuite(test); - this.processTest(suite, test, 'success'); - } - for (const test of mocha.failures) { - const suite = getSuite(test); - this.processTest(suite, test, 'failed'); - } - for (const test of mocha.pending) { - const suite = getSuite(test); - this.processTest(suite, test, 'skipped'); - } - const suites = Object.values(suitesMap); - return new test_results_1.TestRunResult(resultsPath, suites, mocha.stats.duration); - } - processTest(suite, test, result) { - const groupName = test.fullTitle !== test.title - ? test.fullTitle.substring(0, test.fullTitle.length - test.title.length).trimEnd() - : null; - let group = suite.groups.find(grp => grp.name === groupName); - if (group === undefined) { - group = new test_results_1.TestGroupResult(groupName, []); - suite.groups.push(group); - } - const error = this.getTestCaseError(test); - const testCase = new test_results_1.TestCaseResult(test.title, result, test.duration ?? 0, error); - group.tests.push(testCase); - } - getTestCaseError(test) { - const details = test.err.stack; - const message = test.err.message; - if (details === undefined) { - return undefined; - } - let path; - let line; - const src = (0, node_utils_1.getExceptionSource)(details, this.options.trackedFiles, file => this.getRelativePath(file)); - if (src) { - path = src.path; - line = src.line; - } - return { - path, - line, - message, - details - }; - } - getRelativePath(path) { - path = (0, path_utils_1.normalizeFilePath)(path); - const workDir = this.getWorkDir(path); - if (workDir !== undefined && path.startsWith(workDir)) { - path = path.substring(workDir.length); - } - return path; - } - getWorkDir(path) { - return (this.options.workDir ?? - this.assumedWorkDir ?? - (this.assumedWorkDir = (0, path_utils_1.getBasePath)(path, this.options.trackedFiles))); - } -} -exports.MochaJsonParser = MochaJsonParser; - - -/***/ }), - -/***/ 2674: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PhpunitJunitParser = void 0; -const xml2js_1 = __nccwpck_require__(758); -const path_utils_1 = __nccwpck_require__(6751); -const test_results_1 = __nccwpck_require__(613); -class PhpunitJunitParser { - options; - trackedFiles; - trackedFilesList; - assumedWorkDir; - constructor(options) { - this.options = options; - this.trackedFilesList = options.trackedFiles.map(f => (0, path_utils_1.normalizeFilePath)(f)); - this.trackedFiles = new Set(this.trackedFilesList); - } - async parse(filePath, content) { - const reportOrSuite = await this.getPhpunitReport(filePath, content); - const isReport = reportOrSuite.testsuites !== undefined; - // XML might contain: - // - multiple suites under root node - // - single as root node - let report; - if (isReport) { - report = reportOrSuite; - } - else { - // Make it behave the same way as if suite was inside root node - const suite = reportOrSuite.testsuite; - report = { - testsuites: { - $: { time: suite.$.time }, - testsuite: [suite] - } - }; - } - return this.getTestRunResult(filePath, report); - } - async getPhpunitReport(filePath, content) { - try { - return await (0, xml2js_1.parseStringPromise)(content); - } - catch (e) { - throw new Error(`Invalid XML at ${filePath}\n\n${e}`); - } - } - getTestRunResult(filePath, report) { - const suites = []; - this.collectSuites(suites, report.testsuites.testsuite ?? []); - const seconds = parseFloat(report.testsuites.$?.time ?? ''); - const time = isNaN(seconds) ? undefined : seconds * 1000; - return new test_results_1.TestRunResult(filePath, suites, time); - } - collectSuites(results, testsuites) { - for (const ts of testsuites) { - // Recursively process nested test suites first (depth-first) - if (ts.testsuite) { - this.collectSuites(results, ts.testsuite); - } - // Only add suites that have direct test cases - // This avoids adding container suites that only hold nested suites - if (ts.testcase && ts.testcase.length > 0) { - const name = ts.$.name.trim(); - const time = parseFloat(ts.$.time) * 1000; - results.push(new test_results_1.TestSuiteResult(name, this.getGroups(ts), time)); - } - } - } - getGroups(suite) { - if (!suite.testcase || suite.testcase.length === 0) { - return []; - } - const groups = []; - for (const tc of suite.testcase) { - // Use classname (PHPUnit style) for grouping - // If classname matches suite name, use empty string to avoid redundancy - const className = tc.$.classname ?? tc.$.class ?? ''; - const groupName = className === suite.$.name ? '' : className; - let grp = groups.find(g => g.name === groupName); - if (grp === undefined) { - grp = { name: groupName, tests: [] }; - groups.push(grp); - } - grp.tests.push(tc); - } - return groups.map(grp => { - const tests = grp.tests.map(tc => { - const name = tc.$.name.trim(); - const result = this.getTestCaseResult(tc); - const time = parseFloat(tc.$.time) * 1000; - const error = this.getTestCaseError(tc); - return new test_results_1.TestCaseResult(name, result, time, error); - }); - return new test_results_1.TestGroupResult(grp.name, tests); - }); - } - getTestCaseResult(test) { - if (test.failure || test.error) - return 'failed'; - if (test.skipped) - return 'skipped'; - return 'success'; - } - getTestCaseError(tc) { - if (!this.options.parseErrors) { - return undefined; - } - // We process and the same way - const failures = tc.failure ?? tc.error; - if (!failures || failures.length === 0) { - return undefined; - } - const failure = failures[0]; - const details = typeof failure === 'string' ? failure : failure._ ?? ''; - // PHPUnit provides file path directly in testcase attributes - let filePath; - let line; - if (tc.$.file) { - const relativePath = this.getRelativePath(tc.$.file); - if (this.trackedFiles.has(relativePath)) { - filePath = relativePath; - } - if (tc.$.line) { - line = parseInt(tc.$.line); - } - } - // If file not in tracked files, try to extract from error details - if (!filePath && details) { - const extracted = this.extractFileAndLine(details); - if (extracted) { - filePath = extracted.filePath; - line = extracted.line; - } - } - let message; - if (typeof failure !== 'string' && failure.$) { - message = failure.$.message; - if (failure.$.type) { - message = message ? `${failure.$.type}: ${message}` : failure.$.type; - } - } - return { - path: filePath, - line, - details, - message - }; - } - extractFileAndLine(details) { - // PHPUnit stack traces typically have format: /path/to/file.php:123 - const lines = details.split(/\r?\n/); - for (const str of lines) { - // Match patterns like /path/to/file.php:123 or at /path/to/file.php(123) - const matchColon = str.match(/((?:[A-Za-z]:)?[^\s:()]+?\.(?:php|phpt)):(\d+)/); - if (matchColon) { - const relativePath = this.getRelativePath(matchColon[1]); - if (this.trackedFiles.has(relativePath)) { - return { filePath: relativePath, line: parseInt(matchColon[2]) }; - } - } - const matchParen = str.match(/((?:[A-Za-z]:)?[^\s:()]+?\.(?:php|phpt))\((\d+)\)/); - if (matchParen) { - const relativePath = this.getRelativePath(matchParen[1]); - if (this.trackedFiles.has(relativePath)) { - return { filePath: relativePath, line: parseInt(matchParen[2]) }; - } - } - } - return undefined; - } - /** - * Converts an absolute file path to a relative path by stripping the working directory prefix. - * - * @param path - The absolute file path from PHPUnit output (e.g., `/home/runner/work/repo/src/Test.php`) - * @returns The relative path (e.g., `src/Test.php`) if a working directory can be determined, - * otherwise returns the normalized original path - */ - getRelativePath(path) { - path = (0, path_utils_1.normalizeFilePath)(path); - const workDir = this.getWorkDir(path); - if (workDir !== undefined && path.startsWith(workDir)) { - path = path.substring(workDir.length); - } - return path; - } - /** - * Determines the working directory prefix to strip from absolute file paths. - * - * The working directory is resolved using the following priority: - * - * 1. **Explicit configuration** - If `options.workDir` is set, it takes precedence. - * This allows users to explicitly specify the working directory. - * - * 2. **Cached assumption** - If we've previously determined a working directory - * (`assumedWorkDir`) and the current path starts with it, we reuse that value. - * This avoids redundant computation for subsequent paths. - * - * 3. **Heuristic detection** - Uses `getBasePath()` to find the common prefix between - * the absolute path and the list of tracked files in the repository. For example: - * - Absolute path: `/home/runner/work/repo/src/Test.php` - * - Tracked file: `src/Test.php` - * - Detected workDir: `/home/runner/work/repo/` - * - * Once detected, the working directory is cached in `assumedWorkDir` for efficiency. - * - * @param path - The normalized absolute file path to analyze - * @returns The working directory prefix (with trailing slash), or `undefined` if it cannot be determined - * - * @example - * // With tracked file 'src/Foo.php' and path '/home/runner/work/repo/src/Foo.php' - * // Returns: '/home/runner/work/repo/' - */ - getWorkDir(path) { - if (this.options.workDir) { - return this.options.workDir; - } - if (this.assumedWorkDir && path.startsWith(this.assumedWorkDir)) { - return this.assumedWorkDir; - } - const basePath = (0, path_utils_1.getBasePath)(path, this.trackedFilesList); - if (basePath !== undefined) { - this.assumedWorkDir = basePath; - } - return basePath; - } -} -exports.PhpunitJunitParser = PhpunitJunitParser; - - -/***/ }), - -/***/ 6578: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PythonXunitParser = void 0; -const java_junit_parser_1 = __nccwpck_require__(8342); -class PythonXunitParser extends java_junit_parser_1.JavaJunitParser { - options; - constructor(options) { - super(options); - this.options = options; - } -} -exports.PythonXunitParser = PythonXunitParser; - - -/***/ }), - -/***/ 9768: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.RspecJsonParser = void 0; -const test_results_1 = __nccwpck_require__(613); -class RspecJsonParser { - options; - assumedWorkDir; - constructor(options) { - this.options = options; - } - async parse(path, content) { - const mocha = this.getRspecJson(path, content); - const result = this.getTestRunResult(path, mocha); - result.sort(true); - return Promise.resolve(result); - } - getRspecJson(path, content) { - try { - return JSON.parse(content); - } - catch (e) { - throw new Error(`Invalid JSON at ${path}\n\n${e}`); - } - } - getTestRunResult(resultsPath, rspec) { - const suitesMap = {}; - const getSuite = (test) => { - const path = test.file_path; - return suitesMap[path] ?? (suitesMap[path] = new test_results_1.TestSuiteResult(path, [])); - }; - for (const test of rspec.examples) { - const suite = getSuite(test); - if (test.status === 'failed') { - this.processTest(suite, test, 'failed'); - } - else if (test.status === 'passed') { - this.processTest(suite, test, 'success'); - } - else if (test.status === 'pending') { - this.processTest(suite, test, 'skipped'); - } - } - const suites = Object.values(suitesMap); - return new test_results_1.TestRunResult(resultsPath, suites, rspec.summary.duration); - } - processTest(suite, test, result) { - const groupName = test.full_description !== test.description - ? test.full_description.substring(0, test.full_description.length - test.description.length).trimEnd() - : null; - let group = suite.groups.find(grp => grp.name === groupName); - if (group === undefined) { - group = new test_results_1.TestGroupResult(groupName, []); - suite.groups.push(group); - } - const error = this.getTestCaseError(test); - const testCase = new test_results_1.TestCaseResult(test.full_description, result, test.run_time ?? 0, error); - group.tests.push(testCase); - } - getTestCaseError(test) { - const backtrace = test.exception?.backtrace; - const message = test.exception?.message; - if (backtrace === undefined) { - return undefined; - } - let path; - let line; - const details = backtrace.join('\n'); - const src = this.getExceptionSource(backtrace); - if (src) { - path = src.path; - line = src.line; - } - return { - path, - line, - message, - details - }; - } - getExceptionSource(backtrace) { - const re = /^(.*?):(\d+):/; - for (const str of backtrace) { - const match = str.match(re); - if (match !== null) { - const [_, path, lineStr] = match; - if (path.startsWith('./')) { - const line = parseInt(lineStr); - return { path, line }; - } - } - } - return undefined; - } -} -exports.RspecJsonParser = RspecJsonParser; - - -/***/ }), - -/***/ 7330: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SwiftXunitParser = void 0; -const java_junit_parser_1 = __nccwpck_require__(8342); -class SwiftXunitParser extends java_junit_parser_1.JavaJunitParser { - options; - constructor(options) { - super(options); - this.options = options; - } -} -exports.SwiftXunitParser = SwiftXunitParser; - - -/***/ }), - -/***/ 7816: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (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 () { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function (o) { - var ar = []; - for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys(o); - }; - return function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); - __setModuleDefault(result, mod); - return result; - }; -})(); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NetteTesterJunitParser = void 0; -const path = __importStar(__nccwpck_require__(6928)); -const xml2js_1 = __nccwpck_require__(758); -const path_utils_1 = __nccwpck_require__(6751); -const test_results_1 = __nccwpck_require__(613); -class NetteTesterJunitParser { - options; - trackedFiles; - trackedFilesList; - constructor(options) { - this.options = options; - this.trackedFilesList = options.trackedFiles.map(f => (0, path_utils_1.normalizeFilePath)(f)); - this.trackedFiles = new Set(this.trackedFilesList); - } - async parse(filePath, content) { - const reportOrSuite = await this.getNetteTesterReport(filePath, content); - const isReport = reportOrSuite.testsuites !== undefined; - // XML might contain: - // - multiple suites under root node - // - single as root node - let report; - if (isReport) { - report = reportOrSuite; - } - else { - // Make it behave the same way as if suite was inside root node - const suite = reportOrSuite.testsuite; - report = { - testsuites: { - $: { time: suite.$.time }, - testsuite: [suite] - } - }; - } - return this.getTestRunResult(filePath, report); - } - async getNetteTesterReport(filePath, content) { - try { - return await (0, xml2js_1.parseStringPromise)(content); - } - catch (e) { - throw new Error(`Invalid XML at ${filePath}\n\n${e}`); - } - } - getTestRunResult(filePath, report) { - const suites = report.testsuites.testsuite === undefined - ? [] - : report.testsuites.testsuite.map((ts, index) => { - // Use report file name as suite name (user preference) - const fileName = path.basename(filePath); - // If there are multiple test suites, add index to distinguish them - const name = report.testsuites.testsuite && report.testsuites.testsuite.length > 1 - ? `${fileName} #${index + 1}` - : fileName; - const time = parseFloat(ts.$.time) * 1000; - const sr = new test_results_1.TestSuiteResult(name, this.getGroups(ts), time); - return sr; - }); - const seconds = parseFloat(report.testsuites.$?.time ?? ''); - const time = isNaN(seconds) ? undefined : seconds * 1000; - return new test_results_1.TestRunResult(filePath, suites, time); - } - getGroups(suite) { - if (!suite.testcase || suite.testcase.length === 0) { - return []; - } - // Group tests by directory structure - const groups = new Map(); - for (const tc of suite.testcase) { - const parsed = this.parseTestCaseName(tc.$.classname); - const directory = path.dirname(parsed.filePath); - if (!groups.has(directory)) { - groups.set(directory, []); - } - groups.get(directory).push(tc); - } - return Array.from(groups.entries()).map(([dir, tests]) => { - const testResults = tests.map(tc => { - const parsed = this.parseTestCaseName(tc.$.classname); - const result = this.getTestCaseResult(tc); - const time = parseFloat(tc.$.time || '0') * 1000; - const error = this.getTestCaseError(tc, parsed.filePath); - return new test_results_1.TestCaseResult(parsed.displayName, result, time, error); - }); - return new test_results_1.TestGroupResult(dir, testResults); - }); - } - /** - * Parse test case name from classname attribute. - * - * Handles multiple patterns: - * 1. Simple: "tests/Framework/Assert.equal.phpt" - * 2. With method: "tests/Framework/Assert.equal.recursive.phpt [method=testSimple]" - * 3. With description: "Prevent loop in error handling. The #268 regression. | tests/Framework/TestCase.ownErrorHandler.phpt" - * 4. With class and method: "Kdyby\BootstrapFormRenderer\BootstrapRenderer. | KdybyTests/BootstrapFormRenderer/BootstrapRendererTest.phpt [method=testRenderingBasics]" - */ - parseTestCaseName(classname) { - let filePath = classname; - let method; - let description; - let className; - // Pattern: "Description | filepath [method=methodName]" - // or "ClassName | filepath [method=methodName]" - const pipePattern = /^(.+?)\s*\|\s*(.+?)(?:\s*\[method=(.+?)\])?$/; - const pipeMatch = classname.match(pipePattern); - if (pipeMatch) { - const prefix = pipeMatch[1].trim(); - filePath = pipeMatch[2].trim(); - method = pipeMatch[3]; - // Check if prefix looks like a class name (contains backslash AND ends with dot) - // Examples: "Kdyby\BootstrapFormRenderer\BootstrapRenderer." - // vs description: "Prevent loop in error handling. The #268 regression." - if (prefix.includes('\\') && prefix.endsWith('.')) { - className = prefix; - } - else { - description = prefix; - } - } - else { - // Pattern: "filepath [method=methodName]" - const methodPattern = /^(.+?)\s*\[method=(.+?)\]$/; - const methodMatch = classname.match(methodPattern); - if (methodMatch) { - filePath = methodMatch[1].trim(); - method = methodMatch[2].trim(); - } - } - // Generate display name - const baseName = path.basename(filePath); - let displayName = baseName; - if (method) { - displayName = `${baseName}::${method}`; - } - if (description) { - displayName = `${description} (${baseName})`; - } - else if (className && method) { - // For class names, keep them but still show the file - displayName = `${baseName}::${method}`; - } - return { filePath, method, description, className, displayName }; - } - getTestCaseResult(test) { - if (test.failure || test.error) - return 'failed'; - if (test.skipped) - return 'skipped'; - return 'success'; - } - getTestCaseError(tc, filePath) { - if (!this.options.parseErrors) { - return undefined; - } - // We process and the same way - const failures = tc.failure ?? tc.error; - if (!failures || failures.length === 0) { - return undefined; - } - const failure = failures[0]; - // For Nette Tester, details are in the message attribute, not as inner text - const details = typeof failure === 'string' ? failure : failure._ ?? failure.$?.message ?? ''; - // Try to extract file path and line from error details - let errorFilePath; - let line; - if (details) { - const extracted = this.extractFileAndLine(details); - if (extracted) { - errorFilePath = extracted.filePath; - line = extracted.line; - } - } - // Fallback: use test file path if tracked - if (!errorFilePath) { - const normalized = (0, path_utils_1.normalizeFilePath)(filePath); - if (this.trackedFiles.has(normalized)) { - errorFilePath = normalized; - } - } - let message; - if (typeof failure !== 'string' && failure.$) { - message = failure.$.message; - if (failure.$.type) { - message = message ? `${failure.$.type}: ${message}` : failure.$.type; - } - } - return { - path: errorFilePath, - line, - details, - message - }; - } - /** - * Extract file path and line number from error details. - * Matches patterns like: /path/to/file.phpt:123 or /path/to/file.php:456 - */ - extractFileAndLine(details) { - const lines = details.split(/\r?\n/); - for (const str of lines) { - // Match PHP file patterns: /path/to/file.phpt:123 or /path/to/file.php:456 - const match = str.match(/((?:[A-Za-z]:)?[^\s:()]+?\.(?:php|phpt)):(\d+)/); - if (match) { - const normalized = (0, path_utils_1.normalizeFilePath)(match[1]); - if (this.trackedFiles.has(normalized)) { - return { filePath: normalized, line: parseInt(match[2]) }; - } - } - } - return undefined; - } -} -exports.NetteTesterJunitParser = NetteTesterJunitParser; - - -/***/ }), - -/***/ 4400: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getAnnotations = getAnnotations; -const markdown_utils_1 = __nccwpck_require__(5129); -const parse_utils_1 = __nccwpck_require__(9633); -function getAnnotations(results, maxCount) { - if (maxCount === 0) { - return []; - } - // Collect errors from TestRunResults - // Merge duplicates if there are more test results files processed - const errors = []; - const mergeDup = results.length > 1; - for (const tr of results) { - for (const ts of tr.suites) { - for (const tg of ts.groups) { - for (const tc of tg.tests) { - const err = tc.error; - if (err === undefined) { - continue; - } - const path = err.path ?? tr.path; - const line = err.line ?? 0; - if (mergeDup) { - const dup = errors.find(e => path === e.path && line === e.line && err.details === e.details); - if (dup !== undefined) { - dup.testRunPaths.push(tr.path); - continue; - } - } - errors.push({ - testRunPaths: [tr.path], - suiteName: ts.name, - testName: tg.name ? `${tg.name} ► ${tc.name}` : tc.name, - details: err.details, - message: err.message ?? (0, parse_utils_1.getFirstNonEmptyLine)(err.details) ?? 'Test failed', - path, - line - }); - } - } - } - } - // Limit number of created annotations - errors.splice(maxCount + 1); - const annotations = errors.map(e => { - const message = [ - 'Failed test found in:', - e.testRunPaths.map(p => ` ${p}`).join('\n'), - 'Error:', - ident((0, markdown_utils_1.fixEol)(e.message), ' ') - ].join('\n'); - return enforceCheckRunLimits({ - path: e.path, - start_line: e.line, - end_line: e.line, - annotation_level: 'failure', - title: `${e.suiteName} ► ${e.testName}`, - raw_details: (0, markdown_utils_1.fixEol)(e.details), - message - }); - }); - return annotations; -} -function enforceCheckRunLimits(err) { - err.title = (0, markdown_utils_1.ellipsis)(err.title || '', 255); - err.message = (0, markdown_utils_1.ellipsis)(err.message, 65535); - if (err.raw_details) { - err.raw_details = (0, markdown_utils_1.ellipsis)(err.raw_details, 65535); - } - return err; -} -function ident(text, prefix) { - return text - .split(/\n/g) - .map(line => prefix + line) - .join('\n'); -} - - -/***/ }), - -/***/ 7070: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (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 () { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function (o) { - var ar = []; - for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys(o); - }; - return function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); - __setModuleDefault(result, mod); - return result; - }; -})(); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DEFAULT_OPTIONS = void 0; -exports.getReport = getReport; -exports.getBadge = getBadge; -const core = __importStar(__nccwpck_require__(7484)); -const markdown_utils_1 = __nccwpck_require__(5129); -const node_utils_1 = __nccwpck_require__(5384); -const parse_utils_1 = __nccwpck_require__(9633); -const slugger_1 = __nccwpck_require__(9537); -const MAX_REPORT_LENGTH = 65535; -const MAX_ACTIONS_SUMMARY_LENGTH = 1048576; -exports.DEFAULT_OPTIONS = { - listSuites: 'all', - listTests: 'all', - baseUrl: '', - onlySummary: false, - useActionsSummary: true, - badgeTitle: 'tests', - reportTitle: '', - collapsed: 'auto' -}; -function getReport(results, options = exports.DEFAULT_OPTIONS, shortSummary = '') { - applySort(results); - const opts = { ...options }; - let lines = renderReport(results, opts, shortSummary); - let report = lines.join('\n'); - if (getByteLength(report) <= getMaxReportLength(options)) { - return report; - } - if (opts.listTests === 'all') { - core.info("Test report summary is too big - setting 'listTests' to 'failed'"); - opts.listTests = 'failed'; - lines = renderReport(results, opts, shortSummary); - report = lines.join('\n'); - if (getByteLength(report) <= getMaxReportLength(options)) { - return report; - } - } - core.warning(`Test report summary exceeded limit of ${getMaxReportLength(options)} bytes and will be trimmed`); - return trimReport(lines, options); -} -function getMaxReportLength(options = exports.DEFAULT_OPTIONS) { - return options.useActionsSummary ? MAX_ACTIONS_SUMMARY_LENGTH : MAX_REPORT_LENGTH; -} -function trimReport(lines, options) { - const closingBlock = '```'; - const errorMsg = `**Report exceeded GitHub limit of ${getMaxReportLength(options)} bytes and has been trimmed**`; - const maxErrorMsgLength = closingBlock.length + errorMsg.length + 2; - const maxReportLength = getMaxReportLength(options) - maxErrorMsgLength; - let reportLength = 0; - let codeBlock = false; - let endLineIndex = 0; - for (endLineIndex = 0; endLineIndex < lines.length; endLineIndex++) { - const line = lines[endLineIndex]; - const lineLength = getByteLength(line); - reportLength += lineLength + 1; - if (reportLength > maxReportLength) { - break; - } - if (line === '```') { - codeBlock = !codeBlock; - } - } - const reportLines = lines.slice(0, endLineIndex); - if (codeBlock) { - reportLines.push('```'); - } - reportLines.push(errorMsg); - return reportLines.join('\n'); -} -function applySort(results) { - results.sort((a, b) => a.path.localeCompare(b.path, node_utils_1.DEFAULT_LOCALE)); - for (const res of results) { - res.suites.sort((a, b) => a.name.localeCompare(b.name, node_utils_1.DEFAULT_LOCALE)); - } -} -function getByteLength(text) { - return Buffer.byteLength(text, 'utf8'); -} -function renderReport(results, options, shortSummary) { - const sections = []; - const reportTitle = options.reportTitle.trim(); - if (reportTitle) { - sections.push(`# ${reportTitle}`); - } - if (shortSummary) { - sections.push(`## ${shortSummary}`); - } - const badge = getReportBadge(results, options); - sections.push(badge); - const runs = getTestRunsReport(results, options); - sections.push(...runs); - return sections; -} -function getReportBadge(results, options) { - const passed = results.reduce((sum, tr) => sum + tr.passed, 0); - const skipped = results.reduce((sum, tr) => sum + tr.skipped, 0); - const failed = results.reduce((sum, tr) => sum + tr.failed, 0); - return getBadge(passed, failed, skipped, options); -} -function getBadge(passed, failed, skipped, options) { - const text = []; - if (passed > 0) { - text.push(`${passed} passed`); - } - if (failed > 0) { - text.push(`${failed} failed`); - } - if (skipped > 0) { - text.push(`${skipped} skipped`); - } - const message = text.length > 0 ? text.join(', ') : 'none'; - let color = 'success'; - if (failed > 0) { - color = 'critical'; - } - else if (passed === 0 && failed === 0) { - color = 'yellow'; - } - const hint = failed > 0 ? 'Tests failed' : 'Tests passed successfully'; - const encodedBadgeTitle = encodeImgShieldsURIComponent(options.badgeTitle); - const encodedMessage = encodeImgShieldsURIComponent(message); - const encodedColor = encodeImgShieldsURIComponent(color); - return `![${hint}](https://img.shields.io/badge/${encodedBadgeTitle}-${encodedMessage}-${encodedColor})`; -} -function getTestRunsReport(testRuns, options) { - const sections = []; - const totalFailed = testRuns.reduce((sum, tr) => sum + tr.failed, 0); - // Determine if report should be collapsed based on collapsed option - const shouldCollapse = options.collapsed === 'always' || (options.collapsed === 'auto' && totalFailed === 0); - if (shouldCollapse) { - sections.push(`
Expand for details`); - sections.push(` `); - } - if (testRuns.length > 0 || options.onlySummary) { - const tableData = testRuns - .map((tr, originalIndex) => ({ tr, originalIndex })) - .filter(({ tr }) => tr.passed > 0 || tr.failed > 0 || tr.skipped > 0) - .map(({ tr, originalIndex }) => { - const time = (0, markdown_utils_1.formatTime)(tr.time); - const name = tr.path; - const addr = options.baseUrl + makeRunSlug(originalIndex, options).link; - const nameLink = (0, markdown_utils_1.link)(name, addr); - const passed = tr.passed > 0 ? `${tr.passed} ${markdown_utils_1.Icon.success}` : ''; - const failed = tr.failed > 0 ? `${tr.failed} ${markdown_utils_1.Icon.fail}` : ''; - const skipped = tr.skipped > 0 ? `${tr.skipped} ${markdown_utils_1.Icon.skip}` : ''; - return [nameLink, passed, failed, skipped, time]; - }); - const resultsTable = (0, markdown_utils_1.table)(['Report', 'Passed', 'Failed', 'Skipped', 'Time'], [markdown_utils_1.Align.Left, markdown_utils_1.Align.Right, markdown_utils_1.Align.Right, markdown_utils_1.Align.Right, markdown_utils_1.Align.Right], ...tableData); - sections.push(resultsTable); - } - if (options.onlySummary === false) { - const suitesReports = testRuns.map((tr, i) => getSuitesReport(tr, i, options)).flat(); - sections.push(...suitesReports); - } - if (shouldCollapse) { - sections.push(`
`); - } - return sections; -} -function getSuitesReport(tr, runIndex, options) { - const sections = []; - const suites = options.listSuites === 'failed' ? tr.failedSuites : tr.suites; - if (options.listSuites !== 'none') { - const trSlug = makeRunSlug(runIndex, options); - const nameLink = `${tr.path}`; - const icon = getResultIcon(tr.result); - sections.push(`## ${icon}\xa0${nameLink}`); - const time = (0, markdown_utils_1.formatTime)(tr.time); - const headingLine2 = tr.tests > 0 - ? `**${tr.tests}** tests were completed in **${time}** with **${tr.passed}** passed, **${tr.failed}** failed and **${tr.skipped}** skipped.` - : 'No tests found'; - sections.push(headingLine2); - if (suites.length > 0) { - const suitesTable = (0, markdown_utils_1.table)(['Test suite', 'Passed', 'Failed', 'Skipped', 'Time'], [markdown_utils_1.Align.Left, markdown_utils_1.Align.Right, markdown_utils_1.Align.Right, markdown_utils_1.Align.Right, markdown_utils_1.Align.Right], ...suites.map((s, suiteIndex) => { - const tsTime = (0, markdown_utils_1.formatTime)(s.time); - const tsName = s.name; - const skipLink = options.listTests === 'none' || (options.listTests === 'failed' && s.result !== 'failed'); - const tsAddr = options.baseUrl + makeSuiteSlug(runIndex, suiteIndex, options).link; - const tsNameLink = skipLink ? tsName : (0, markdown_utils_1.link)(tsName, tsAddr); - const passed = s.passed > 0 ? `${s.passed} ${markdown_utils_1.Icon.success}` : ''; - const failed = s.failed > 0 ? `${s.failed} ${markdown_utils_1.Icon.fail}` : ''; - const skipped = s.skipped > 0 ? `${s.skipped} ${markdown_utils_1.Icon.skip}` : ''; - return [tsNameLink, passed, failed, skipped, tsTime]; - })); - sections.push(suitesTable); - } - } - if (options.listTests !== 'none') { - const tests = suites.map((ts, suiteIndex) => getTestsReport(ts, runIndex, suiteIndex, options)).flat(); - if (tests.length > 1) { - sections.push(...tests); - } - } - return sections; -} -function getTestsReport(ts, runIndex, suiteIndex, options) { - if (options.listTests === 'failed' && ts.result !== 'failed') { - return []; - } - const groups = ts.groups; - if (groups.length === 0) { - return []; - } - const sections = []; - const tsName = ts.name; - const tsSlug = makeSuiteSlug(runIndex, suiteIndex, options); - const tsNameLink = `${tsName}`; - const icon = getResultIcon(ts.result); - sections.push(`### ${icon}\xa0${tsNameLink}`); - sections.push('```'); - for (const grp of groups) { - if (grp.name) { - sections.push(grp.name); - } - const space = grp.name ? ' ' : ''; - for (const tc of grp.tests) { - if (options.listTests === 'failed' && tc.result !== 'failed') { - continue; - } - const result = getResultIcon(tc.result); - sections.push(`${space}${result} ${tc.name}`); - if (tc.error) { - const lines = (tc.error.message ?? (0, parse_utils_1.getFirstNonEmptyLine)(tc.error.details)?.trim()) - ?.split(/\r?\n/g) - .map(l => '\t' + l); - if (lines) { - sections.push(...lines); - } - } - } - } - sections.push('```'); - return sections; -} -function makeRunSlug(runIndex, options) { - // use prefix to avoid slug conflicts after escaping the paths - return (0, slugger_1.slug)(`r${runIndex}`, options); -} -function makeSuiteSlug(runIndex, suiteIndex, options) { - // use prefix to avoid slug conflicts after escaping the paths - return (0, slugger_1.slug)(`r${runIndex}s${suiteIndex}`, options); -} -function getResultIcon(result) { - switch (result) { - case 'success': - return markdown_utils_1.Icon.success; - case 'skipped': - return markdown_utils_1.Icon.skip; - case 'failed': - return markdown_utils_1.Icon.fail; - default: - return ''; - } -} -function encodeImgShieldsURIComponent(component) { - return encodeURIComponent(component).replace(/-/g, '--').replace(/_/g, '__'); -} - - -/***/ }), - -/***/ 613: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.TestCaseResult = exports.TestGroupResult = exports.TestSuiteResult = exports.TestRunResult = void 0; -const node_utils_1 = __nccwpck_require__(5384); -class TestRunResult { - path; - suites; - totalTime; - constructor(path, suites, totalTime) { - this.path = path; - this.suites = suites; - this.totalTime = totalTime; - } - get tests() { - return this.suites.reduce((sum, g) => sum + g.tests, 0); - } - get passed() { - return this.suites.reduce((sum, g) => sum + g.passed, 0); - } - get failed() { - return this.suites.reduce((sum, g) => sum + g.failed, 0); - } - get skipped() { - return this.suites.reduce((sum, g) => sum + g.skipped, 0); - } - get time() { - return this.totalTime ?? this.suites.reduce((sum, g) => sum + g.time, 0); - } - get result() { - return this.suites.some(t => t.result === 'failed') ? 'failed' : 'success'; - } - get failedSuites() { - return this.suites.filter(s => s.result === 'failed'); - } - sort(deep) { - this.suites.sort((a, b) => a.name.localeCompare(b.name, node_utils_1.DEFAULT_LOCALE)); - if (deep) { - for (const suite of this.suites) { - suite.sort(deep); - } - } - } -} -exports.TestRunResult = TestRunResult; -class TestSuiteResult { - name; - groups; - totalTime; - constructor(name, groups, totalTime) { - this.name = name; - this.groups = groups; - this.totalTime = totalTime; - } - get tests() { - return this.groups.reduce((sum, g) => sum + g.tests.length, 0); - } - get passed() { - return this.groups.reduce((sum, g) => sum + g.passed, 0); - } - get failed() { - return this.groups.reduce((sum, g) => sum + g.failed, 0); - } - get skipped() { - return this.groups.reduce((sum, g) => sum + g.skipped, 0); - } - get time() { - return this.totalTime ?? this.groups.reduce((sum, g) => sum + g.time, 0); - } - get result() { - return this.groups.some(t => t.result === 'failed') ? 'failed' : 'success'; - } - get failedGroups() { - return this.groups.filter(grp => grp.result === 'failed'); - } - sort(deep) { - this.groups.sort((a, b) => (a.name ?? '').localeCompare(b.name ?? '', node_utils_1.DEFAULT_LOCALE)); - if (deep) { - for (const grp of this.groups) { - grp.sort(); - } - } - } -} -exports.TestSuiteResult = TestSuiteResult; -class TestGroupResult { - name; - tests; - constructor(name, tests) { - this.name = name; - this.tests = tests; - } - get passed() { - return this.tests.reduce((sum, t) => (t.result === 'success' ? sum + 1 : sum), 0); - } - get failed() { - return this.tests.reduce((sum, t) => (t.result === 'failed' ? sum + 1 : sum), 0); - } - get skipped() { - return this.tests.reduce((sum, t) => (t.result === 'skipped' ? sum + 1 : sum), 0); - } - get time() { - return this.tests.reduce((sum, t) => sum + t.time, 0); - } - get result() { - return this.tests.some(t => t.result === 'failed') ? 'failed' : 'success'; - } - get failedTests() { - return this.tests.filter(tc => tc.result === 'failed'); - } - sort() { - this.tests.sort((a, b) => a.name.localeCompare(b.name, node_utils_1.DEFAULT_LOCALE)); - } -} -exports.TestGroupResult = TestGroupResult; -class TestCaseResult { - name; - result; - time; - error; - constructor(name, result, time, error) { - this.name = name; - this.result = result; - this.time = time; - this.error = error; - } -} -exports.TestCaseResult = TestCaseResult; - - -/***/ }), - -/***/ 5454: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (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 () { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function (o) { - var ar = []; - for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys(o); - }; - return function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); - __setModuleDefault(result, mod); - return result; - }; -})(); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.listFiles = listFiles; -const core = __importStar(__nccwpck_require__(7484)); -const exec_1 = __nccwpck_require__(5236); -async function listFiles() { - core.startGroup('Listing all files tracked by git'); - let output = ''; - try { - output = (await (0, exec_1.getExecOutput)('git', ['ls-files', '-z'])).stdout; - } - finally { - fixStdOutNullTermination(); - core.endGroup(); - } - return output.split('\u0000').filter(s => s.length > 0); -} -function fixStdOutNullTermination() { - // Previous command uses NULL as delimiters and output is printed to stdout. - // We have to make sure next thing written to stdout will start on new line. - // Otherwise things like ::set-output wouldn't work. - core.info(''); -} - - -/***/ }), - -/***/ 6667: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (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 () { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function (o) { - var ar = []; - for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys(o); - }; - return function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); - __setModuleDefault(result, mod); - return result; - }; -})(); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getCheckRunContext = getCheckRunContext; -exports.downloadArtifact = downloadArtifact; -exports.listFiles = listFiles; -const fs_1 = __nccwpck_require__(9896); -const promises_1 = __nccwpck_require__(9786); -const stream_1 = __nccwpck_require__(2203); -const core = __importStar(__nccwpck_require__(7484)); -const github = __importStar(__nccwpck_require__(3228)); -function getCheckRunContext() { - if (github.context.eventName === 'workflow_run') { - core.info('Action was triggered by workflow_run: using SHA and RUN_ID from triggering workflow'); - const event = github.context.payload; - if (!event.workflow_run) { - throw new Error("Event of type 'workflow_run' is missing 'workflow_run' field"); - } - const prs = event.workflow_run.pull_requests ?? []; - // For `workflow_run`, we want to report against the PR commit when possible so annotations land - // on the contributor's changes. Prefer the PR whose `head.ref` matches `workflow_run.head_branch`, - // then fall back to the first PR head SHA, and finally to `workflow_run.head_sha` for non-PR runs. - const prShaMatch = prs.find(pr => pr.head?.ref === event.workflow_run.head_branch)?.head?.sha; - const prShaFirst = prs[0]?.head?.sha; - const sha = prShaMatch ?? prShaFirst ?? event.workflow_run.head_sha; - if (!sha) { - throw new Error('Unable to resolve SHA from workflow_run (no PR head.sha or head_sha)'); - } - return { - sha, - runId: event.workflow_run.id - }; - } - const runId = github.context.runId; - if (github.context.payload.pull_request) { - core.info(`Action was triggered by ${github.context.eventName}: using SHA from head of source branch`); - const pr = github.context.payload.pull_request; - return { sha: pr.head.sha, runId }; - } - return { sha: github.context.sha, runId }; -} -async function downloadArtifact(octokit, artifactId, fileName, token) { - core.startGroup(`Downloading artifact ${fileName}`); - try { - core.info(`Artifact ID: ${artifactId}`); - const req = octokit.rest.actions.downloadArtifact.endpoint({ - ...github.context.repo, - artifact_id: artifactId, - archive_format: 'zip' - }); - const response = await fetch(req.url, { - headers: { Authorization: `Bearer ${token}` }, - redirect: 'follow' - }); - if (!response.ok) { - throw new Error(`Download failed: ${response.status} ${response.statusText}`); - } - if (!response.body) { - throw new Error('Response body is empty'); - } - core.info(`Downloading from ${response.url}`); - const readable = stream_1.Readable.fromWeb(response.body); - const fileWriterStream = (0, fs_1.createWriteStream)(fileName); - let transferred = 0; - const progress = new stream_1.Transform({ - transform(chunk, _encoding, callback) { - transferred += chunk.length; - core.info(`Progress: ${transferred} B`); - callback(null, chunk); - } - }); - await (0, promises_1.pipeline)(readable, progress, fileWriterStream); - } - finally { - core.endGroup(); - } -} -async function listFiles(octokit, sha) { - core.startGroup('Fetching list of tracked files from GitHub'); - try { - const commit = await octokit.rest.git.getCommit({ - commit_sha: sha, - ...github.context.repo - }); - const files = await listGitTree(octokit, commit.data.tree.sha, ''); - return files; - } - finally { - core.endGroup(); - } -} -async function listGitTree(octokit, sha, path) { - const pathLog = path ? ` at ${path}` : ''; - core.info(`Fetching tree ${sha}${pathLog}`); - let truncated = false; - let tree = await octokit.rest.git.getTree({ - recursive: 'true', - tree_sha: sha, - ...github.context.repo - }); - if (tree.data.truncated) { - truncated = true; - tree = await octokit.rest.git.getTree({ - tree_sha: sha, - ...github.context.repo - }); - } - const result = []; - for (const tr of tree.data.tree) { - const file = `${path}${tr.path}`; - if (tr.type === 'blob') { - result.push(file); - } - else if (tr.type === 'tree' && truncated) { - const files = await listGitTree(octokit, tr.sha, `${file}/`); - result.push(...files); - } - } - return result; -} - - -/***/ }), - -/***/ 5129: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Icon = exports.Align = void 0; -exports.link = link; -exports.table = table; -exports.tableEscape = tableEscape; -exports.fixEol = fixEol; -exports.ellipsis = ellipsis; -exports.formatTime = formatTime; -var Align; -(function (Align) { - Align["Left"] = ":---"; - Align["Center"] = ":---:"; - Align["Right"] = "---:"; - Align["None"] = "---"; -})(Align || (exports.Align = Align = {})); -exports.Icon = { - skip: '⚪', // ':white_circle:' - success: '✅', // ':white_check_mark:' - fail: '❌' // ':x:' -}; -function link(title, address) { - return `[${title}](${address})`; -} -function table(headers, align, ...rows) { - const headerRow = `|${headers.map(tableEscape).join('|')}|`; - const alignRow = `|${align.join('|')}|`; - const contentRows = rows.map(row => `|${row.map(tableEscape).join('|')}|`).join('\n'); - return [headerRow, alignRow, contentRows].join('\n'); -} -function tableEscape(content) { - return content.toString().replace('|', '\\|'); -} -function fixEol(text) { - return text?.replace(/\r/g, '') ?? ''; -} -function ellipsis(text, maxLength) { - if (text.length <= maxLength) { - return text; - } - return text.substring(0, maxLength - 3) + '...'; -} -function formatTime(ms) { - if (ms > 1000) { - return `${Math.round(ms / 1000)}s`; - } - return `${Math.round(ms)}ms`; -} - - -/***/ }), - -/***/ 5384: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DEFAULT_LOCALE = void 0; -exports.getExceptionSource = getExceptionSource; -const path_utils_1 = __nccwpck_require__(6751); -exports.DEFAULT_LOCALE = 'en-US'; -function getExceptionSource(stackTrace, trackedFiles, getRelativePath) { - const lines = stackTrace.split(/\r?\n/); - const re = /\((.*):(\d+):\d+\)$/; - for (const str of lines) { - const match = str.match(re); - if (match !== null) { - const [_, fileStr, lineStr] = match; - const filePath = (0, path_utils_1.normalizeFilePath)(fileStr); - if (filePath.startsWith('internal/') || filePath.includes('/node_modules/')) { - continue; - } - const path = getRelativePath(filePath); - if (!path) { - continue; - } - if (trackedFiles.includes(path)) { - const line = parseInt(lineStr); - return { path, line }; - } - } - } -} - - -/***/ }), - -/***/ 9633: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.parseNetDuration = parseNetDuration; -exports.parseIsoDate = parseIsoDate; -exports.getFirstNonEmptyLine = getFirstNonEmptyLine; -function parseNetDuration(str) { - const durationRe = /^(\d\d):(\d\d):(\d\d(?:\.\d+)?)$/; - const durationMatch = str.match(durationRe); - if (durationMatch === null) { - throw new Error(`Invalid format: "${str}" is not NET duration`); - } - const [_, hourStr, minStr, secStr] = durationMatch; - return (parseInt(hourStr) * 3600 + parseInt(minStr) * 60 + parseFloat(secStr)) * 1000; -} -function parseIsoDate(str) { - const isoDateRe = /^\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z)$/; - if (str === undefined || !isoDateRe.test(str)) { - throw new Error(`Invalid format: "${str}" is not ISO date`); - } - return new Date(str); -} -function getFirstNonEmptyLine(stackTrace) { - const lines = stackTrace?.split(/\r?\n/g); - return lines?.find(str => !/^\s*$/.test(str)); -} - - -/***/ }), - -/***/ 6751: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.normalizeDirPath = normalizeDirPath; -exports.normalizeFilePath = normalizeFilePath; -exports.getBasePath = getBasePath; -function normalizeDirPath(path, addTrailingSlash) { - if (!path) { - return path; - } - path = normalizeFilePath(path); - if (addTrailingSlash && !path.endsWith('/')) { - path += '/'; - } - return path; -} -function normalizeFilePath(path) { - if (!path) { - return path; - } - return path.trim().replace(/\\/g, '/'); -} -function getBasePath(path, trackedFiles) { - if (trackedFiles.includes(path)) { - return ''; - } - let max = ''; - for (const file of trackedFiles) { - if (path.endsWith(file) && file.length > max.length) { - max = file; - } - } - if (max === '') { - return undefined; - } - const base = path.substring(0, path.length - max.length); - return base; -} - - -/***/ }), - -/***/ 9537: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.slug = slug; -function slug(name, options) { - const slugId = name - .trim() - .replace(/_/g, '') - .replace(/[./\\]/g, '-') - .replace(/[^\w-]/g, ''); - const id = `user-content-${slugId}`; - // When using the Action Summary for display, links must include the "user-content-" prefix. - const link = options.useActionsSummary ? `#${id}` : `#${slugId}`; - return { id, link }; -} - - -/***/ }), +import { createRequire as __WEBPACK_EXTERNAL_createRequire } from "module"; +/******/ var __webpack_modules__ = ({ /***/ 4914: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { -"use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -3351,7 +106,6 @@ function escapeProperty(s) { /***/ 7484: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { -"use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -3702,7 +456,6 @@ exports.platform = __importStar(__nccwpck_require__(8968)); /***/ 4753: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { -"use strict"; // For internal use, subject to change. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { @@ -3771,7 +524,6 @@ exports.prepareKeyValueMessage = prepareKeyValueMessage; /***/ 5306: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { -"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } @@ -3855,7 +607,6 @@ exports.OidcClient = OidcClient; /***/ 1976: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { -"use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -3924,7 +675,6 @@ exports.toPlatformPath = toPlatformPath; /***/ 8968: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { -"use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -4025,7 +775,6 @@ exports.getDetails = getDetails; /***/ 1847: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { -"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } @@ -4315,7 +1064,6 @@ exports.summary = _summary; /***/ 302: /***/ ((__unused_webpack_module, exports) => { -"use strict"; // We use any as a valid input type /* eslint-disable @typescript-eslint/no-explicit-any */ @@ -4362,7 +1110,6 @@ exports.toCommandProperties = toCommandProperties; /***/ 5236: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { -"use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -4472,7 +1219,6 @@ exports.getExecOutput = getExecOutput; /***/ 6665: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { -"use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -5097,7 +1843,6 @@ class ExecState extends events.EventEmitter { /***/ 1648: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.Context = void 0; @@ -5160,7 +1905,6 @@ exports.Context = Context; /***/ 3228: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { -"use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -5208,7 +1952,6 @@ exports.getOctokit = getOctokit; /***/ 5156: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { -"use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -5285,7 +2028,6 @@ exports.getApiBaseUrl = getApiBaseUrl; /***/ 8006: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { -"use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -5351,7 +2093,6 @@ exports.getOctokitOptions = getOctokitOptions; /***/ 4552: /***/ (function(__unused_webpack_module, exports) { -"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } @@ -5439,7 +2180,6 @@ exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHand /***/ 4844: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { -"use strict"; /* eslint-disable @typescript-eslint/no-explicit-any */ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { @@ -6102,7 +2842,6 @@ const lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCa /***/ 4988: /***/ ((__unused_webpack_module, exports) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.checkBypass = exports.getProxyUrl = void 0; @@ -6191,7 +2930,6 @@ function isLoopbackAddress(host) { /***/ 5207: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { -"use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -6381,7 +3119,6 @@ exports.getCmdPath = getCmdPath; /***/ 4994: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { -"use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; @@ -6687,7 +3424,6 @@ function copyFile(srcFile, destFile, force) { /***/ 2400: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0; @@ -6714,7 +3450,6 @@ exports.createFileSystemAdapter = createFileSystemAdapter; /***/ 2479: /***/ ((__unused_webpack_module, exports) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES = void 0; @@ -6739,7 +3474,6 @@ exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES = IS_MATCHED_BY_MAJOR || IS_MATCHED_B /***/ 7198: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.Settings = exports.scandirSync = exports.scandir = void 0; @@ -6773,7 +3507,6 @@ function getSettings(settingsOrOptions = {}) { /***/ 7299: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.readdir = exports.readdirWithFileTypes = exports.read = void 0; @@ -6885,7 +3618,6 @@ function callSuccessCallback(callback, result) { /***/ 8389: /***/ ((__unused_webpack_module, exports) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.joinPathSegments = void 0; @@ -6906,7 +3638,6 @@ exports.joinPathSegments = joinPathSegments; /***/ 7200: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.readdir = exports.readdirWithFileTypes = exports.read = void 0; @@ -6968,7 +3699,6 @@ exports.readdir = readdir; /***/ 2501: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const path = __nccwpck_require__(6928); @@ -7000,7 +3730,6 @@ exports["default"] = Settings; /***/ 5497: /***/ ((__unused_webpack_module, exports) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.createDirentFromStats = void 0; @@ -7027,7 +3756,6 @@ exports.createDirentFromStats = createDirentFromStats; /***/ 1144: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.fs = void 0; @@ -7040,7 +3768,6 @@ exports.fs = fs; /***/ 4368: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0; @@ -7065,7 +3792,6 @@ exports.createFileSystemAdapter = createFileSystemAdapter; /***/ 1470: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.statSync = exports.stat = exports.Settings = void 0; @@ -7099,7 +3825,6 @@ function getSettings(settingsOrOptions = {}) { /***/ 1539: /***/ ((__unused_webpack_module, exports) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.read = void 0; @@ -7143,7 +3868,6 @@ function callSuccessCallback(callback, result) { /***/ 6544: /***/ ((__unused_webpack_module, exports) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.read = void 0; @@ -7174,7 +3898,6 @@ exports.read = read; /***/ 4853: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const fs = __nccwpck_require__(4368); @@ -7198,7 +3921,6 @@ exports["default"] = Settings; /***/ 9337: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.Settings = exports.walkStream = exports.walkSync = exports.walk = void 0; @@ -7240,7 +3962,6 @@ function getSettings(settingsOrOptions = {}) { /***/ 1936: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const async_1 = __nccwpck_require__(1906); @@ -7278,7 +3999,6 @@ function callSuccessCallback(callback, entries) { /***/ 8986: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const stream_1 = __nccwpck_require__(2203); @@ -7320,7 +4040,6 @@ exports["default"] = StreamProvider; /***/ 8769: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const sync_1 = __nccwpck_require__(3431); @@ -7342,7 +4061,6 @@ exports["default"] = SyncProvider; /***/ 1906: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const events_1 = __nccwpck_require__(4434); @@ -7447,7 +4165,6 @@ exports["default"] = AsyncReader; /***/ 4449: /***/ ((__unused_webpack_module, exports) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.joinPathSegments = exports.replacePathSegmentSeparator = exports.isAppliedFilter = exports.isFatalError = void 0; @@ -7486,7 +4203,6 @@ exports.joinPathSegments = joinPathSegments; /***/ 5903: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const common = __nccwpck_require__(4449); @@ -7505,7 +4221,6 @@ exports["default"] = Reader; /***/ 3431: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const fsScandir = __nccwpck_require__(7198); @@ -7572,7 +4287,6 @@ exports["default"] = SyncReader; /***/ 244: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const path = __nccwpck_require__(6928); @@ -7606,7 +4320,6 @@ exports["default"] = Settings; /***/ 7864: /***/ ((module) => { -"use strict"; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; @@ -7691,7 +4404,6 @@ var createTokenAuth = function createTokenAuth2(token) { /***/ 1897: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; @@ -7860,7 +4572,6 @@ var Octokit = class { /***/ 4471: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; @@ -8244,7 +4955,6 @@ var endpoint = withDefaults(null, DEFAULTS); /***/ 7: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; @@ -8401,7 +5111,6 @@ function withCustomRequest(customRequest) { /***/ 8082: /***/ ((module) => { -"use strict"; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; @@ -8802,7 +5511,6 @@ paginateRest.VERSION = VERSION; /***/ 4935: /***/ ((module) => { -"use strict"; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; @@ -10972,7 +7680,6 @@ legacyRestEndpointMethods.VERSION = VERSION; /***/ 3708: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; var __create = Object.create; var __defProp = Object.defineProperty; @@ -11070,7 +7777,6 @@ var RequestError = class extends Error { /***/ 8636: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; @@ -12874,7 +9580,6 @@ module.exports = function (/*Buffer*/ inbuf, /*number*/ expectedLength) { /***/ 2689: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; // node crypt, we use it for generate salt @@ -14772,7 +11477,6 @@ function removeHook(state, name, method) { /***/ 748: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const stringify = __nccwpck_require__(3317); @@ -14950,7 +11654,6 @@ module.exports = braces; /***/ 1113: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const fill = __nccwpck_require__(877); @@ -15018,7 +11721,6 @@ module.exports = compile; /***/ 2477: /***/ ((module) => { -"use strict"; module.exports = { @@ -15083,7 +11785,6 @@ module.exports = { /***/ 5290: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const fill = __nccwpck_require__(877); @@ -15204,7 +11905,6 @@ module.exports = expand; /***/ 507: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const stringify = __nccwpck_require__(3317); @@ -15543,7 +12243,6 @@ module.exports = parse; /***/ 3317: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const utils = __nccwpck_require__(2257); @@ -15583,7 +12282,6 @@ module.exports = (ast, options = {}) => { /***/ 2257: /***/ ((__unused_webpack_module, exports) => { -"use strict"; exports.isInteger = num => { @@ -15713,7 +12411,6 @@ exports.flatten = (...args) => { /***/ 4150: /***/ ((__unused_webpack_module, exports) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); @@ -15741,7 +12438,6 @@ exports.Deprecation = Deprecation; /***/ 8188: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; var isGlob = __nccwpck_require__(1925); @@ -15791,7 +12487,6 @@ module.exports = function globParent(str, opts) { /***/ 5648: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const taskManager = __nccwpck_require__(6599); const async_1 = __nccwpck_require__(645); @@ -15901,7 +12596,6 @@ module.exports = FastGlob; /***/ 6599: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.convertPatternGroupToTask = exports.convertPatternGroupsToTasks = exports.groupPatternsByBaseDirectory = exports.getNegativePatternsAsPositive = exports.getPositivePatterns = exports.convertPatternsToTasks = exports.generate = void 0; @@ -16019,7 +12713,6 @@ exports.convertPatternGroupToTask = convertPatternGroupToTask; /***/ 645: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const async_1 = __nccwpck_require__(2907); @@ -16050,7 +12743,6 @@ exports["default"] = ProviderAsync; /***/ 3591: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const utils = __nccwpck_require__(6002); @@ -16120,7 +12812,6 @@ exports["default"] = DeepFilter; /***/ 4285: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const utils = __nccwpck_require__(6002); @@ -16213,7 +12904,6 @@ exports["default"] = EntryFilter; /***/ 1587: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const utils = __nccwpck_require__(6002); @@ -16236,7 +12926,6 @@ exports["default"] = ErrorFilter; /***/ 7827: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const utils = __nccwpck_require__(6002); @@ -16289,7 +12978,6 @@ exports["default"] = Matcher; /***/ 5740: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const matcher_1 = __nccwpck_require__(7827); @@ -16335,7 +13023,6 @@ exports["default"] = PartialMatcher; /***/ 7792: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const path = __nccwpck_require__(6928); @@ -16391,7 +13078,6 @@ exports["default"] = Provider; /***/ 1969: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const stream_1 = __nccwpck_require__(2203); @@ -16430,7 +13116,6 @@ exports["default"] = ProviderStream; /***/ 5894: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const sync_1 = __nccwpck_require__(264); @@ -16461,7 +13146,6 @@ exports["default"] = ProviderSync; /***/ 7094: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const utils = __nccwpck_require__(6002); @@ -16495,7 +13179,6 @@ exports["default"] = EntryTransformer; /***/ 2907: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const fsWalk = __nccwpck_require__(9337); @@ -16538,7 +13221,6 @@ exports["default"] = ReaderAsync; /***/ 1824: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const path = __nccwpck_require__(6928); @@ -16579,7 +13261,6 @@ exports["default"] = Reader; /***/ 87: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const stream_1 = __nccwpck_require__(2203); @@ -16642,7 +13323,6 @@ exports["default"] = ReaderStream; /***/ 264: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const fsStat = __nccwpck_require__(1470); @@ -16693,7 +13373,6 @@ exports["default"] = ReaderSync; /***/ 879: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.DEFAULT_FILE_SYSTEM_ADAPTER = void 0; @@ -16760,7 +13439,6 @@ exports["default"] = Settings; /***/ 5711: /***/ ((__unused_webpack_module, exports) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.splitWhen = exports.flatten = void 0; @@ -16790,7 +13468,6 @@ exports.splitWhen = splitWhen; /***/ 9718: /***/ ((__unused_webpack_module, exports) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.isEnoentCodeError = void 0; @@ -16805,7 +13482,6 @@ exports.isEnoentCodeError = isEnoentCodeError; /***/ 6979: /***/ ((__unused_webpack_module, exports) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.createDirentFromStats = void 0; @@ -16832,7 +13508,6 @@ exports.createDirentFromStats = createDirentFromStats; /***/ 6002: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.string = exports.stream = exports.pattern = exports.path = exports.fs = exports.errno = exports.array = void 0; @@ -16857,7 +13532,6 @@ exports.string = string; /***/ 9283: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.convertPosixPathToPattern = exports.convertWindowsPathToPattern = exports.convertPathToPattern = exports.escapePosixPath = exports.escapeWindowsPath = exports.escape = exports.removeLeadingDotSegment = exports.makeAbsolute = exports.unixify = void 0; @@ -16933,7 +13607,6 @@ exports.convertPosixPathToPattern = convertPosixPathToPattern; /***/ 1304: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.isAbsolute = exports.partitionAbsoluteAndRelative = exports.removeDuplicateSlashes = exports.matchAny = exports.convertPatternsToRe = exports.makeRe = exports.getPatternParts = exports.expandBraceExpansion = exports.expandPatternsWithBraceExpansion = exports.isAffectDepthOfReadingPattern = exports.endsWithSlashGlobStar = exports.hasGlobStar = exports.getBaseDirectory = exports.isPatternRelatedToParentDirectory = exports.getPatternsOutsideCurrentDirectory = exports.getPatternsInsideCurrentDirectory = exports.getPositivePatterns = exports.getNegativePatterns = exports.isPositivePattern = exports.isNegativePattern = exports.convertToNegativePattern = exports.convertToPositivePattern = exports.isDynamicPattern = exports.isStaticPattern = void 0; @@ -17147,7 +13820,6 @@ exports.isAbsolute = isAbsolute; /***/ 536: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.merge = void 0; @@ -17172,7 +13844,6 @@ function propagateCloseEventToSources(streams) { /***/ 7641: /***/ ((__unused_webpack_module, exports) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.isEmpty = exports.isString = void 0; @@ -17191,7 +13862,6 @@ exports.isEmpty = isEmpty; /***/ 8230: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; /* eslint-disable no-var */ @@ -17488,7 +14158,6 @@ module.exports.promise = queueAsPromised /***/ 877: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; /*! * fill-range * @@ -17928,7 +14597,6 @@ module.exports = function isGlob(str, options) { /***/ 3102: /***/ ((module) => { -"use strict"; /*! * is-number * @@ -17954,7 +14622,6 @@ module.exports = function(num) { /***/ 754: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; /* * merge2 @@ -18106,7 +14773,6 @@ function pauseStreams (streams, options) { /***/ 8785: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const util = __nccwpck_require__(9023); @@ -18588,7 +15254,6 @@ module.exports = micromatch; /***/ 6377: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; module.exports = __nccwpck_require__(9639); @@ -18599,7 +15264,6 @@ module.exports = __nccwpck_require__(9639); /***/ 9560: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const path = __nccwpck_require__(6928); @@ -18786,7 +15450,6 @@ module.exports = { /***/ 7430: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const constants = __nccwpck_require__(9560); @@ -19885,7 +16548,6 @@ module.exports = parse; /***/ 9639: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const path = __nccwpck_require__(6928); @@ -20235,7 +16897,6 @@ module.exports = picomatch; /***/ 6028: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const utils = __nccwpck_require__(8604); @@ -20634,7 +17295,6 @@ module.exports = scan; /***/ 8604: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; const path = __nccwpck_require__(6928); @@ -20755,7 +17415,6 @@ function onceStrict (fn) { /***/ 4006: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const pico = __nccwpck_require__(8016); @@ -20780,7 +17439,6 @@ module.exports = picomatch; /***/ 5595: /***/ ((module) => { -"use strict"; const WIN_SLASH = '\\\\/'; @@ -20968,7 +17626,6 @@ module.exports = { /***/ 8265: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const constants = __nccwpck_require__(5595); @@ -22061,7 +18718,6 @@ module.exports = parse; /***/ 8016: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const scan = __nccwpck_require__(1781); @@ -22410,7 +19066,6 @@ module.exports = picomatch; /***/ 1781: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const utils = __nccwpck_require__(4059); @@ -22809,7 +19464,6 @@ module.exports = scan; /***/ 4059: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; /*global navigator*/ @@ -22905,7 +19559,6 @@ module.exports = typeof queueMicrotask === 'function' /***/ 844: /***/ ((module) => { -"use strict"; function reusify (Constructor) { @@ -24708,7 +21361,6 @@ function runParallel (tasks, cb) { /***/ 7551: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; /*! * to-regex-range * @@ -25012,7 +21664,6 @@ module.exports = __nccwpck_require__(218); /***/ 218: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; var net = __nccwpck_require__(9278); @@ -25284,7 +21935,6 @@ exports.debug = debug; // for test /***/ 6752: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const Client = __nccwpck_require__(6197) @@ -25459,7 +22109,6 @@ module.exports.mockErrors = mockErrors /***/ 9965: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { InvalidArgumentError } = __nccwpck_require__(8707) @@ -25676,7 +22325,6 @@ module.exports = { /***/ 4660: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { AsyncResource } = __nccwpck_require__(290) @@ -25788,7 +22436,6 @@ module.exports = connect /***/ 6862: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { @@ -26045,7 +22692,6 @@ module.exports = pipeline /***/ 4043: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const Readable = __nccwpck_require__(9927) @@ -26233,7 +22879,6 @@ module.exports.RequestHandler = RequestHandler /***/ 3560: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { finished, PassThrough } = __nccwpck_require__(2203) @@ -26461,7 +23106,6 @@ module.exports = stream /***/ 1882: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { InvalidArgumentError, RequestAbortedError, SocketError } = __nccwpck_require__(8707) @@ -26574,7 +23218,6 @@ module.exports = upgrade /***/ 6615: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; module.exports.request = __nccwpck_require__(4043) @@ -26589,7 +23232,6 @@ module.exports.connect = __nccwpck_require__(4660) /***/ 9927: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; // Ported from https://github.com/nodejs/undici/pull/907 @@ -26972,7 +23614,6 @@ module.exports = { getResolveErrorBodyCallback } /***/ 1093: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { @@ -27170,7 +23811,6 @@ module.exports = BalancedPool /***/ 479: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { kConstruct } = __nccwpck_require__(296) @@ -28016,7 +24656,6 @@ module.exports = { /***/ 4738: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { kConstruct } = __nccwpck_require__(296) @@ -28168,7 +24807,6 @@ module.exports = { /***/ 296: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; module.exports = { @@ -28181,7 +24819,6 @@ module.exports = { /***/ 3993: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const assert = __nccwpck_require__(2613) @@ -28238,7 +24875,6 @@ module.exports = { /***/ 6197: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; // @ts-check @@ -30529,7 +27165,6 @@ module.exports = Client /***/ 3194: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; /* istanbul ignore file: only for Node 12 */ @@ -30585,7 +27220,6 @@ module.exports = function () { /***/ 9237: /***/ ((module) => { -"use strict"; // https://wicg.github.io/cookie-store/#cookie-maximum-attribute-value-size @@ -30605,7 +27239,6 @@ module.exports = { /***/ 3168: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { parseSetCookie } = __nccwpck_require__(8915) @@ -30796,7 +27429,6 @@ module.exports = { /***/ 8915: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { maxNameValuePairSize, maxAttributeValueSize } = __nccwpck_require__(9237) @@ -31121,7 +27753,6 @@ module.exports = { /***/ 3834: /***/ ((module) => { -"use strict"; /** @@ -31403,7 +28034,6 @@ module.exports = { /***/ 9136: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const net = __nccwpck_require__(9278) @@ -31600,7 +28230,6 @@ module.exports = buildConnector /***/ 735: /***/ ((module) => { -"use strict"; /** @type {Record} */ @@ -31726,7 +28355,6 @@ module.exports = { /***/ 8707: /***/ ((module) => { -"use strict"; class UndiciError extends Error { @@ -31964,7 +28592,6 @@ module.exports = { /***/ 4655: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { @@ -32541,7 +29168,6 @@ module.exports = { /***/ 3440: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const assert = __nccwpck_require__(2613) @@ -33071,7 +29697,6 @@ module.exports = { /***/ 1: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const Dispatcher = __nccwpck_require__(992) @@ -33271,7 +29896,6 @@ module.exports = DispatcherBase /***/ 992: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const EventEmitter = __nccwpck_require__(4434) @@ -33298,7 +29922,6 @@ module.exports = Dispatcher /***/ 8923: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const Busboy = __nccwpck_require__(9581) @@ -33919,7 +30542,6 @@ module.exports = { /***/ 7326: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { MessageChannel, receiveMessageOnPort } = __nccwpck_require__(8167) @@ -34712,7 +31334,6 @@ module.exports = { /***/ 3041: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { Blob, File: NativeFile } = __nccwpck_require__(181) @@ -35064,7 +31685,6 @@ module.exports = { File, FileLike, isFileLike } /***/ 3073: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { isBlobLike, toUSVString, makeIterator } = __nccwpck_require__(5523) @@ -35337,7 +31957,6 @@ module.exports = { FormData } /***/ 5628: /***/ ((module) => { -"use strict"; // In case of breaking changes, increase the version @@ -35385,7 +32004,6 @@ module.exports = { /***/ 6349: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; // https://github.com/Ethan-Arrowood/undici-fetch @@ -35986,7 +32604,6 @@ module.exports = { /***/ 2315: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; // https://github.com/Ethan-Arrowood/undici-fetch @@ -38142,7 +34759,6 @@ module.exports = { /***/ 5194: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; /* globals AbortController */ @@ -39096,7 +35712,6 @@ module.exports = { Request, makeRequest } /***/ 8676: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { Headers, HeadersList, fill } = __nccwpck_require__(6349) @@ -39675,7 +36290,6 @@ module.exports = { /***/ 9710: /***/ ((module) => { -"use strict"; module.exports = { @@ -39693,7 +36307,6 @@ module.exports = { /***/ 5523: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { redirectStatusSet, referrerPolicySet: referrerPolicyTokens, badPortsSet } = __nccwpck_require__(7326) @@ -40845,7 +37458,6 @@ module.exports = { /***/ 4222: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { types } = __nccwpck_require__(9023) @@ -41499,7 +38111,6 @@ module.exports = { /***/ 396: /***/ ((module) => { -"use strict"; /** @@ -41797,7 +38408,6 @@ module.exports = { /***/ 2160: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { @@ -42149,7 +38759,6 @@ module.exports = { /***/ 5976: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { webidl } = __nccwpck_require__(4222) @@ -42235,7 +38844,6 @@ module.exports = { /***/ 6812: /***/ ((module) => { -"use strict"; module.exports = { @@ -42253,7 +38861,6 @@ module.exports = { /***/ 165: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { @@ -42653,7 +39260,6 @@ module.exports = { /***/ 2581: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; // We include a version number for the Dispatcher API. In case of breaking changes, @@ -42693,7 +39299,6 @@ module.exports = { /***/ 8840: /***/ ((module) => { -"use strict"; module.exports = class DecoratorHandler { @@ -42736,7 +39341,6 @@ module.exports = class DecoratorHandler { /***/ 8299: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const util = __nccwpck_require__(3440) @@ -43308,7 +39912,6 @@ module.exports = RetryHandler /***/ 4415: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const RedirectHandler = __nccwpck_require__(8299) @@ -43337,7 +39940,6 @@ module.exports = createRedirectInterceptor /***/ 2824: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.SPECIAL_HEADERS = exports.HEADER_STATE = exports.MINOR = exports.MAJOR = exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS = exports.TOKEN = exports.STRICT_TOKEN = exports.HEX = exports.URL_CHAR = exports.STRICT_URL_CHAR = exports.USERINFO_CHARS = exports.MARK = exports.ALPHANUM = exports.NUM = exports.HEX_MAP = exports.NUM_MAP = exports.ALPHA = exports.FINISH = exports.H_METHOD_MAP = exports.METHOD_MAP = exports.METHODS_RTSP = exports.METHODS_ICE = exports.METHODS_HTTP = exports.METHODS = exports.LENIENT_FLAGS = exports.FLAGS = exports.TYPE = exports.ERROR = void 0; @@ -43638,7 +40240,6 @@ module.exports = 'AGFzbQEAAAABMAhgAX8Bf2ADf39/AX9gBH9/f38Bf2AAAGADf39/AGABfwBgAn /***/ 172: /***/ ((__unused_webpack_module, exports) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.enumToMap = void 0; @@ -43660,7 +40261,6 @@ exports.enumToMap = enumToMap; /***/ 7501: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { kClients } = __nccwpck_require__(6443) @@ -43839,7 +40439,6 @@ module.exports = MockAgent /***/ 7365: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { promisify } = __nccwpck_require__(9023) @@ -43906,7 +40505,6 @@ module.exports = MockClient /***/ 2429: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { UndiciError } = __nccwpck_require__(8707) @@ -43931,7 +40529,6 @@ module.exports = { /***/ 1511: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { getResponseData, buildKey, addMockDispatch } = __nccwpck_require__(3397) @@ -44145,7 +40742,6 @@ module.exports.MockScope = MockScope /***/ 4004: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { promisify } = __nccwpck_require__(9023) @@ -44212,7 +40808,6 @@ module.exports = MockPool /***/ 1117: /***/ ((module) => { -"use strict"; module.exports = { @@ -44243,7 +40838,6 @@ module.exports = { /***/ 3397: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { MockNotMatchedError } = __nccwpck_require__(2429) @@ -44602,7 +41196,6 @@ module.exports = { /***/ 6142: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { Transform } = __nccwpck_require__(2203) @@ -44650,7 +41243,6 @@ module.exports = class PendingInterceptorsFormatter { /***/ 1529: /***/ ((module) => { -"use strict"; const singulars = { @@ -44687,7 +41279,6 @@ module.exports = class Pluralizer { /***/ 4869: /***/ ((module) => { -"use strict"; /* eslint-disable */ @@ -44812,7 +41403,6 @@ module.exports = class FixedQueue { /***/ 8640: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const DispatcherBase = __nccwpck_require__(1) @@ -45055,7 +41645,6 @@ module.exports = PoolStats /***/ 5076: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { @@ -45171,7 +41760,6 @@ module.exports = Pool /***/ 2720: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { kProxy, kClose, kDestroy, kInterceptors } = __nccwpck_require__(6443) @@ -45368,7 +41956,6 @@ module.exports = ProxyAgent /***/ 8804: /***/ ((module) => { -"use strict"; let fastNow = Date.now() @@ -45473,7 +42060,6 @@ module.exports = { /***/ 8550: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const diagnosticsChannel = __nccwpck_require__(1637) @@ -45772,7 +42358,6 @@ module.exports = { /***/ 5913: /***/ ((module) => { -"use strict"; // This is a Globally Unique Identifier unique used @@ -45831,7 +42416,6 @@ module.exports = { /***/ 6255: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { webidl } = __nccwpck_require__(4222) @@ -46142,7 +42726,6 @@ module.exports = { /***/ 1237: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { maxUnsigned16Bit } = __nccwpck_require__(5913) @@ -46223,7 +42806,6 @@ module.exports = { /***/ 3171: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { Writable } = __nccwpck_require__(2203) @@ -46575,7 +43157,6 @@ module.exports = { /***/ 2933: /***/ ((module) => { -"use strict"; module.exports = { @@ -46595,7 +43176,6 @@ module.exports = { /***/ 3574: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { kReadyState, kController, kResponse, kBinaryType, kWebSocketURL } = __nccwpck_require__(2933) @@ -46803,7 +43383,6 @@ module.exports = { /***/ 5171: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const { webidl } = __nccwpck_require__(4222) @@ -47452,7 +44031,6 @@ module.exports = { /***/ 3843: /***/ ((__unused_webpack_module, exports) => { -"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); @@ -52535,263 +49113,223 @@ function wrappy (fn, cb) { /***/ 2613: /***/ ((module) => { -"use strict"; -module.exports = require("assert"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("assert"); /***/ }), /***/ 290: /***/ ((module) => { -"use strict"; -module.exports = require("async_hooks"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("async_hooks"); /***/ }), /***/ 181: /***/ ((module) => { -"use strict"; -module.exports = require("buffer"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("buffer"); /***/ }), /***/ 5317: /***/ ((module) => { -"use strict"; -module.exports = require("child_process"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("child_process"); /***/ }), /***/ 4236: /***/ ((module) => { -"use strict"; -module.exports = require("console"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("console"); /***/ }), /***/ 6982: /***/ ((module) => { -"use strict"; -module.exports = require("crypto"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("crypto"); /***/ }), /***/ 1637: /***/ ((module) => { -"use strict"; -module.exports = require("diagnostics_channel"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("diagnostics_channel"); /***/ }), /***/ 4434: /***/ ((module) => { -"use strict"; -module.exports = require("events"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("events"); /***/ }), /***/ 9896: /***/ ((module) => { -"use strict"; -module.exports = require("fs"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("fs"); /***/ }), /***/ 8611: /***/ ((module) => { -"use strict"; -module.exports = require("http"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("http"); /***/ }), /***/ 5675: /***/ ((module) => { -"use strict"; -module.exports = require("http2"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("http2"); /***/ }), /***/ 5692: /***/ ((module) => { -"use strict"; -module.exports = require("https"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("https"); /***/ }), /***/ 9278: /***/ ((module) => { -"use strict"; -module.exports = require("net"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("net"); /***/ }), /***/ 7598: /***/ ((module) => { -"use strict"; -module.exports = require("node:crypto"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:crypto"); /***/ }), /***/ 8474: /***/ ((module) => { -"use strict"; -module.exports = require("node:events"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:events"); /***/ }), /***/ 7075: /***/ ((module) => { -"use strict"; -module.exports = require("node:stream"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:stream"); /***/ }), /***/ 7975: /***/ ((module) => { -"use strict"; -module.exports = require("node:util"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:util"); /***/ }), /***/ 857: /***/ ((module) => { -"use strict"; -module.exports = require("os"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("os"); /***/ }), /***/ 6928: /***/ ((module) => { -"use strict"; -module.exports = require("path"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("path"); /***/ }), /***/ 2987: /***/ ((module) => { -"use strict"; -module.exports = require("perf_hooks"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("perf_hooks"); /***/ }), /***/ 3480: /***/ ((module) => { -"use strict"; -module.exports = require("querystring"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("querystring"); /***/ }), /***/ 2203: /***/ ((module) => { -"use strict"; -module.exports = require("stream"); - -/***/ }), - -/***/ 9786: -/***/ ((module) => { - -"use strict"; -module.exports = require("stream/promises"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("stream"); /***/ }), /***/ 3774: /***/ ((module) => { -"use strict"; -module.exports = require("stream/web"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("stream/web"); /***/ }), /***/ 3193: /***/ ((module) => { -"use strict"; -module.exports = require("string_decoder"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("string_decoder"); /***/ }), /***/ 3557: /***/ ((module) => { -"use strict"; -module.exports = require("timers"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("timers"); /***/ }), /***/ 4756: /***/ ((module) => { -"use strict"; -module.exports = require("tls"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("tls"); /***/ }), /***/ 7016: /***/ ((module) => { -"use strict"; -module.exports = require("url"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("url"); /***/ }), /***/ 9023: /***/ ((module) => { -"use strict"; -module.exports = require("util"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("util"); /***/ }), /***/ 8253: /***/ ((module) => { -"use strict"; -module.exports = require("util/types"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("util/types"); /***/ }), /***/ 8167: /***/ ((module) => { -"use strict"; -module.exports = require("worker_threads"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("worker_threads"); /***/ }), /***/ 3106: /***/ ((module) => { -"use strict"; -module.exports = require("zlib"); +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("zlib"); /***/ }), /***/ 7182: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const WritableStream = (__nccwpck_require__(7075).Writable) @@ -53006,7 +49544,6 @@ module.exports = Dicer /***/ 2271: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const EventEmitter = (__nccwpck_require__(8474).EventEmitter) @@ -53114,7 +49651,6 @@ module.exports = HeaderParser /***/ 612: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const inherits = (__nccwpck_require__(7975).inherits) @@ -53135,7 +49671,6 @@ module.exports = PartStream /***/ 4136: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; /** @@ -53371,7 +49906,6 @@ module.exports = SBMH /***/ 9581: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const WritableStream = (__nccwpck_require__(7075).Writable) @@ -53464,7 +49998,6 @@ module.exports.Dicer = Dicer /***/ 1192: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; // TODO: @@ -53778,7 +50311,6 @@ module.exports = Multipart /***/ 855: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; const Decoder = __nccwpck_require__(1496) @@ -53976,7 +50508,6 @@ module.exports = UrlEncoded /***/ 1496: /***/ ((module) => { -"use strict"; const RE_PLUS = /\+/g @@ -54038,7 +50569,6 @@ module.exports = Decoder /***/ 692: /***/ ((module) => { -"use strict"; module.exports = function basename (path) { @@ -54060,7 +50590,6 @@ module.exports = function basename (path) { /***/ 2747: /***/ (function(module) { -"use strict"; // Node has always utf-8 @@ -54182,7 +50711,6 @@ module.exports = decodeText /***/ 2393: /***/ ((module) => { -"use strict"; module.exports = function getLimit (limits, name, defaultLimit) { @@ -54206,7 +50734,6 @@ module.exports = function getLimit (limits, name, defaultLimit) { /***/ 8929: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; /* eslint-disable object-property-newline */ @@ -54407,50 +50934,2758 @@ module.exports = parseParams /***/ }) -/******/ }); +/******/ }); /************************************************************************/ -/******/ // The module cache -/******/ var __webpack_module_cache__ = {}; -/******/ -/******/ // The require function -/******/ function __nccwpck_require__(moduleId) { -/******/ // Check if module is in cache -/******/ var cachedModule = __webpack_module_cache__[moduleId]; -/******/ if (cachedModule !== undefined) { -/******/ return cachedModule.exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = __webpack_module_cache__[moduleId] = { -/******/ // no module.id needed -/******/ // no module.loaded needed -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ var threw = true; -/******/ try { -/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __nccwpck_require__); -/******/ threw = false; -/******/ } finally { -/******/ if(threw) delete __webpack_module_cache__[moduleId]; -/******/ } -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __nccwpck_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; /******/ } -/******/ +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ var threw = true; +/******/ try { +/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __nccwpck_require__); +/******/ threw = false; +/******/ } finally { +/******/ if(threw) delete __webpack_module_cache__[moduleId]; +/******/ } +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ /************************************************************************/ -/******/ /* webpack/runtime/compat */ -/******/ -/******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = __dirname + "/"; -/******/ +/******/ /* webpack/runtime/compat */ +/******/ +/******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = new URL('.', import.meta.url).pathname.slice(import.meta.url.match(/^file:\/\/\/\w:/) ? 1 : 0, -1) + "/"; +/******/ /************************************************************************/ -/******/ -/******/ // startup -/******/ // Load entry module and return exports -/******/ // This entry module is referenced by other modules so it can't be inlined -/******/ var __webpack_exports__ = __nccwpck_require__(5915); -/******/ module.exports = __webpack_exports__; -/******/ -/******/ })() -; \ No newline at end of file +var __webpack_exports__ = {}; + +// EXTERNAL MODULE: ./node_modules/@actions/core/lib/core.js +var core = __nccwpck_require__(7484); +// EXTERNAL MODULE: ./node_modules/@actions/github/lib/github.js +var github = __nccwpck_require__(3228); +// EXTERNAL MODULE: ./node_modules/adm-zip/adm-zip.js +var adm_zip = __nccwpck_require__(1316); +// EXTERNAL MODULE: ./node_modules/picomatch/index.js +var picomatch = __nccwpck_require__(4006); +// EXTERNAL MODULE: external "fs" +var external_fs_ = __nccwpck_require__(9896); +;// CONCATENATED MODULE: external "stream/promises" +const promises_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("stream/promises"); +// EXTERNAL MODULE: external "stream" +var external_stream_ = __nccwpck_require__(2203); +;// CONCATENATED MODULE: ./lib/utils/github-utils.js + + + + + +function getCheckRunContext() { + if (github.context.eventName === 'workflow_run') { + core.info('Action was triggered by workflow_run: using SHA and RUN_ID from triggering workflow'); + const event = github.context.payload; + if (!event.workflow_run) { + throw new Error("Event of type 'workflow_run' is missing 'workflow_run' field"); + } + const prs = event.workflow_run.pull_requests ?? []; + // For `workflow_run`, we want to report against the PR commit when possible so annotations land + // on the contributor's changes. Prefer the PR whose `head.ref` matches `workflow_run.head_branch`, + // then fall back to the first PR head SHA, and finally to `workflow_run.head_sha` for non-PR runs. + const prShaMatch = prs.find(pr => pr.head?.ref === event.workflow_run.head_branch)?.head?.sha; + const prShaFirst = prs[0]?.head?.sha; + const sha = prShaMatch ?? prShaFirst ?? event.workflow_run.head_sha; + if (!sha) { + throw new Error('Unable to resolve SHA from workflow_run (no PR head.sha or head_sha)'); + } + return { + sha, + runId: event.workflow_run.id + }; + } + const runId = github.context.runId; + if (github.context.payload.pull_request) { + core.info(`Action was triggered by ${github.context.eventName}: using SHA from head of source branch`); + const pr = github.context.payload.pull_request; + return { sha: pr.head.sha, runId }; + } + return { sha: github.context.sha, runId }; +} +async function downloadArtifact(octokit, artifactId, fileName, token) { + core.startGroup(`Downloading artifact ${fileName}`); + try { + core.info(`Artifact ID: ${artifactId}`); + const req = octokit.rest.actions.downloadArtifact.endpoint({ + ...github.context.repo, + artifact_id: artifactId, + archive_format: 'zip' + }); + const response = await fetch(req.url, { + headers: { Authorization: `Bearer ${token}` }, + redirect: 'follow' + }); + if (!response.ok) { + throw new Error(`Download failed: ${response.status} ${response.statusText}`); + } + if (!response.body) { + throw new Error('Response body is empty'); + } + core.info(`Downloading from ${response.url}`); + const readable = external_stream_.Readable.fromWeb(response.body); + const fileWriterStream = (0,external_fs_.createWriteStream)(fileName); + let transferred = 0; + const progress = new external_stream_.Transform({ + transform(chunk, _encoding, callback) { + transferred += chunk.length; + core.info(`Progress: ${transferred} B`); + callback(null, chunk); + } + }); + await (0,promises_namespaceObject.pipeline)(readable, progress, fileWriterStream); + } + finally { + core.endGroup(); + } +} +async function listFiles(octokit, sha) { + core.startGroup('Fetching list of tracked files from GitHub'); + try { + const commit = await octokit.rest.git.getCommit({ + commit_sha: sha, + ...github.context.repo + }); + const files = await listGitTree(octokit, commit.data.tree.sha, ''); + return files; + } + finally { + core.endGroup(); + } +} +async function listGitTree(octokit, sha, path) { + const pathLog = path ? ` at ${path}` : ''; + core.info(`Fetching tree ${sha}${pathLog}`); + let truncated = false; + let tree = await octokit.rest.git.getTree({ + recursive: 'true', + tree_sha: sha, + ...github.context.repo + }); + if (tree.data.truncated) { + truncated = true; + tree = await octokit.rest.git.getTree({ + tree_sha: sha, + ...github.context.repo + }); + } + const result = []; + for (const tr of tree.data.tree) { + const file = `${path}${tr.path}`; + if (tr.type === 'blob') { + result.push(file); + } + else if (tr.type === 'tree' && truncated) { + const files = await listGitTree(octokit, tr.sha, `${file}/`); + result.push(...files); + } + } + return result; +} + +;// CONCATENATED MODULE: ./lib/input-providers/artifact-provider.js + + + + + +class ArtifactProvider { + octokit; + artifact; + name; + pattern; + sha; + runId; + token; + artifactNameMatch; + fileNameMatch; + getReportName; + constructor(octokit, artifact, name, pattern, sha, runId, token) { + this.octokit = octokit; + this.artifact = artifact; + this.name = name; + this.pattern = pattern; + this.sha = sha; + this.runId = runId; + this.token = token; + if (this.artifact.startsWith('/')) { + const endIndex = this.artifact.lastIndexOf('/'); + const rePattern = this.artifact.substring(1, endIndex); + const reOpts = this.artifact.substring(endIndex + 1); + const re = new RegExp(rePattern, reOpts); + this.artifactNameMatch = (str) => re.test(str); + this.getReportName = (str) => { + const match = str.match(re); + if (match === null) { + throw new Error(`Artifact name '${str}' does not match regex ${this.artifact}`); + } + let reportName = this.name; + for (let i = 1; i < match.length; i++) { + reportName = reportName.replace(new RegExp(`\\$${i}`, 'g'), match[i]); + } + return reportName; + }; + } + else { + this.artifactNameMatch = (str) => str === this.artifact; + this.getReportName = () => this.name; + } + this.fileNameMatch = picomatch(pattern); + } + async load() { + const result = {}; + const allArtifacts = await this.octokit.paginate(this.octokit.rest.actions.listWorkflowRunArtifacts, { + ...github.context.repo, + run_id: this.runId + }); + if (allArtifacts.length === 0) { + core.warning(`No artifacts found in run ${this.runId}`); + return {}; + } + const artifacts = allArtifacts.filter(a => this.artifactNameMatch(a.name)); + if (artifacts.length === 0) { + core.warning(`No artifact matches ${this.artifact}`); + return {}; + } + for (const art of artifacts) { + const fileName = `${art.name}.zip`; + await downloadArtifact(this.octokit, art.id, fileName, this.token); + core.startGroup(`Reading archive ${fileName}`); + try { + const reportName = this.getReportName(art.name); + core.info(`Report name: ${reportName}`); + const files = []; + const zip = new adm_zip(fileName); + for (const entry of zip.getEntries()) { + const file = entry.entryName; + if (entry.isDirectory) { + core.info(`Skipping ${file}: entry is a directory`); + continue; + } + if (!this.fileNameMatch(file)) { + core.info(`Skipping ${file}: filename does not match pattern`); + continue; + } + const content = zip.readAsText(entry); + files.push({ file, content }); + core.info(`Read ${file}: ${content.length} chars`); + } + if (result[reportName]) { + result[reportName].push(...files); + } + else { + result[reportName] = files; + } + } + finally { + core.endGroup(); + } + } + return result; + } + async listTrackedFiles() { + return listFiles(this.octokit, this.sha); + } +} + +// EXTERNAL MODULE: ./node_modules/fast-glob/out/index.js +var out = __nccwpck_require__(5648); +// EXTERNAL MODULE: ./node_modules/@actions/exec/lib/exec.js +var exec = __nccwpck_require__(5236); +;// CONCATENATED MODULE: ./lib/utils/git.js + + +async function git_listFiles() { + core.startGroup('Listing all files tracked by git'); + let output = ''; + try { + output = (await (0,exec.getExecOutput)('git', ['ls-files', '-z'])).stdout; + } + finally { + fixStdOutNullTermination(); + core.endGroup(); + } + return output.split('\u0000').filter(s => s.length > 0); +} +function fixStdOutNullTermination() { + // Previous command uses NULL as delimiters and output is printed to stdout. + // We have to make sure next thing written to stdout will start on new line. + // Otherwise things like ::set-output wouldn't work. + core.info(''); +} + +;// CONCATENATED MODULE: ./lib/input-providers/local-file-provider.js + + + +class LocalFileProvider { + name; + pattern; + constructor(name, pattern) { + this.name = name; + this.pattern = pattern; + } + async load() { + const result = []; + for (const pat of this.pattern) { + const paths = await out(pat, { dot: true }); + for (const file of paths) { + const content = await external_fs_.promises.readFile(file, { encoding: 'utf8' }); + result.push({ file, content }); + } + } + return { [this.name]: result }; + } + async listTrackedFiles() { + return git_listFiles(); + } +} + +;// CONCATENATED MODULE: ./lib/utils/markdown-utils.js +var Align; +(function (Align) { + Align["Left"] = ":---"; + Align["Center"] = ":---:"; + Align["Right"] = "---:"; + Align["None"] = "---"; +})(Align || (Align = {})); +const Icon = { + skip: '⚪', // ':white_circle:' + success: '✅', // ':white_check_mark:' + fail: '❌' // ':x:' +}; +function markdown_utils_link(title, address) { + return `[${title}](${address})`; +} +function table(headers, align, ...rows) { + const headerRow = `|${headers.map(tableEscape).join('|')}|`; + const alignRow = `|${align.join('|')}|`; + const contentRows = rows.map(row => `|${row.map(tableEscape).join('|')}|`).join('\n'); + return [headerRow, alignRow, contentRows].join('\n'); +} +function tableEscape(content) { + return content.toString().replace('|', '\\|'); +} +function fixEol(text) { + return text?.replace(/\r/g, '') ?? ''; +} +function ellipsis(text, maxLength) { + if (text.length <= maxLength) { + return text; + } + return text.substring(0, maxLength - 3) + '...'; +} +function formatTime(ms) { + if (ms > 1000) { + return `${Math.round(ms / 1000)}s`; + } + return `${Math.round(ms)}ms`; +} + +;// CONCATENATED MODULE: ./lib/utils/parse-utils.js +function parseNetDuration(str) { + const durationRe = /^(\d\d):(\d\d):(\d\d(?:\.\d+)?)$/; + const durationMatch = str.match(durationRe); + if (durationMatch === null) { + throw new Error(`Invalid format: "${str}" is not NET duration`); + } + const [_, hourStr, minStr, secStr] = durationMatch; + return (parseInt(hourStr) * 3600 + parseInt(minStr) * 60 + parseFloat(secStr)) * 1000; +} +function parseIsoDate(str) { + const isoDateRe = /^\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z)$/; + if (str === undefined || !isoDateRe.test(str)) { + throw new Error(`Invalid format: "${str}" is not ISO date`); + } + return new Date(str); +} +function getFirstNonEmptyLine(stackTrace) { + const lines = stackTrace?.split(/\r?\n/g); + return lines?.find(str => !/^\s*$/.test(str)); +} + +;// CONCATENATED MODULE: ./lib/report/get-annotations.js + + +function getAnnotations(results, maxCount) { + if (maxCount === 0) { + return []; + } + // Collect errors from TestRunResults + // Merge duplicates if there are more test results files processed + const errors = []; + const mergeDup = results.length > 1; + for (const tr of results) { + for (const ts of tr.suites) { + for (const tg of ts.groups) { + for (const tc of tg.tests) { + const err = tc.error; + if (err === undefined) { + continue; + } + const path = err.path ?? tr.path; + const line = err.line ?? 0; + if (mergeDup) { + const dup = errors.find(e => path === e.path && line === e.line && err.details === e.details); + if (dup !== undefined) { + dup.testRunPaths.push(tr.path); + continue; + } + } + errors.push({ + testRunPaths: [tr.path], + suiteName: ts.name, + testName: tg.name ? `${tg.name} ► ${tc.name}` : tc.name, + details: err.details, + message: err.message ?? getFirstNonEmptyLine(err.details) ?? 'Test failed', + path, + line + }); + } + } + } + } + // Limit number of created annotations + errors.splice(maxCount + 1); + const annotations = errors.map(e => { + const message = [ + 'Failed test found in:', + e.testRunPaths.map(p => ` ${p}`).join('\n'), + 'Error:', + ident(fixEol(e.message), ' ') + ].join('\n'); + return enforceCheckRunLimits({ + path: e.path, + start_line: e.line, + end_line: e.line, + annotation_level: 'failure', + title: `${e.suiteName} ► ${e.testName}`, + raw_details: fixEol(e.details), + message + }); + }); + return annotations; +} +function enforceCheckRunLimits(err) { + err.title = ellipsis(err.title || '', 255); + err.message = ellipsis(err.message, 65535); + if (err.raw_details) { + err.raw_details = ellipsis(err.raw_details, 65535); + } + return err; +} +function ident(text, prefix) { + return text + .split(/\n/g) + .map(line => prefix + line) + .join('\n'); +} + +;// CONCATENATED MODULE: ./lib/utils/path-utils.js +function normalizeDirPath(path, addTrailingSlash) { + if (!path) { + return path; + } + path = normalizeFilePath(path); + if (addTrailingSlash && !path.endsWith('/')) { + path += '/'; + } + return path; +} +function normalizeFilePath(path) { + if (!path) { + return path; + } + return path.trim().replace(/\\/g, '/'); +} +function getBasePath(path, trackedFiles) { + if (trackedFiles.includes(path)) { + return ''; + } + let max = ''; + for (const file of trackedFiles) { + if (path.endsWith(file) && file.length > max.length) { + max = file; + } + } + if (max === '') { + return undefined; + } + const base = path.substring(0, path.length - max.length); + return base; +} + +;// CONCATENATED MODULE: ./lib/utils/node-utils.js + +const DEFAULT_LOCALE = 'en-US'; +function getExceptionSource(stackTrace, trackedFiles, getRelativePath) { + const lines = stackTrace.split(/\r?\n/); + const re = /\((.*):(\d+):\d+\)$/; + for (const str of lines) { + const match = str.match(re); + if (match !== null) { + const [_, fileStr, lineStr] = match; + const filePath = normalizeFilePath(fileStr); + if (filePath.startsWith('internal/') || filePath.includes('/node_modules/')) { + continue; + } + const path = getRelativePath(filePath); + if (!path) { + continue; + } + if (trackedFiles.includes(path)) { + const line = parseInt(lineStr); + return { path, line }; + } + } + } +} + +;// CONCATENATED MODULE: ./lib/utils/slugger.js +function slug(name, options) { + const slugId = name + .trim() + .replace(/_/g, '') + .replace(/[./\\]/g, '-') + .replace(/[^\w-]/g, ''); + const id = `user-content-${slugId}`; + // When using the Action Summary for display, links must include the "user-content-" prefix. + const link = options.useActionsSummary ? `#${id}` : `#${slugId}`; + return { id, link }; +} + +;// CONCATENATED MODULE: ./lib/report/get-report.js + + + + + +const MAX_REPORT_LENGTH = 65535; +const MAX_ACTIONS_SUMMARY_LENGTH = 1048576; +const DEFAULT_OPTIONS = { + listSuites: 'all', + listTests: 'all', + baseUrl: '', + onlySummary: false, + useActionsSummary: true, + badgeTitle: 'tests', + reportTitle: '', + collapsed: 'auto' +}; +function getReport(results, options = DEFAULT_OPTIONS, shortSummary = '') { + applySort(results); + const opts = { ...options }; + let lines = renderReport(results, opts, shortSummary); + let report = lines.join('\n'); + if (getByteLength(report) <= getMaxReportLength(options)) { + return report; + } + if (opts.listTests === 'all') { + core.info("Test report summary is too big - setting 'listTests' to 'failed'"); + opts.listTests = 'failed'; + lines = renderReport(results, opts, shortSummary); + report = lines.join('\n'); + if (getByteLength(report) <= getMaxReportLength(options)) { + return report; + } + } + core.warning(`Test report summary exceeded limit of ${getMaxReportLength(options)} bytes and will be trimmed`); + return trimReport(lines, options); +} +function getMaxReportLength(options = DEFAULT_OPTIONS) { + return options.useActionsSummary ? MAX_ACTIONS_SUMMARY_LENGTH : MAX_REPORT_LENGTH; +} +function trimReport(lines, options) { + const closingBlock = '```'; + const errorMsg = `**Report exceeded GitHub limit of ${getMaxReportLength(options)} bytes and has been trimmed**`; + const maxErrorMsgLength = closingBlock.length + errorMsg.length + 2; + const maxReportLength = getMaxReportLength(options) - maxErrorMsgLength; + let reportLength = 0; + let codeBlock = false; + let endLineIndex = 0; + for (endLineIndex = 0; endLineIndex < lines.length; endLineIndex++) { + const line = lines[endLineIndex]; + const lineLength = getByteLength(line); + reportLength += lineLength + 1; + if (reportLength > maxReportLength) { + break; + } + if (line === '```') { + codeBlock = !codeBlock; + } + } + const reportLines = lines.slice(0, endLineIndex); + if (codeBlock) { + reportLines.push('```'); + } + reportLines.push(errorMsg); + return reportLines.join('\n'); +} +function applySort(results) { + results.sort((a, b) => a.path.localeCompare(b.path, DEFAULT_LOCALE)); + for (const res of results) { + res.suites.sort((a, b) => a.name.localeCompare(b.name, DEFAULT_LOCALE)); + } +} +function getByteLength(text) { + return Buffer.byteLength(text, 'utf8'); +} +function renderReport(results, options, shortSummary) { + const sections = []; + const reportTitle = options.reportTitle.trim(); + if (reportTitle) { + sections.push(`# ${reportTitle}`); + } + if (shortSummary) { + sections.push(`## ${shortSummary}`); + } + const badge = getReportBadge(results, options); + sections.push(badge); + const runs = getTestRunsReport(results, options); + sections.push(...runs); + return sections; +} +function getReportBadge(results, options) { + const passed = results.reduce((sum, tr) => sum + tr.passed, 0); + const skipped = results.reduce((sum, tr) => sum + tr.skipped, 0); + const failed = results.reduce((sum, tr) => sum + tr.failed, 0); + return getBadge(passed, failed, skipped, options); +} +function getBadge(passed, failed, skipped, options) { + const text = []; + if (passed > 0) { + text.push(`${passed} passed`); + } + if (failed > 0) { + text.push(`${failed} failed`); + } + if (skipped > 0) { + text.push(`${skipped} skipped`); + } + const message = text.length > 0 ? text.join(', ') : 'none'; + let color = 'success'; + if (failed > 0) { + color = 'critical'; + } + else if (passed === 0 && failed === 0) { + color = 'yellow'; + } + const hint = failed > 0 ? 'Tests failed' : 'Tests passed successfully'; + const encodedBadgeTitle = encodeImgShieldsURIComponent(options.badgeTitle); + const encodedMessage = encodeImgShieldsURIComponent(message); + const encodedColor = encodeImgShieldsURIComponent(color); + return `![${hint}](https://img.shields.io/badge/${encodedBadgeTitle}-${encodedMessage}-${encodedColor})`; +} +function getTestRunsReport(testRuns, options) { + const sections = []; + const totalFailed = testRuns.reduce((sum, tr) => sum + tr.failed, 0); + // Determine if report should be collapsed based on collapsed option + const shouldCollapse = options.collapsed === 'always' || (options.collapsed === 'auto' && totalFailed === 0); + if (shouldCollapse) { + sections.push(`
Expand for details`); + sections.push(` `); + } + if (testRuns.length > 0 || options.onlySummary) { + const tableData = testRuns + .map((tr, originalIndex) => ({ tr, originalIndex })) + .filter(({ tr }) => tr.passed > 0 || tr.failed > 0 || tr.skipped > 0) + .map(({ tr, originalIndex }) => { + const time = formatTime(tr.time); + const name = tr.path; + const addr = options.baseUrl + makeRunSlug(originalIndex, options).link; + const nameLink = markdown_utils_link(name, addr); + const passed = tr.passed > 0 ? `${tr.passed} ${Icon.success}` : ''; + const failed = tr.failed > 0 ? `${tr.failed} ${Icon.fail}` : ''; + const skipped = tr.skipped > 0 ? `${tr.skipped} ${Icon.skip}` : ''; + return [nameLink, passed, failed, skipped, time]; + }); + const resultsTable = table(['Report', 'Passed', 'Failed', 'Skipped', 'Time'], [Align.Left, Align.Right, Align.Right, Align.Right, Align.Right], ...tableData); + sections.push(resultsTable); + } + if (options.onlySummary === false) { + const suitesReports = testRuns.map((tr, i) => getSuitesReport(tr, i, options)).flat(); + sections.push(...suitesReports); + } + if (shouldCollapse) { + sections.push(`
`); + } + return sections; +} +function getSuitesReport(tr, runIndex, options) { + const sections = []; + const suites = options.listSuites === 'failed' ? tr.failedSuites : tr.suites; + if (options.listSuites !== 'none') { + const trSlug = makeRunSlug(runIndex, options); + const nameLink = `${tr.path}`; + const icon = getResultIcon(tr.result); + sections.push(`## ${icon}\xa0${nameLink}`); + const time = formatTime(tr.time); + const headingLine2 = tr.tests > 0 + ? `**${tr.tests}** tests were completed in **${time}** with **${tr.passed}** passed, **${tr.failed}** failed and **${tr.skipped}** skipped.` + : 'No tests found'; + sections.push(headingLine2); + if (suites.length > 0) { + const suitesTable = table(['Test suite', 'Passed', 'Failed', 'Skipped', 'Time'], [Align.Left, Align.Right, Align.Right, Align.Right, Align.Right], ...suites.map((s, suiteIndex) => { + const tsTime = formatTime(s.time); + const tsName = s.name; + const skipLink = options.listTests === 'none' || (options.listTests === 'failed' && s.result !== 'failed'); + const tsAddr = options.baseUrl + makeSuiteSlug(runIndex, suiteIndex, options).link; + const tsNameLink = skipLink ? tsName : markdown_utils_link(tsName, tsAddr); + const passed = s.passed > 0 ? `${s.passed} ${Icon.success}` : ''; + const failed = s.failed > 0 ? `${s.failed} ${Icon.fail}` : ''; + const skipped = s.skipped > 0 ? `${s.skipped} ${Icon.skip}` : ''; + return [tsNameLink, passed, failed, skipped, tsTime]; + })); + sections.push(suitesTable); + } + } + if (options.listTests !== 'none') { + const tests = suites.map((ts, suiteIndex) => getTestsReport(ts, runIndex, suiteIndex, options)).flat(); + if (tests.length > 1) { + sections.push(...tests); + } + } + return sections; +} +function getTestsReport(ts, runIndex, suiteIndex, options) { + if (options.listTests === 'failed' && ts.result !== 'failed') { + return []; + } + const groups = ts.groups; + if (groups.length === 0) { + return []; + } + const sections = []; + const tsName = ts.name; + const tsSlug = makeSuiteSlug(runIndex, suiteIndex, options); + const tsNameLink = `${tsName}`; + const icon = getResultIcon(ts.result); + sections.push(`### ${icon}\xa0${tsNameLink}`); + sections.push('```'); + for (const grp of groups) { + if (grp.name) { + sections.push(grp.name); + } + const space = grp.name ? ' ' : ''; + for (const tc of grp.tests) { + if (options.listTests === 'failed' && tc.result !== 'failed') { + continue; + } + const result = getResultIcon(tc.result); + sections.push(`${space}${result} ${tc.name}`); + if (tc.error) { + const lines = (tc.error.message ?? getFirstNonEmptyLine(tc.error.details)?.trim()) + ?.split(/\r?\n/g) + .map(l => '\t' + l); + if (lines) { + sections.push(...lines); + } + } + } + } + sections.push('```'); + return sections; +} +function makeRunSlug(runIndex, options) { + // use prefix to avoid slug conflicts after escaping the paths + return slug(`r${runIndex}`, options); +} +function makeSuiteSlug(runIndex, suiteIndex, options) { + // use prefix to avoid slug conflicts after escaping the paths + return slug(`r${runIndex}s${suiteIndex}`, options); +} +function getResultIcon(result) { + switch (result) { + case 'success': + return Icon.success; + case 'skipped': + return Icon.skip; + case 'failed': + return Icon.fail; + default: + return ''; + } +} +function encodeImgShieldsURIComponent(component) { + return encodeURIComponent(component).replace(/-/g, '--').replace(/_/g, '__'); +} + +;// CONCATENATED MODULE: ./lib/parsers/dart-json/dart-json-types.js +/// reflects documentation at https://github.com/dart-lang/test/blob/master/pkgs/test/doc/json_reporter.md +function isSuiteEvent(event) { + return event.type === 'suite'; +} +function isGroupEvent(event) { + return event.type === 'group'; +} +function isTestStartEvent(event) { + return event.type === 'testStart'; +} +function isTestDoneEvent(event) { + return event.type === 'testDone'; +} +function isErrorEvent(event) { + return event.type === 'error'; +} +function isDoneEvent(event) { + return event.type === 'done'; +} +function isMessageEvent(event) { + return event.type === 'print'; +} + +;// CONCATENATED MODULE: ./lib/test-results.js + +class TestRunResult { + path; + suites; + totalTime; + constructor(path, suites, totalTime) { + this.path = path; + this.suites = suites; + this.totalTime = totalTime; + } + get tests() { + return this.suites.reduce((sum, g) => sum + g.tests, 0); + } + get passed() { + return this.suites.reduce((sum, g) => sum + g.passed, 0); + } + get failed() { + return this.suites.reduce((sum, g) => sum + g.failed, 0); + } + get skipped() { + return this.suites.reduce((sum, g) => sum + g.skipped, 0); + } + get time() { + return this.totalTime ?? this.suites.reduce((sum, g) => sum + g.time, 0); + } + get result() { + return this.suites.some(t => t.result === 'failed') ? 'failed' : 'success'; + } + get failedSuites() { + return this.suites.filter(s => s.result === 'failed'); + } + sort(deep) { + this.suites.sort((a, b) => a.name.localeCompare(b.name, DEFAULT_LOCALE)); + if (deep) { + for (const suite of this.suites) { + suite.sort(deep); + } + } + } +} +class TestSuiteResult { + name; + groups; + totalTime; + constructor(name, groups, totalTime) { + this.name = name; + this.groups = groups; + this.totalTime = totalTime; + } + get tests() { + return this.groups.reduce((sum, g) => sum + g.tests.length, 0); + } + get passed() { + return this.groups.reduce((sum, g) => sum + g.passed, 0); + } + get failed() { + return this.groups.reduce((sum, g) => sum + g.failed, 0); + } + get skipped() { + return this.groups.reduce((sum, g) => sum + g.skipped, 0); + } + get time() { + return this.totalTime ?? this.groups.reduce((sum, g) => sum + g.time, 0); + } + get result() { + return this.groups.some(t => t.result === 'failed') ? 'failed' : 'success'; + } + get failedGroups() { + return this.groups.filter(grp => grp.result === 'failed'); + } + sort(deep) { + this.groups.sort((a, b) => (a.name ?? '').localeCompare(b.name ?? '', DEFAULT_LOCALE)); + if (deep) { + for (const grp of this.groups) { + grp.sort(); + } + } + } +} +class TestGroupResult { + name; + tests; + constructor(name, tests) { + this.name = name; + this.tests = tests; + } + get passed() { + return this.tests.reduce((sum, t) => (t.result === 'success' ? sum + 1 : sum), 0); + } + get failed() { + return this.tests.reduce((sum, t) => (t.result === 'failed' ? sum + 1 : sum), 0); + } + get skipped() { + return this.tests.reduce((sum, t) => (t.result === 'skipped' ? sum + 1 : sum), 0); + } + get time() { + return this.tests.reduce((sum, t) => sum + t.time, 0); + } + get result() { + return this.tests.some(t => t.result === 'failed') ? 'failed' : 'success'; + } + get failedTests() { + return this.tests.filter(tc => tc.result === 'failed'); + } + sort() { + this.tests.sort((a, b) => a.name.localeCompare(b.name, DEFAULT_LOCALE)); + } +} +class TestCaseResult { + name; + result; + time; + error; + constructor(name, result, time, error) { + this.name = name; + this.result = result; + this.time = time; + this.error = error; + } +} + +;// CONCATENATED MODULE: ./lib/parsers/dart-json/dart-json-parser.js + + + +class TestRun { + path; + suites; + success; + time; + constructor(path, suites, success, time) { + this.path = path; + this.suites = suites; + this.success = success; + this.time = time; + } +} +class TestSuite { + suite; + constructor(suite) { + this.suite = suite; + } + groups = {}; +} +class TestGroup { + group; + constructor(group) { + this.group = group; + } + tests = []; +} +class TestCase { + testStart; + constructor(testStart) { + this.testStart = testStart; + this.groupId = testStart.test.groupIDs[testStart.test.groupIDs.length - 1]; + } + groupId; + print = []; + testDone; + error; + get result() { + if (this.testDone?.skipped) { + return 'skipped'; + } + if (this.testDone?.result === 'success') { + return 'success'; + } + if (this.testDone?.result === 'error' || this.testDone?.result === 'failure') { + return 'failed'; + } + return undefined; + } + get time() { + return this.testDone !== undefined ? this.testDone.time - this.testStart.time : 0; + } +} +class DartJsonParser { + options; + sdk; + assumedWorkDir; + constructor(options, sdk) { + this.options = options; + this.sdk = sdk; + } + async parse(path, content) { + const tr = this.getTestRun(path, content); + const result = this.getTestRunResult(tr); + return Promise.resolve(result); + } + getTestRun(path, content) { + const lines = content.split(/\n\r?/g); + const events = lines + .map((str, i) => { + if (str.trim() === '') { + return null; + } + try { + return JSON.parse(str); + } + catch (e) { + const errWithCol = e; + const col = errWithCol.columnNumber !== undefined ? `:${errWithCol.columnNumber}` : ''; + throw new Error(`Invalid JSON at ${path}:${i + 1}${col}\n\n${e}`); + } + }) + .filter(evt => evt != null); + let success = false; + let totalTime = 0; + const suites = {}; + const tests = {}; + for (const evt of events) { + if (isSuiteEvent(evt)) { + suites[evt.suite.id] = new TestSuite(evt.suite); + } + else if (isGroupEvent(evt)) { + suites[evt.group.suiteID].groups[evt.group.id] = new TestGroup(evt.group); + } + else if (isTestStartEvent(evt) && evt.test.url !== null) { + const test = new TestCase(evt); + const suite = suites[evt.test.suiteID]; + const group = suite.groups[evt.test.groupIDs[evt.test.groupIDs.length - 1]]; + group.tests.push(test); + tests[evt.test.id] = test; + } + else if (isTestDoneEvent(evt) && tests[evt.testID]) { + tests[evt.testID].testDone = evt; + } + else if (isErrorEvent(evt) && tests[evt.testID]) { + tests[evt.testID].error = evt; + } + else if (isMessageEvent(evt) && tests[evt.testID]) { + tests[evt.testID].print.push(evt); + } + else if (isDoneEvent(evt)) { + success = evt.success; + totalTime = evt.time; + } + } + return new TestRun(path, Object.values(suites), success, totalTime); + } + getTestRunResult(tr) { + const suites = tr.suites.map(s => { + return new TestSuiteResult(this.getRelativePath(s.suite.path), this.getGroups(s)); + }); + return new TestRunResult(tr.path, suites, tr.time); + } + getGroups(suite) { + const groups = Object.values(suite.groups).filter(grp => grp.tests.length > 0); + groups.sort((a, b) => (a.group.line ?? 0) - (b.group.line ?? 0)); + return groups.map(group => { + group.tests.sort((a, b) => (a.testStart.test.line ?? 0) - (b.testStart.test.line ?? 0)); + const tests = group.tests + .filter(tc => !tc.testDone?.hidden) + .map(tc => { + const error = this.getError(suite, tc); + const testName = group.group.name !== undefined && tc.testStart.test.name.startsWith(group.group.name) + ? tc.testStart.test.name.slice(group.group.name.length).trim() + : tc.testStart.test.name.trim(); + return new TestCaseResult(testName, tc.result, tc.time, error); + }); + return new TestGroupResult(group.group.name, tests); + }); + } + getError(testSuite, test) { + if (!this.options.parseErrors || !test.error) { + return undefined; + } + const { trackedFiles } = this.options; + const stackTrace = test.error?.stackTrace ?? ''; + const print = test.print + .filter(p => p.messageType === 'print') + .map(p => p.message) + .join('\n'); + const details = [print, stackTrace].filter(str => str !== '').join('\n'); + const src = this.exceptionThrowSource(details, trackedFiles); + const message = this.getErrorMessage(test.error?.error ?? '', print); + let path; + let line; + if (src !== undefined) { + path = src.path; + line = src.line; + } + else { + const testStartPath = this.getRelativePath(testSuite.suite.path); + if (trackedFiles.includes(testStartPath)) { + path = testStartPath; + line = test.testStart.test.root_line ?? test.testStart.test.line ?? undefined; + } + } + return { + path, + line, + message, + details + }; + } + getErrorMessage(message, print) { + if (this.sdk === 'flutter') { + const uselessMessageRe = /^Test failed\. See exception logs above\.\nThe test description was:/m; + const flutterPrintRe = /^══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞═+\s+(.*)\s+When the exception was thrown, this was the stack:/ms; + if (uselessMessageRe.test(message)) { + const match = print.match(flutterPrintRe); + if (match !== null) { + return match[1]; + } + } + } + return message || print; + } + exceptionThrowSource(ex, trackedFiles) { + const lines = ex.split(/\r?\n/g); + // regexp to extract file path and line number from stack trace + const dartRe = /^(?!package:)(.*)\s+(\d+):\d+\s+/; + const flutterRe = /^#\d+\s+.*\((?!package:)(.*):(\d+):\d+\)$/; + const re = this.sdk === 'dart' ? dartRe : flutterRe; + for (const str of lines) { + const match = str.match(re); + if (match !== null) { + const [_, pathStr, lineStr] = match; + const path = normalizeFilePath(this.getRelativePath(pathStr)); + if (trackedFiles.includes(path)) { + const line = parseInt(lineStr); + return { path, line }; + } + } + } + } + getRelativePath(path) { + const prefix = 'file://'; + if (path.startsWith(prefix)) { + path = path.substring(prefix.length); + } + path = normalizeFilePath(path); + const workDir = this.getWorkDir(path); + if (workDir !== undefined && path.startsWith(workDir)) { + path = path.substring(workDir.length); + } + return path; + } + getWorkDir(path) { + return (this.options.workDir ?? + this.assumedWorkDir ?? + (this.assumedWorkDir = getBasePath(path, this.options.trackedFiles))); + } +} + +// EXTERNAL MODULE: ./node_modules/xml2js/lib/xml2js.js +var xml2js = __nccwpck_require__(758); +;// CONCATENATED MODULE: ./lib/parsers/dotnet-nunit/dotnet-nunit-parser.js + + + + +class DotnetNunitParser { + options; + assumedWorkDir; + constructor(options) { + this.options = options; + } + async parse(path, content) { + const ju = await this.getNunitReport(path, content); + return this.getTestRunResult(path, ju); + } + async getNunitReport(path, content) { + try { + return (await (0,xml2js.parseStringPromise)(content)); + } + catch (e) { + throw new Error(`Invalid XML at ${path}\n\n${e}`); + } + } + getTestRunResult(path, nunit) { + const suites = []; + const time = parseFloat(nunit['test-run'].$.duration) * 1000; + this.populateTestCasesRecursive(suites, [], nunit['test-run']['test-suite']); + return new TestRunResult(path, suites, time); + } + populateTestCasesRecursive(result, suitePath, testSuites) { + if (testSuites === undefined) { + return; + } + for (const suite of testSuites) { + suitePath.push(suite); + this.populateTestCasesRecursive(result, suitePath, suite['test-suite']); + const testcases = suite['test-case']; + if (testcases !== undefined) { + for (const testcase of testcases) { + this.addTestCase(result, suitePath, testcase); + } + } + suitePath.pop(); + } + } + addTestCase(result, suitePath, testCase) { + // The last suite in the suite path is the "group". + // The rest are concatenated together to form the "suite". + // But ignore "Theory" suites. + const suitesWithoutTheories = suitePath.filter(suite => suite.$.type !== 'Theory'); + const suiteName = suitesWithoutTheories + .slice(0, suitesWithoutTheories.length - 1) + .map(suite => suite.$.name) + .join('.'); + const groupName = suitesWithoutTheories[suitesWithoutTheories.length - 1].$.name; + let existingSuite = result.find(suite => suite.name === suiteName); + if (existingSuite === undefined) { + existingSuite = new TestSuiteResult(suiteName, []); + result.push(existingSuite); + } + let existingGroup = existingSuite.groups.find(group => group.name === groupName); + if (existingGroup === undefined) { + existingGroup = new TestGroupResult(groupName, []); + existingSuite.groups.push(existingGroup); + } + existingGroup.tests.push(new TestCaseResult(testCase.$.name, this.getTestExecutionResult(testCase), parseFloat(testCase.$.duration) * 1000, this.getTestCaseError(testCase))); + } + getTestExecutionResult(test) { + if (test.$.result === 'Failed' || test.failure) + return 'failed'; + if (test.$.result === 'Skipped') + return 'skipped'; + return 'success'; + } + getTestCaseError(tc) { + if (!this.options.parseErrors || !tc.failure || tc.failure.length === 0) { + return undefined; + } + const details = tc.failure[0]; + let path; + let line; + if (details['stack-trace'] !== undefined && details['stack-trace'].length > 0) { + const src = getExceptionSource(details['stack-trace'][0], this.options.trackedFiles, file => this.getRelativePath(file)); + if (src) { + path = src.path; + line = src.line; + } + } + return { + path, + line, + message: details.message && details.message.length > 0 ? details.message[0] : '', + details: details['stack-trace'] && details['stack-trace'].length > 0 ? details['stack-trace'][0] : '' + }; + } + getRelativePath(path) { + path = normalizeFilePath(path); + const workDir = this.getWorkDir(path); + if (workDir !== undefined && path.startsWith(workDir)) { + path = path.substring(workDir.length); + } + return path; + } + getWorkDir(path) { + return (this.options.workDir ?? + this.assumedWorkDir ?? + (this.assumedWorkDir = getBasePath(path, this.options.trackedFiles))); + } +} + +;// CONCATENATED MODULE: ./lib/parsers/dotnet-trx/dotnet-trx-parser.js + + + + +class TestClass { + name; + constructor(name) { + this.name = name; + } + tests = []; +} +class Test { + name; + outcome; + duration; + error; + constructor(name, outcome, duration, error) { + this.name = name; + this.outcome = outcome; + this.duration = duration; + this.error = error; + } + get result() { + switch (this.outcome) { + case 'Passed': + return 'success'; + case 'NotExecuted': + return 'skipped'; + case 'Failed': + return 'failed'; + } + } +} +class DotnetTrxParser { + options; + assumedWorkDir; + constructor(options) { + this.options = options; + } + async parse(path, content) { + const trx = await this.getTrxReport(path, content); + const tc = this.getTestClasses(trx); + const tr = this.getTestRunResult(path, trx, tc); + tr.sort(true); + return tr; + } + async getTrxReport(path, content) { + try { + return (await (0,xml2js.parseStringPromise)(content)); + } + catch (e) { + throw new Error(`Invalid XML at ${path}\n\n${e}`); + } + } + getTestClasses(trx) { + if (trx.TestRun.TestDefinitions === undefined || trx.TestRun.Results === undefined || + !trx.TestRun.TestDefinitions.some(td => td.UnitTest && Array.isArray(td.UnitTest))) { + return []; + } + const unitTests = {}; + for (const td of trx.TestRun.TestDefinitions) { + for (const ut of td.UnitTest) { + unitTests[ut.$.id] = ut; + } + } + const unitTestsResults = trx.TestRun.Results.flatMap(r => r.UnitTestResult).flatMap(result => ({ + result, + test: unitTests[result.$.testId] + })); + const testClasses = {}; + for (const r of unitTestsResults) { + const className = r.test.TestMethod[0].$.className ?? "Unclassified"; + let tc = testClasses[className]; + if (tc === undefined) { + tc = new TestClass(className); + testClasses[tc.name] = tc; + } + const error = this.getErrorInfo(r.result); + const durationAttr = r.result.$.duration; + const duration = durationAttr ? parseNetDuration(durationAttr) : 0; + const resultTestName = r.result.$.testName; + const testName = resultTestName.startsWith(className) && resultTestName[className.length] === '.' + ? resultTestName.substring(className.length + 1) + : resultTestName; + const test = new Test(testName, r.result.$.outcome, duration, error); + tc.tests.push(test); + } + const result = Object.values(testClasses); + return result; + } + getTestRunResult(path, trx, testClasses) { + const times = trx.TestRun.Times[0].$; + const totalTime = parseIsoDate(times.finish).getTime() - parseIsoDate(times.start).getTime(); + const suites = testClasses.map(testClass => { + const tests = testClass.tests.map(test => { + const error = this.getError(test); + return new TestCaseResult(test.name, test.result, test.duration, error); + }); + const group = new TestGroupResult(null, tests); + return new TestSuiteResult(testClass.name, [group]); + }); + return new TestRunResult(path, suites, totalTime); + } + getErrorInfo(testResult) { + if (testResult.$.outcome !== 'Failed') { + return undefined; + } + const output = testResult.Output; + const error = output?.length > 0 && output[0].ErrorInfo?.length > 0 ? output[0].ErrorInfo[0] : undefined; + return error; + } + getError(test) { + if (!this.options.parseErrors || !test.error) { + return undefined; + } + const error = test.error; + if (!Array.isArray(error.Message) || + error.Message.length === 0 || + !Array.isArray(error.StackTrace) || + error.StackTrace.length === 0) { + return undefined; + } + const stackTrace = test.error.StackTrace[0]; + const message = `${test.error.Message[0]}\n${stackTrace}`; + let path; + let line; + const src = this.exceptionThrowSource(stackTrace); + if (src) { + path = src.path; + line = src.line; + } + return { + path, + line, + message, + details: `${message}` + }; + } + exceptionThrowSource(stackTrace) { + const lines = stackTrace.split(/\r*\n/); + const re = / in (.+):line (\d+)$/; + const { trackedFiles } = this.options; + for (const str of lines) { + const match = str.match(re); + if (match !== null) { + const [_, fileStr, lineStr] = match; + const filePath = normalizeFilePath(fileStr); + const workDir = this.getWorkDir(filePath); + if (workDir) { + const file = filePath.substring(workDir.length); + if (trackedFiles.includes(file)) { + const line = parseInt(lineStr); + return { path: file, line }; + } + } + } + } + } + getWorkDir(path) { + return (this.options.workDir ?? + this.assumedWorkDir ?? + (this.assumedWorkDir = getBasePath(path, this.options.trackedFiles))); + } +} + +;// CONCATENATED MODULE: ./lib/parsers/golang-json/golang-json-parser.js + +class GolangJsonParser { + options; + assumedWorkDir; + constructor(options) { + this.options = options; + } + async parse(path, content) { + const events = await this.getGolangTestEvents(path, content); + return this.getTestRunResult(path, events); + } + async getGolangTestEvents(path, content) { + return content.trim().split('\n').map((line, index) => { + try { + return JSON.parse(line); + } + catch (e) { + throw new Error(`Invalid JSON at ${path} line ${index + 1}\n\n${e}`); + } + }); + } + getTestRunResult(path, events) { + const eventGroups = new Map(); + for (const event of events) { + if (!event.Test) { + continue; + } + const k = `${event.Package}/${event.Test}`; + let g = eventGroups.get(k); + if (!g) { + g = []; + eventGroups.set(k, g); + } + g.push(event); + } + const suites = []; + for (const eventGroup of eventGroups.values()) { + const event = eventGroup[0]; + let suite = suites.find(s => s.name === event.Package); + if (!suite) { + suite = new TestSuiteResult(event.Package, []); + suites.push(suite); + } + if (!event.Test) { + continue; + } + let groupName; + let rest; + [groupName, ...rest] = event.Test.split('/'); + let testName = rest.join('/'); + if (!testName) { + testName = groupName; + groupName = null; + } + let group = suite.groups.find(g => g.name === groupName); + if (!group) { + group = new TestGroupResult(groupName, []); + suite.groups.push(group); + } + const lastEvent = eventGroup.at(-1); + const result = lastEvent.Action === 'pass' ? 'success' + : lastEvent.Action === 'skip' ? 'skipped' + : 'failed'; + if (lastEvent.Elapsed === undefined) { + throw new Error('missing elapsed on final test event'); + } + const time = lastEvent.Elapsed * 1000; + let error = undefined; + if (result !== 'success') { + const outputEvents = eventGroup + .filter(e => e.Action === 'output') + .map(e => e.Output ?? '') + // Go output prepends indentation to help group tests - remove it + .map(o => o.replace(/^ /, '')); + // First and last lines will be generic "test started" and "test finished" lines - remove them + outputEvents.splice(0, 1); + outputEvents.splice(-1, 1); + const details = outputEvents.join(''); + error = { + message: details, + details: details + }; + } + group.tests.push(new TestCaseResult(testName, result, time, error)); + } + return new TestRunResult(path, suites); + } +} + +// EXTERNAL MODULE: external "path" +var external_path_ = __nccwpck_require__(6928); +;// CONCATENATED MODULE: ./lib/parsers/java-junit/java-stack-trace-element-parser.js +// classloader and module name are optional: +// at //(:) +// https://github.com/eclipse-openj9/openj9/issues/11452#issuecomment-754946992 +const re = /^\s*at (\S+\/\S*\/)?(.*)\((.*):(\d+)\)$/; +function parseStackTraceElement(stackTraceLine) { + const match = stackTraceLine.match(re); + if (match !== null) { + const [_, maybeClassLoaderAndModuleNameAndVersion, tracePath, fileName, lineStr] = match; + const { classLoader, moduleNameAndVersion } = parseClassLoaderAndModule(maybeClassLoaderAndModuleNameAndVersion); + return { + classLoader, + moduleNameAndVersion, + tracePath, + fileName, + lineStr + }; + } + return undefined; +} +function parseClassLoaderAndModule(maybeClassLoaderAndModuleNameAndVersion) { + if (maybeClassLoaderAndModuleNameAndVersion) { + const res = maybeClassLoaderAndModuleNameAndVersion.split('/'); + const classLoader = res[0]; + let moduleNameAndVersion = res[1]; + if (moduleNameAndVersion === '') { + moduleNameAndVersion = undefined; + } + return { classLoader, moduleNameAndVersion }; + } + return { classLoader: undefined, moduleNameAndVersion: undefined }; +} + +;// CONCATENATED MODULE: ./lib/parsers/java-junit/java-junit-parser.js + + + + + +class JavaJunitParser { + options; + trackedFiles; + constructor(options) { + this.options = options; + // Map to efficient lookup of all paths with given file name + this.trackedFiles = {}; + for (const filePath of options.trackedFiles) { + const fileName = external_path_.basename(filePath); + const files = this.trackedFiles[fileName] ?? (this.trackedFiles[fileName] = []); + files.push(normalizeFilePath(filePath)); + } + } + async parse(filePath, content) { + const reportOrSuite = await this.getJunitReport(filePath, content); + const isReport = reportOrSuite.testsuites !== undefined; + // XML might contain: + // - multiple suites under root node + // - single as root node + let ju; + if (isReport) { + ju = reportOrSuite; + } + else { + // Make it behave the same way as if suite was inside root node + const suite = reportOrSuite.testsuite; + ju = { + testsuites: { + $: { time: suite.$.time }, + testsuite: [suite] + } + }; + } + return this.getTestRunResult(filePath, ju); + } + async getJunitReport(filePath, content) { + try { + return await (0,xml2js.parseStringPromise)(content); + } + catch (e) { + throw new Error(`Invalid XML at ${filePath}\n\n${e}`); + } + } + getTestRunResult(filePath, junit) { + const suites = junit.testsuites.testsuite === undefined + ? [] + : junit.testsuites.testsuite.map(ts => { + const name = ts.$.name.trim(); + const time = parseFloat(ts.$.time) * 1000; + const sr = new TestSuiteResult(name, this.getGroups(ts), time); + return sr; + }); + const seconds = parseFloat(junit.testsuites.$?.time); + const time = isNaN(seconds) ? undefined : seconds * 1000; + return new TestRunResult(filePath, suites, time); + } + getGroups(suite) { + if (suite.testcase === undefined) { + return []; + } + const groups = []; + for (const tc of suite.testcase) { + // Normally classname is same as suite name - both refer to same Java class + // Therefore it doesn't make sense to process it as a group + // and tests will be added to default group with empty name + const className = tc.$.classname === suite.$.name ? '' : tc.$.classname; + let grp = groups.find(g => g.name === className); + if (grp === undefined) { + grp = { name: className, tests: [] }; + groups.push(grp); + } + grp.tests.push(tc); + } + return groups.map(grp => { + const tests = grp.tests.map(tc => { + const name = tc.$.name.trim(); + const result = this.getTestCaseResult(tc); + const time = parseFloat(tc.$.time) * 1000; + const error = this.getTestCaseError(tc); + return new TestCaseResult(name, result, time, error); + }); + return new TestGroupResult(grp.name, tests); + }); + } + getTestCaseResult(test) { + if (test.failure || test.error) + return 'failed'; + if (test.skipped) + return 'skipped'; + return 'success'; + } + getTestCaseError(tc) { + if (!this.options.parseErrors) { + return undefined; + } + // We process and the same way + const failures = tc.failure ?? tc.error; + if (!failures) { + return undefined; + } + const failure = failures[0]; + const details = typeof failure === 'object' ? failure._ : failure; + let filePath; + let line; + if (details != null) { + const src = this.exceptionThrowSource(details); + if (src) { + filePath = src.filePath; + line = src.line; + } + } + let message; + if (typeof failure === 'object') { + message = failure.$.message; + if (failure.$?.type) { + message = failure.$.type + ': ' + message; + } + } + return { + path: filePath, + line, + details, + message + }; + } + exceptionThrowSource(stackTrace) { + const lines = stackTrace.split(/\r?\n/); + for (const str of lines) { + const stackTraceElement = parseStackTraceElement(str); + if (stackTraceElement) { + const { tracePath, fileName, lineStr } = stackTraceElement; + const filePath = this.getFilePath(tracePath, fileName); + if (filePath !== undefined) { + const line = parseInt(lineStr); + return { filePath, line }; + } + } + } + } + // Stacktrace in Java doesn't contain full paths to source file. + // There are only package, file name and line. + // Assuming folder structure matches package name (as it should in Java), + // we can try to match tracked file. + getFilePath(tracePath, fileName) { + // Check if there is any tracked file with given name + const files = this.trackedFiles[fileName]; + if (files === undefined) { + return undefined; + } + // Remove class name and method name from trace. + // Take parts until first item with capital letter - package names are lowercase while class name is CamelCase. + const packageParts = tracePath.split(/\./g); + const packageIndex = packageParts.findIndex(part => part[0] <= 'Z'); + if (packageIndex !== -1) { + packageParts.splice(packageIndex, packageParts.length - packageIndex); + } + if (packageParts.length === 0) { + return undefined; + } + // Get right file + // - file name matches + // - parent folders structure must reflect the package name + for (const filePath of files) { + const dirs = external_path_.dirname(filePath).split(/\//g); + if (packageParts.length > dirs.length) { + continue; + } + // get only N parent folders, where N = length of package name parts + if (dirs.length > packageParts.length) { + dirs.splice(0, dirs.length - packageParts.length); + } + // check if parent folder structure matches package name + const isMatch = packageParts.every((part, i) => part === dirs[i]); + if (isMatch) { + return filePath; + } + } + return undefined; + } +} + +;// CONCATENATED MODULE: ./lib/parsers/jest-junit/jest-junit-parser.js + + + + +class JestJunitParser { + options; + assumedWorkDir; + constructor(options) { + this.options = options; + } + async parse(path, content) { + const ju = await this.getJunitReport(path, content); + return this.getTestRunResult(path, ju); + } + async getJunitReport(path, content) { + try { + return (await (0,xml2js.parseStringPromise)(content)); + } + catch (e) { + throw new Error(`Invalid XML at ${path}\n\n${e}`); + } + } + getTestRunResult(path, junit) { + const suites = junit.testsuites.testsuite === undefined + ? [] + : junit.testsuites.testsuite.map(ts => { + const name = this.escapeCharacters(ts.$.name.trim()); + const time = parseFloat(ts.$.time) * 1000; + const sr = new TestSuiteResult(name, this.getGroups(ts), time); + return sr; + }); + const time = junit.testsuites.$ && parseFloat(junit.testsuites.$.time) * 1000; + return new TestRunResult(path, suites, time); + } + getGroups(suite) { + if (!suite.testcase) { + return []; + } + const groups = []; + for (const tc of suite.testcase) { + let grp = groups.find(g => g.describe === tc.$.classname); + if (grp === undefined) { + grp = { describe: tc.$.classname, tests: [] }; + groups.push(grp); + } + grp.tests.push(tc); + } + return groups.map(grp => { + const tests = grp.tests.map(tc => { + const name = tc.$.name.trim(); + const result = this.getTestCaseResult(tc); + const time = parseFloat(tc.$.time) * 1000; + const error = this.getTestCaseError(tc); + return new TestCaseResult(name, result, time, error); + }); + return new TestGroupResult(grp.describe, tests); + }); + } + getTestCaseResult(test) { + if (test.failure) + return 'failed'; + if (test.skipped) + return 'skipped'; + return 'success'; + } + getTestCaseError(tc) { + if (!this.options.parseErrors || !tc.failure) { + return undefined; + } + const details = typeof tc.failure[0] === 'string' ? tc.failure[0] : tc.failure[0]['_']; + let path; + let line; + const src = getExceptionSource(details, this.options.trackedFiles, file => this.getRelativePath(file)); + if (src) { + path = src.path; + line = src.line; + } + return { + path, + line, + details + }; + } + getRelativePath(path) { + path = normalizeFilePath(path); + const workDir = this.getWorkDir(path); + if (workDir !== undefined && path.startsWith(workDir)) { + path = path.substring(workDir.length); + } + return path; + } + getWorkDir(path) { + return (this.options.workDir ?? + this.assumedWorkDir ?? + (this.assumedWorkDir = getBasePath(path, this.options.trackedFiles))); + } + escapeCharacters(s) { + return s.replace(/([<>])/g, '\\$1'); + } +} + +;// CONCATENATED MODULE: ./lib/parsers/mocha-json/mocha-json-parser.js + + + +class MochaJsonParser { + options; + assumedWorkDir; + constructor(options) { + this.options = options; + } + async parse(path, content) { + const mocha = this.getMochaJson(path, content); + const result = this.getTestRunResult(path, mocha); + result.sort(true); + return Promise.resolve(result); + } + getMochaJson(path, content) { + try { + return JSON.parse(content); + } + catch (e) { + throw new Error(`Invalid JSON at ${path}\n\n${e}`); + } + } + getTestRunResult(resultsPath, mocha) { + const suitesMap = {}; + const getSuite = (test) => { + const path = this.getRelativePath(test.file); + return suitesMap[path] ?? (suitesMap[path] = new TestSuiteResult(path, [])); + }; + for (const test of mocha.passes) { + const suite = getSuite(test); + this.processTest(suite, test, 'success'); + } + for (const test of mocha.failures) { + const suite = getSuite(test); + this.processTest(suite, test, 'failed'); + } + for (const test of mocha.pending) { + const suite = getSuite(test); + this.processTest(suite, test, 'skipped'); + } + const suites = Object.values(suitesMap); + return new TestRunResult(resultsPath, suites, mocha.stats.duration); + } + processTest(suite, test, result) { + const groupName = test.fullTitle !== test.title + ? test.fullTitle.substring(0, test.fullTitle.length - test.title.length).trimEnd() + : null; + let group = suite.groups.find(grp => grp.name === groupName); + if (group === undefined) { + group = new TestGroupResult(groupName, []); + suite.groups.push(group); + } + const error = this.getTestCaseError(test); + const testCase = new TestCaseResult(test.title, result, test.duration ?? 0, error); + group.tests.push(testCase); + } + getTestCaseError(test) { + const details = test.err.stack; + const message = test.err.message; + if (details === undefined) { + return undefined; + } + let path; + let line; + const src = getExceptionSource(details, this.options.trackedFiles, file => this.getRelativePath(file)); + if (src) { + path = src.path; + line = src.line; + } + return { + path, + line, + message, + details + }; + } + getRelativePath(path) { + path = normalizeFilePath(path); + const workDir = this.getWorkDir(path); + if (workDir !== undefined && path.startsWith(workDir)) { + path = path.substring(workDir.length); + } + return path; + } + getWorkDir(path) { + return (this.options.workDir ?? + this.assumedWorkDir ?? + (this.assumedWorkDir = getBasePath(path, this.options.trackedFiles))); + } +} + +;// CONCATENATED MODULE: ./lib/parsers/phpunit-junit/phpunit-junit-parser.js + + + +class PhpunitJunitParser { + options; + trackedFiles; + trackedFilesList; + assumedWorkDir; + constructor(options) { + this.options = options; + this.trackedFilesList = options.trackedFiles.map(f => normalizeFilePath(f)); + this.trackedFiles = new Set(this.trackedFilesList); + } + async parse(filePath, content) { + const reportOrSuite = await this.getPhpunitReport(filePath, content); + const isReport = reportOrSuite.testsuites !== undefined; + // XML might contain: + // - multiple suites under root node + // - single as root node + let report; + if (isReport) { + report = reportOrSuite; + } + else { + // Make it behave the same way as if suite was inside root node + const suite = reportOrSuite.testsuite; + report = { + testsuites: { + $: { time: suite.$.time }, + testsuite: [suite] + } + }; + } + return this.getTestRunResult(filePath, report); + } + async getPhpunitReport(filePath, content) { + try { + return await (0,xml2js.parseStringPromise)(content); + } + catch (e) { + throw new Error(`Invalid XML at ${filePath}\n\n${e}`); + } + } + getTestRunResult(filePath, report) { + const suites = []; + this.collectSuites(suites, report.testsuites.testsuite ?? []); + const seconds = parseFloat(report.testsuites.$?.time ?? ''); + const time = isNaN(seconds) ? undefined : seconds * 1000; + return new TestRunResult(filePath, suites, time); + } + collectSuites(results, testsuites) { + for (const ts of testsuites) { + // Recursively process nested test suites first (depth-first) + if (ts.testsuite) { + this.collectSuites(results, ts.testsuite); + } + // Only add suites that have direct test cases + // This avoids adding container suites that only hold nested suites + if (ts.testcase && ts.testcase.length > 0) { + const name = ts.$.name.trim(); + const time = parseFloat(ts.$.time) * 1000; + results.push(new TestSuiteResult(name, this.getGroups(ts), time)); + } + } + } + getGroups(suite) { + if (!suite.testcase || suite.testcase.length === 0) { + return []; + } + const groups = []; + for (const tc of suite.testcase) { + // Use classname (PHPUnit style) for grouping + // If classname matches suite name, use empty string to avoid redundancy + const className = tc.$.classname ?? tc.$.class ?? ''; + const groupName = className === suite.$.name ? '' : className; + let grp = groups.find(g => g.name === groupName); + if (grp === undefined) { + grp = { name: groupName, tests: [] }; + groups.push(grp); + } + grp.tests.push(tc); + } + return groups.map(grp => { + const tests = grp.tests.map(tc => { + const name = tc.$.name.trim(); + const result = this.getTestCaseResult(tc); + const time = parseFloat(tc.$.time) * 1000; + const error = this.getTestCaseError(tc); + return new TestCaseResult(name, result, time, error); + }); + return new TestGroupResult(grp.name, tests); + }); + } + getTestCaseResult(test) { + if (test.failure || test.error) + return 'failed'; + if (test.skipped) + return 'skipped'; + return 'success'; + } + getTestCaseError(tc) { + if (!this.options.parseErrors) { + return undefined; + } + // We process and the same way + const failures = tc.failure ?? tc.error; + if (!failures || failures.length === 0) { + return undefined; + } + const failure = failures[0]; + const details = typeof failure === 'string' ? failure : failure._ ?? ''; + // PHPUnit provides file path directly in testcase attributes + let filePath; + let line; + if (tc.$.file) { + const relativePath = this.getRelativePath(tc.$.file); + if (this.trackedFiles.has(relativePath)) { + filePath = relativePath; + } + if (tc.$.line) { + line = parseInt(tc.$.line); + } + } + // If file not in tracked files, try to extract from error details + if (!filePath && details) { + const extracted = this.extractFileAndLine(details); + if (extracted) { + filePath = extracted.filePath; + line = extracted.line; + } + } + let message; + if (typeof failure !== 'string' && failure.$) { + message = failure.$.message; + if (failure.$.type) { + message = message ? `${failure.$.type}: ${message}` : failure.$.type; + } + } + return { + path: filePath, + line, + details, + message + }; + } + extractFileAndLine(details) { + // PHPUnit stack traces typically have format: /path/to/file.php:123 + const lines = details.split(/\r?\n/); + for (const str of lines) { + // Match patterns like /path/to/file.php:123 or at /path/to/file.php(123) + const matchColon = str.match(/((?:[A-Za-z]:)?[^\s:()]+?\.(?:php|phpt)):(\d+)/); + if (matchColon) { + const relativePath = this.getRelativePath(matchColon[1]); + if (this.trackedFiles.has(relativePath)) { + return { filePath: relativePath, line: parseInt(matchColon[2]) }; + } + } + const matchParen = str.match(/((?:[A-Za-z]:)?[^\s:()]+?\.(?:php|phpt))\((\d+)\)/); + if (matchParen) { + const relativePath = this.getRelativePath(matchParen[1]); + if (this.trackedFiles.has(relativePath)) { + return { filePath: relativePath, line: parseInt(matchParen[2]) }; + } + } + } + return undefined; + } + /** + * Converts an absolute file path to a relative path by stripping the working directory prefix. + * + * @param path - The absolute file path from PHPUnit output (e.g., `/home/runner/work/repo/src/Test.php`) + * @returns The relative path (e.g., `src/Test.php`) if a working directory can be determined, + * otherwise returns the normalized original path + */ + getRelativePath(path) { + path = normalizeFilePath(path); + const workDir = this.getWorkDir(path); + if (workDir !== undefined && path.startsWith(workDir)) { + path = path.substring(workDir.length); + } + return path; + } + /** + * Determines the working directory prefix to strip from absolute file paths. + * + * The working directory is resolved using the following priority: + * + * 1. **Explicit configuration** - If `options.workDir` is set, it takes precedence. + * This allows users to explicitly specify the working directory. + * + * 2. **Cached assumption** - If we've previously determined a working directory + * (`assumedWorkDir`) and the current path starts with it, we reuse that value. + * This avoids redundant computation for subsequent paths. + * + * 3. **Heuristic detection** - Uses `getBasePath()` to find the common prefix between + * the absolute path and the list of tracked files in the repository. For example: + * - Absolute path: `/home/runner/work/repo/src/Test.php` + * - Tracked file: `src/Test.php` + * - Detected workDir: `/home/runner/work/repo/` + * + * Once detected, the working directory is cached in `assumedWorkDir` for efficiency. + * + * @param path - The normalized absolute file path to analyze + * @returns The working directory prefix (with trailing slash), or `undefined` if it cannot be determined + * + * @example + * // With tracked file 'src/Foo.php' and path '/home/runner/work/repo/src/Foo.php' + * // Returns: '/home/runner/work/repo/' + */ + getWorkDir(path) { + if (this.options.workDir) { + return this.options.workDir; + } + if (this.assumedWorkDir && path.startsWith(this.assumedWorkDir)) { + return this.assumedWorkDir; + } + const basePath = getBasePath(path, this.trackedFilesList); + if (basePath !== undefined) { + this.assumedWorkDir = basePath; + } + return basePath; + } +} + +;// CONCATENATED MODULE: ./lib/parsers/python-xunit/python-xunit-parser.js + +class PythonXunitParser extends JavaJunitParser { + options; + constructor(options) { + super(options); + this.options = options; + } +} + +;// CONCATENATED MODULE: ./lib/parsers/rspec-json/rspec-json-parser.js + +class RspecJsonParser { + options; + assumedWorkDir; + constructor(options) { + this.options = options; + } + async parse(path, content) { + const mocha = this.getRspecJson(path, content); + const result = this.getTestRunResult(path, mocha); + result.sort(true); + return Promise.resolve(result); + } + getRspecJson(path, content) { + try { + return JSON.parse(content); + } + catch (e) { + throw new Error(`Invalid JSON at ${path}\n\n${e}`); + } + } + getTestRunResult(resultsPath, rspec) { + const suitesMap = {}; + const getSuite = (test) => { + const path = test.file_path; + return suitesMap[path] ?? (suitesMap[path] = new TestSuiteResult(path, [])); + }; + for (const test of rspec.examples) { + const suite = getSuite(test); + if (test.status === 'failed') { + this.processTest(suite, test, 'failed'); + } + else if (test.status === 'passed') { + this.processTest(suite, test, 'success'); + } + else if (test.status === 'pending') { + this.processTest(suite, test, 'skipped'); + } + } + const suites = Object.values(suitesMap); + return new TestRunResult(resultsPath, suites, rspec.summary.duration); + } + processTest(suite, test, result) { + const groupName = test.full_description !== test.description + ? test.full_description.substring(0, test.full_description.length - test.description.length).trimEnd() + : null; + let group = suite.groups.find(grp => grp.name === groupName); + if (group === undefined) { + group = new TestGroupResult(groupName, []); + suite.groups.push(group); + } + const error = this.getTestCaseError(test); + const testCase = new TestCaseResult(test.full_description, result, test.run_time ?? 0, error); + group.tests.push(testCase); + } + getTestCaseError(test) { + const backtrace = test.exception?.backtrace; + const message = test.exception?.message; + if (backtrace === undefined) { + return undefined; + } + let path; + let line; + const details = backtrace.join('\n'); + const src = this.getExceptionSource(backtrace); + if (src) { + path = src.path; + line = src.line; + } + return { + path, + line, + message, + details + }; + } + getExceptionSource(backtrace) { + const re = /^(.*?):(\d+):/; + for (const str of backtrace) { + const match = str.match(re); + if (match !== null) { + const [_, path, lineStr] = match; + if (path.startsWith('./')) { + const line = parseInt(lineStr); + return { path, line }; + } + } + } + return undefined; + } +} + +;// CONCATENATED MODULE: ./lib/parsers/swift-xunit/swift-xunit-parser.js + +class SwiftXunitParser extends JavaJunitParser { + options; + constructor(options) { + super(options); + this.options = options; + } +} + +;// CONCATENATED MODULE: ./lib/parsers/tester-junit/tester-junit-parser.js + + + + +class NetteTesterJunitParser { + options; + trackedFiles; + trackedFilesList; + constructor(options) { + this.options = options; + this.trackedFilesList = options.trackedFiles.map(f => normalizeFilePath(f)); + this.trackedFiles = new Set(this.trackedFilesList); + } + async parse(filePath, content) { + const reportOrSuite = await this.getNetteTesterReport(filePath, content); + const isReport = reportOrSuite.testsuites !== undefined; + // XML might contain: + // - multiple suites under root node + // - single as root node + let report; + if (isReport) { + report = reportOrSuite; + } + else { + // Make it behave the same way as if suite was inside root node + const suite = reportOrSuite.testsuite; + report = { + testsuites: { + $: { time: suite.$.time }, + testsuite: [suite] + } + }; + } + return this.getTestRunResult(filePath, report); + } + async getNetteTesterReport(filePath, content) { + try { + return await (0,xml2js.parseStringPromise)(content); + } + catch (e) { + throw new Error(`Invalid XML at ${filePath}\n\n${e}`); + } + } + getTestRunResult(filePath, report) { + const suites = report.testsuites.testsuite === undefined + ? [] + : report.testsuites.testsuite.map((ts, index) => { + // Use report file name as suite name (user preference) + const fileName = external_path_.basename(filePath); + // If there are multiple test suites, add index to distinguish them + const name = report.testsuites.testsuite && report.testsuites.testsuite.length > 1 + ? `${fileName} #${index + 1}` + : fileName; + const time = parseFloat(ts.$.time) * 1000; + const sr = new TestSuiteResult(name, this.getGroups(ts), time); + return sr; + }); + const seconds = parseFloat(report.testsuites.$?.time ?? ''); + const time = isNaN(seconds) ? undefined : seconds * 1000; + return new TestRunResult(filePath, suites, time); + } + getGroups(suite) { + if (!suite.testcase || suite.testcase.length === 0) { + return []; + } + // Group tests by directory structure + const groups = new Map(); + for (const tc of suite.testcase) { + const parsed = this.parseTestCaseName(tc.$.classname); + const directory = external_path_.dirname(parsed.filePath); + if (!groups.has(directory)) { + groups.set(directory, []); + } + groups.get(directory).push(tc); + } + return Array.from(groups.entries()).map(([dir, tests]) => { + const testResults = tests.map(tc => { + const parsed = this.parseTestCaseName(tc.$.classname); + const result = this.getTestCaseResult(tc); + const time = parseFloat(tc.$.time || '0') * 1000; + const error = this.getTestCaseError(tc, parsed.filePath); + return new TestCaseResult(parsed.displayName, result, time, error); + }); + return new TestGroupResult(dir, testResults); + }); + } + /** + * Parse test case name from classname attribute. + * + * Handles multiple patterns: + * 1. Simple: "tests/Framework/Assert.equal.phpt" + * 2. With method: "tests/Framework/Assert.equal.recursive.phpt [method=testSimple]" + * 3. With description: "Prevent loop in error handling. The #268 regression. | tests/Framework/TestCase.ownErrorHandler.phpt" + * 4. With class and method: "Kdyby\BootstrapFormRenderer\BootstrapRenderer. | KdybyTests/BootstrapFormRenderer/BootstrapRendererTest.phpt [method=testRenderingBasics]" + */ + parseTestCaseName(classname) { + let filePath = classname; + let method; + let description; + let className; + // Pattern: "Description | filepath [method=methodName]" + // or "ClassName | filepath [method=methodName]" + const pipePattern = /^(.+?)\s*\|\s*(.+?)(?:\s*\[method=(.+?)\])?$/; + const pipeMatch = classname.match(pipePattern); + if (pipeMatch) { + const prefix = pipeMatch[1].trim(); + filePath = pipeMatch[2].trim(); + method = pipeMatch[3]; + // Check if prefix looks like a class name (contains backslash AND ends with dot) + // Examples: "Kdyby\BootstrapFormRenderer\BootstrapRenderer." + // vs description: "Prevent loop in error handling. The #268 regression." + if (prefix.includes('\\') && prefix.endsWith('.')) { + className = prefix; + } + else { + description = prefix; + } + } + else { + // Pattern: "filepath [method=methodName]" + const methodPattern = /^(.+?)\s*\[method=(.+?)\]$/; + const methodMatch = classname.match(methodPattern); + if (methodMatch) { + filePath = methodMatch[1].trim(); + method = methodMatch[2].trim(); + } + } + // Generate display name + const baseName = external_path_.basename(filePath); + let displayName = baseName; + if (method) { + displayName = `${baseName}::${method}`; + } + if (description) { + displayName = `${description} (${baseName})`; + } + else if (className && method) { + // For class names, keep them but still show the file + displayName = `${baseName}::${method}`; + } + return { filePath, method, description, className, displayName }; + } + getTestCaseResult(test) { + if (test.failure || test.error) + return 'failed'; + if (test.skipped) + return 'skipped'; + return 'success'; + } + getTestCaseError(tc, filePath) { + if (!this.options.parseErrors) { + return undefined; + } + // We process and the same way + const failures = tc.failure ?? tc.error; + if (!failures || failures.length === 0) { + return undefined; + } + const failure = failures[0]; + // For Nette Tester, details are in the message attribute, not as inner text + const details = typeof failure === 'string' ? failure : failure._ ?? failure.$?.message ?? ''; + // Try to extract file path and line from error details + let errorFilePath; + let line; + if (details) { + const extracted = this.extractFileAndLine(details); + if (extracted) { + errorFilePath = extracted.filePath; + line = extracted.line; + } + } + // Fallback: use test file path if tracked + if (!errorFilePath) { + const normalized = normalizeFilePath(filePath); + if (this.trackedFiles.has(normalized)) { + errorFilePath = normalized; + } + } + let message; + if (typeof failure !== 'string' && failure.$) { + message = failure.$.message; + if (failure.$.type) { + message = message ? `${failure.$.type}: ${message}` : failure.$.type; + } + } + return { + path: errorFilePath, + line, + details, + message + }; + } + /** + * Extract file path and line number from error details. + * Matches patterns like: /path/to/file.phpt:123 or /path/to/file.php:456 + */ + extractFileAndLine(details) { + const lines = details.split(/\r?\n/); + for (const str of lines) { + // Match PHP file patterns: /path/to/file.phpt:123 or /path/to/file.php:456 + const match = str.match(/((?:[A-Za-z]:)?[^\s:()]+?\.(?:php|phpt)):(\d+)/); + if (match) { + const normalized = normalizeFilePath(match[1]); + if (this.trackedFiles.has(normalized)) { + return { filePath: normalized, line: parseInt(match[2]) }; + } + } + } + return undefined; + } +} + +;// CONCATENATED MODULE: ./lib/main.js + + + + + + + + + + + + + + + + + + + + +async function main() { + try { + const testReporter = new TestReporter(); + await testReporter.run(); + } + catch (error) { + if (error instanceof Error) + core.setFailed(error); + else + core.setFailed(JSON.stringify(error)); + } +} +class TestReporter { + artifact = core.getInput('artifact', { required: false }); + name = core.getInput('name', { required: true }); + path = core.getInput('path', { required: true }); + pathReplaceBackslashes = core.getInput('path-replace-backslashes', { required: false }) === 'true'; + reporter = core.getInput('reporter', { required: true }); + listSuites = core.getInput('list-suites', { required: true }); + listTests = core.getInput('list-tests', { required: true }); + maxAnnotations = parseInt(core.getInput('max-annotations', { required: true })); + failOnError = core.getInput('fail-on-error', { required: true }) === 'true'; + failOnEmpty = core.getInput('fail-on-empty', { required: true }) === 'true'; + workDirInput = core.getInput('working-directory', { required: false }); + onlySummary = core.getInput('only-summary', { required: false }) === 'true'; + useActionsSummary = core.getInput('use-actions-summary', { required: false }) === 'true'; + badgeTitle = core.getInput('badge-title', { required: false }); + reportTitle = core.getInput('report-title', { required: false }); + collapsed = core.getInput('collapsed', { required: false }); + token = core.getInput('token', { required: true }); + octokit; + context = getCheckRunContext(); + constructor() { + this.octokit = github.getOctokit(this.token); + if (this.listSuites !== 'all' && this.listSuites !== 'failed' && this.listSuites !== 'none') { + core.setFailed(`Input parameter 'list-suites' has invalid value`); + return; + } + if (this.listTests !== 'all' && this.listTests !== 'failed' && this.listTests !== 'none') { + core.setFailed(`Input parameter 'list-tests' has invalid value`); + return; + } + if (this.collapsed !== 'auto' && this.collapsed !== 'always' && this.collapsed !== 'never') { + core.setFailed(`Input parameter 'collapsed' has invalid value`); + return; + } + if (isNaN(this.maxAnnotations) || this.maxAnnotations < 0 || this.maxAnnotations > 50) { + core.setFailed(`Input parameter 'max-annotations' has invalid value`); + return; + } + } + async run() { + if (this.workDirInput) { + core.info(`Changing directory to '${this.workDirInput}'`); + process.chdir(this.workDirInput); + } + core.info(`Check runs will be created with SHA=${this.context.sha}`); + // Split path pattern by ',' and optionally convert all backslashes to forward slashes + // fast-glob (micromatch) always interprets backslashes as escape characters instead of directory separators + const pathsList = this.path.split(','); + const pattern = this.pathReplaceBackslashes ? pathsList.map(normalizeFilePath) : pathsList; + const inputProvider = this.artifact + ? new ArtifactProvider(this.octokit, this.artifact, this.name, pattern, this.context.sha, this.context.runId, this.token) + : new LocalFileProvider(this.name, pattern); + const parseErrors = this.maxAnnotations > 0; + const trackedFiles = parseErrors ? await inputProvider.listTrackedFiles() : []; + const workDir = this.artifact ? undefined : normalizeDirPath(process.cwd(), true); + if (parseErrors) + core.info(`Found ${trackedFiles.length} files tracked by GitHub`); + const options = { + workDir, + trackedFiles, + parseErrors + }; + core.info(`Using test report parser '${this.reporter}'`); + const parser = this.getParser(this.reporter, options); + const results = []; + const input = await inputProvider.load(); + for (const [reportName, files] of Object.entries(input)) { + try { + core.startGroup(`Creating test report ${reportName}`); + const tr = await this.createReport(parser, reportName, files); + results.push(...tr); + } + finally { + core.endGroup(); + } + } + const isFailed = results.some(tr => tr.result === 'failed'); + const conclusion = isFailed ? 'failure' : 'success'; + const passed = results.reduce((sum, tr) => sum + tr.passed, 0); + const failed = results.reduce((sum, tr) => sum + tr.failed, 0); + const skipped = results.reduce((sum, tr) => sum + tr.skipped, 0); + const time = results.reduce((sum, tr) => sum + tr.time, 0); + core.setOutput('conclusion', conclusion); + core.setOutput('passed', passed); + core.setOutput('failed', failed); + core.setOutput('skipped', skipped); + core.setOutput('time', time); + if (this.failOnError && isFailed) { + core.setFailed(`Failed test were found and 'fail-on-error' option is set to ${this.failOnError}`); + return; + } + if (results.length === 0 && this.failOnEmpty) { + core.setFailed(`No test report files were found`); + return; + } + } + async createReport(parser, name, files) { + if (files.length === 0) { + core.warning(`No file matches path ${this.path}`); + return []; + } + core.info(`Processing test results for check run ${name}`); + const results = []; + for (const { file, content } of files) { + try { + const tr = await parser.parse(file, content); + results.push(tr); + } + catch (error) { + core.error(`Processing test results from ${file} failed`); + throw error; + } + } + const { listSuites, listTests, onlySummary, useActionsSummary, badgeTitle, reportTitle, collapsed } = this; + const passed = results.reduce((sum, tr) => sum + tr.passed, 0); + const failed = results.reduce((sum, tr) => sum + tr.failed, 0); + const skipped = results.reduce((sum, tr) => sum + tr.skipped, 0); + const shortSummary = `${passed} passed, ${failed} failed and ${skipped} skipped `; + let baseUrl = ''; + if (this.useActionsSummary) { + const summary = getReport(results, { + listSuites, + listTests, + baseUrl, + onlySummary, + useActionsSummary, + badgeTitle, + reportTitle, + collapsed + }, shortSummary); + core.info('Summary content:'); + core.info(summary); + await core.summary.addRaw(summary).write(); + } + else { + core.info(`Creating check run ${name}`); + const createResp = await this.octokit.rest.checks.create({ + head_sha: this.context.sha, + name, + status: 'in_progress', + output: { + title: name, + summary: '' + }, + ...github.context.repo + }); + core.info('Creating report summary'); + baseUrl = createResp.data.html_url; + const summary = getReport(results, { + listSuites, + listTests, + baseUrl, + onlySummary, + useActionsSummary, + badgeTitle, + reportTitle, + collapsed + }); + core.info('Creating annotations'); + const annotations = getAnnotations(results, this.maxAnnotations); + const isFailed = this.failOnError && results.some(tr => tr.result === 'failed'); + const conclusion = isFailed ? 'failure' : 'success'; + core.info(`Updating check run conclusion (${conclusion}) and output`); + const resp = await this.octokit.rest.checks.update({ + check_run_id: createResp.data.id, + conclusion, + status: 'completed', + output: { + title: shortSummary, + summary, + annotations + }, + ...github.context.repo + }); + core.info(`Check run create response: ${resp.status}`); + core.info(`Check run URL: ${resp.data.url}`); + core.info(`Check run HTML: ${resp.data.html_url}`); + core.setOutput('url', resp.data.url); + core.setOutput('url_html', resp.data.html_url); + } + return results; + } + getParser(reporter, options) { + switch (reporter) { + case 'dart-json': + return new DartJsonParser(options, 'dart'); + case 'dotnet-nunit': + return new DotnetNunitParser(options); + case 'dotnet-trx': + return new DotnetTrxParser(options); + case 'golang-json': + return new GolangJsonParser(options); + case 'flutter-json': + return new DartJsonParser(options, 'flutter'); + case 'java-junit': + return new JavaJunitParser(options); + case 'jest-junit': + return new JestJunitParser(options); + case 'mocha-json': + return new MochaJsonParser(options); + case 'phpunit-junit': + return new PhpunitJunitParser(options); + case 'python-xunit': + return new PythonXunitParser(options); + case 'rspec-json': + return new RspecJsonParser(options); + case 'swift-xunit': + return new SwiftXunitParser(options); + case 'tester-junit': + return new NetteTesterJunitParser(options); + default: + throw new Error(`Input variable 'reporter' is set to invalid value '${reporter}'`); + } + } +} +main(); + diff --git a/dist/package.json b/dist/package.json new file mode 100644 index 0000000..3dbc1ca --- /dev/null +++ b/dist/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +}