@one2x/playwright 1.57.0-alpha.1 → 1.57.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (155) hide show
  1. package/package.json +2 -2
  2. package/lib/agents/generateAgents.js.map +0 -7
  3. package/lib/common/config.js.map +0 -7
  4. package/lib/common/configLoader.js.map +0 -7
  5. package/lib/common/esmLoaderHost.js.map +0 -7
  6. package/lib/common/expectBundle.js.map +0 -7
  7. package/lib/common/expectBundleImpl.js.map +0 -7
  8. package/lib/common/fixtures.js.map +0 -7
  9. package/lib/common/globals.js.map +0 -7
  10. package/lib/common/ipc.js.map +0 -7
  11. package/lib/common/poolBuilder.js.map +0 -7
  12. package/lib/common/process.js.map +0 -7
  13. package/lib/common/suiteUtils.js.map +0 -7
  14. package/lib/common/test.js.map +0 -7
  15. package/lib/common/testLoader.js.map +0 -7
  16. package/lib/common/testType.js.map +0 -7
  17. package/lib/common/validators.js.map +0 -7
  18. package/lib/fsWatcher.js.map +0 -7
  19. package/lib/index.js.map +0 -7
  20. package/lib/internalsForTest.js.map +0 -7
  21. package/lib/isomorphic/events.js.map +0 -7
  22. package/lib/isomorphic/folders.js.map +0 -7
  23. package/lib/isomorphic/stringInternPool.js.map +0 -7
  24. package/lib/isomorphic/teleReceiver.js.map +0 -7
  25. package/lib/isomorphic/teleSuiteUpdater.js.map +0 -7
  26. package/lib/isomorphic/testServerConnection.js.map +0 -7
  27. package/lib/isomorphic/testServerInterface.js.map +0 -7
  28. package/lib/isomorphic/testTree.js.map +0 -7
  29. package/lib/isomorphic/types.d.js.map +0 -7
  30. package/lib/loader/loaderMain.js.map +0 -7
  31. package/lib/matchers/expect.js.map +0 -7
  32. package/lib/matchers/matcherHint.js.map +0 -7
  33. package/lib/matchers/matchers.js.map +0 -7
  34. package/lib/matchers/toBeTruthy.js.map +0 -7
  35. package/lib/matchers/toEqual.js.map +0 -7
  36. package/lib/matchers/toHaveURL.js.map +0 -7
  37. package/lib/matchers/toMatchAriaSnapshot.js.map +0 -7
  38. package/lib/matchers/toMatchSnapshot.js.map +0 -7
  39. package/lib/matchers/toMatchText.js.map +0 -7
  40. package/lib/mcp/browser/actions.d.js.map +0 -7
  41. package/lib/mcp/browser/browserContextFactory.js.map +0 -7
  42. package/lib/mcp/browser/browserServerBackend.js.map +0 -7
  43. package/lib/mcp/browser/codegen.js.map +0 -7
  44. package/lib/mcp/browser/config.js.map +0 -7
  45. package/lib/mcp/browser/context.js.map +0 -7
  46. package/lib/mcp/browser/response.js.map +0 -7
  47. package/lib/mcp/browser/sessionLog.js.map +0 -7
  48. package/lib/mcp/browser/tab.js.map +0 -7
  49. package/lib/mcp/browser/tools/actionRetry.js.map +0 -7
  50. package/lib/mcp/browser/tools/common.js.map +0 -7
  51. package/lib/mcp/browser/tools/console.js.map +0 -7
  52. package/lib/mcp/browser/tools/dialogs.js.map +0 -7
  53. package/lib/mcp/browser/tools/evaluate.js.map +0 -7
  54. package/lib/mcp/browser/tools/files.js.map +0 -7
  55. package/lib/mcp/browser/tools/form.js.map +0 -7
  56. package/lib/mcp/browser/tools/install.js.map +0 -7
  57. package/lib/mcp/browser/tools/keyboard.js.map +0 -7
  58. package/lib/mcp/browser/tools/mouse.js.map +0 -7
  59. package/lib/mcp/browser/tools/navigate.js.map +0 -7
  60. package/lib/mcp/browser/tools/network.js.map +0 -7
  61. package/lib/mcp/browser/tools/pdf.js.map +0 -7
  62. package/lib/mcp/browser/tools/screenshot.js.map +0 -7
  63. package/lib/mcp/browser/tools/snapshot.js.map +0 -7
  64. package/lib/mcp/browser/tools/tabs.js.map +0 -7
  65. package/lib/mcp/browser/tools/tool.js.map +0 -7
  66. package/lib/mcp/browser/tools/tracing.js.map +0 -7
  67. package/lib/mcp/browser/tools/utils.js.map +0 -7
  68. package/lib/mcp/browser/tools/verify.js.map +0 -7
  69. package/lib/mcp/browser/tools/wait.js.map +0 -7
  70. package/lib/mcp/browser/tools.js.map +0 -7
  71. package/lib/mcp/browser/watchdog.js.map +0 -7
  72. package/lib/mcp/config.d.js.map +0 -7
  73. package/lib/mcp/extension/cdpRelay.js.map +0 -7
  74. package/lib/mcp/extension/extensionContextFactory.js.map +0 -7
  75. package/lib/mcp/extension/protocol.js.map +0 -7
  76. package/lib/mcp/index.js.map +0 -7
  77. package/lib/mcp/log.js.map +0 -7
  78. package/lib/mcp/program.js.map +0 -7
  79. package/lib/mcp/sdk/bundle.js.map +0 -7
  80. package/lib/mcp/sdk/exports.js.map +0 -7
  81. package/lib/mcp/sdk/http.js.map +0 -7
  82. package/lib/mcp/sdk/inProcessTransport.js.map +0 -7
  83. package/lib/mcp/sdk/mdb.js.map +0 -7
  84. package/lib/mcp/sdk/proxyBackend.js.map +0 -7
  85. package/lib/mcp/sdk/server.js.map +0 -7
  86. package/lib/mcp/sdk/tool.js.map +0 -7
  87. package/lib/mcp/test/browserBackend.js.map +0 -7
  88. package/lib/mcp/test/generatorTools.js.map +0 -7
  89. package/lib/mcp/test/plannerTools.js.map +0 -7
  90. package/lib/mcp/test/seed.js.map +0 -7
  91. package/lib/mcp/test/streams.js.map +0 -7
  92. package/lib/mcp/test/testBackend.js.map +0 -7
  93. package/lib/mcp/test/testContext.js.map +0 -7
  94. package/lib/mcp/test/testTool.js.map +0 -7
  95. package/lib/mcp/test/testTools.js.map +0 -7
  96. package/lib/mcpBundleImpl.js.map +0 -7
  97. package/lib/plugins/gitCommitInfoPlugin.js.map +0 -7
  98. package/lib/plugins/index.js.map +0 -7
  99. package/lib/plugins/webServerPlugin.js.map +0 -7
  100. package/lib/program.js.map +0 -7
  101. package/lib/reporters/base.js.map +0 -7
  102. package/lib/reporters/blob.js.map +0 -7
  103. package/lib/reporters/dot.js.map +0 -7
  104. package/lib/reporters/empty.js.map +0 -7
  105. package/lib/reporters/github.js.map +0 -7
  106. package/lib/reporters/html.js.map +0 -7
  107. package/lib/reporters/internalReporter.js.map +0 -7
  108. package/lib/reporters/json.js.map +0 -7
  109. package/lib/reporters/junit.js.map +0 -7
  110. package/lib/reporters/line.js.map +0 -7
  111. package/lib/reporters/list.js.map +0 -7
  112. package/lib/reporters/listModeReporter.js.map +0 -7
  113. package/lib/reporters/markdown.js.map +0 -7
  114. package/lib/reporters/merge.js.map +0 -7
  115. package/lib/reporters/multiplexer.js.map +0 -7
  116. package/lib/reporters/reporterV2.js.map +0 -7
  117. package/lib/reporters/teleEmitter.js.map +0 -7
  118. package/lib/reporters/versions/blobV1.js.map +0 -7
  119. package/lib/runner/dispatcher.js.map +0 -7
  120. package/lib/runner/failureTracker.js.map +0 -7
  121. package/lib/runner/lastRun.js.map +0 -7
  122. package/lib/runner/loadUtils.js.map +0 -7
  123. package/lib/runner/loaderHost.js.map +0 -7
  124. package/lib/runner/processHost.js.map +0 -7
  125. package/lib/runner/projectUtils.js.map +0 -7
  126. package/lib/runner/rebase.js.map +0 -7
  127. package/lib/runner/reporters.js.map +0 -7
  128. package/lib/runner/runner.js +0 -110
  129. package/lib/runner/sigIntWatcher.js.map +0 -7
  130. package/lib/runner/taskRunner.js.map +0 -7
  131. package/lib/runner/tasks.js.map +0 -7
  132. package/lib/runner/testGroups.js.map +0 -7
  133. package/lib/runner/testRunner.js.map +0 -7
  134. package/lib/runner/testServer.js.map +0 -7
  135. package/lib/runner/uiModeReporter.js.map +0 -7
  136. package/lib/runner/vcs.js.map +0 -7
  137. package/lib/runner/watchMode.js.map +0 -7
  138. package/lib/runner/workerHost.js.map +0 -7
  139. package/lib/third_party/pirates.js.map +0 -7
  140. package/lib/third_party/tsconfig-loader.js.map +0 -7
  141. package/lib/transform/babelBundle.js.map +0 -7
  142. package/lib/transform/babelBundleImpl.js.map +0 -7
  143. package/lib/transform/compilationCache.js.map +0 -7
  144. package/lib/transform/esmLoader.js.map +0 -7
  145. package/lib/transform/portTransport.js.map +0 -7
  146. package/lib/transform/transform.js.map +0 -7
  147. package/lib/util.js.map +0 -7
  148. package/lib/utilsBundle.js.map +0 -7
  149. package/lib/utilsBundleImpl.js.map +0 -7
  150. package/lib/worker/fixtureRunner.js.map +0 -7
  151. package/lib/worker/testInfo.js.map +0 -7
  152. package/lib/worker/testTracing.js.map +0 -7
  153. package/lib/worker/timeoutManager.js.map +0 -7
  154. package/lib/worker/util.js.map +0 -7
  155. package/lib/worker/workerMain.js.map +0 -7
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/reporters/line.ts"],
4
- "sourcesContent": ["/**\n * Copyright (c) Microsoft Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { TerminalReporter } from './base';\n\nimport type { FullResult, Suite, TestCase, TestError, TestResult, TestStep } from '../../types/testReporter';\n\nclass LineReporter extends TerminalReporter {\n private _current = 0;\n private _failures = 0;\n private _lastTest: TestCase | undefined;\n private _didBegin = false;\n\n override onBegin(suite: Suite) {\n super.onBegin(suite);\n const startingMessage = this.generateStartingMessage();\n if (startingMessage) {\n this.writeLine(startingMessage);\n this.writeLine();\n }\n this._didBegin = true;\n }\n\n override onStdOut(chunk: string | Buffer, test?: TestCase, result?: TestResult) {\n super.onStdOut(chunk, test, result);\n this._dumpToStdio(test, chunk, this.screen.stdout);\n }\n\n override onStdErr(chunk: string | Buffer, test?: TestCase, result?: TestResult) {\n super.onStdErr(chunk, test, result);\n this._dumpToStdio(test, chunk, this.screen.stderr);\n }\n\n private _dumpToStdio(test: TestCase | undefined, chunk: string | Buffer, stream: NodeJS.WriteStream) {\n if (this.config.quiet)\n return;\n if (!process.env.PW_TEST_DEBUG_REPORTERS)\n stream.write(`\\u001B[1A\\u001B[2K`);\n if (test && this._lastTest !== test) {\n // Write new header for the output.\n const title = this.screen.colors.dim(this.formatTestTitle(test));\n stream.write(this.fitToScreen(title) + `\\n`);\n this._lastTest = test;\n }\n\n stream.write(chunk);\n if (chunk[chunk.length - 1] !== '\\n')\n this.writeLine();\n\n this.writeLine();\n }\n\n onTestBegin(test: TestCase, result: TestResult) {\n ++this._current;\n this._updateLine(test, result, undefined);\n }\n\n onStepBegin(test: TestCase, result: TestResult, step: TestStep) {\n if (this.screen.isTTY && step.category === 'test.step')\n this._updateLine(test, result, step);\n }\n\n onStepEnd(test: TestCase, result: TestResult, step: TestStep) {\n if (this.screen.isTTY && step.category === 'test.step')\n this._updateLine(test, result, step.parent);\n }\n\n override onTestEnd(test: TestCase, result: TestResult) {\n super.onTestEnd(test, result);\n if (!this.willRetry(test) && (test.outcome() === 'flaky' || test.outcome() === 'unexpected' || result.status === 'interrupted')) {\n if (!process.env.PW_TEST_DEBUG_REPORTERS)\n this.screen.stdout.write(`\\u001B[1A\\u001B[2K`);\n this.writeLine(this.formatFailure(test, ++this._failures));\n this.writeLine();\n }\n }\n\n private _updateLine(test: TestCase, result: TestResult, step?: TestStep) {\n const retriesPrefix = this.totalTestCount < this._current ? ` (retries)` : ``;\n const prefix = `[${this._current}/${this.totalTestCount}]${retriesPrefix} `;\n const currentRetrySuffix = result.retry ? this.screen.colors.yellow(` (retry #${result.retry})`) : '';\n const title = this.formatTestTitle(test, step) + currentRetrySuffix;\n if (process.env.PW_TEST_DEBUG_REPORTERS)\n this.screen.stdout.write(`${prefix + title}\\n`);\n else\n this.screen.stdout.write(`\\u001B[1A\\u001B[2K${prefix + this.fitToScreen(title, prefix)}\\n`);\n }\n\n override onError(error: TestError): void {\n super.onError(error);\n\n const message = this.formatError(error).message + '\\n';\n if (!process.env.PW_TEST_DEBUG_REPORTERS && this._didBegin)\n this.screen.stdout.write(`\\u001B[1A\\u001B[2K`);\n this.screen.stdout.write(message);\n this.writeLine();\n }\n\n override async onEnd(result: FullResult) {\n if (!process.env.PW_TEST_DEBUG_REPORTERS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AEnB,UAAM,UAAU,KAAK,YAAY,KAAK,EAAE,UAAU;AAClD,QAAI,CAAC,QAAQ,IAAI,2BAA2B,KAAK;AAC/C,WAAK,OAAO,OAAO,MAAM,gBAAoB;AAC/C,SAAK,OAAO,OAAO,MAAM,OAAO;AAChC,SAAK,UAAU;AAAA,EACjB;AAAA,EAEA,MAAe,MAAM,QAAoB;AACvC,QAAI,CAAC,QAAQ,IAAI,2BAA2B,KAAK;AAC/C,WAAK,OAAO,OAAO,MAAM,gBAAoB;AAC/C,UAAM,MAAM,MAAM,MAAM;AACxB,SAAK,SAAS,KAAK;AAAA,EACrB;AACF;AAEA,IAAO,eAAQ;",
6
- "names": []
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/reporters/list.ts"],
4
- "sourcesContent": ["/**\n * Copyright (c) Microsoft Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { getAsBooleanFromENV } from 'playwright-core/lib/utils';\nimport { ms as milliseconds } from 'playwright-core/lib/utilsBundle';\n\nimport { TerminalReporter, stepSuffix } from './base';\nimport { stripAnsiEscapes } from '../util';\n\nimport type { ListReporterOptions } from '../../types/test';\nimport type { FullResult, Suite, TestCase, TestError, TestResult, TestStep } from '../../types/testReporter';\nimport type { CommonReporterOptions, TerminalReporterOptions } from './base';\n\n// Allow it in the Visual Studio Code Terminal and the new Windows Terminal\nconst DOES_NOT_SUPPORT_UTF8_IN_TERMINAL = process.platform === 'win32' && process.env.TERM_PROGRAM !== 'vscode' && !process.env.WT_SESSION;\nconst POSITIVE_STATUS_MARK = DOES_NOT_SUPPORT_UTF8_IN_TERMINAL ? 'ok' : '\u2713';\nconst NEGATIVE_STATUS_MARK = DOES_NOT_SUPPORT_UTF8_IN_TERMINAL ? 'x' : '\u2718';\n\nclass ListReporter extends TerminalReporter {\n private _lastRow = 0;\n private _lastColumn = 0;\n private _testRows = new Map<TestCase, number>();\n private _stepRows = new Map<TestStep, number>();\n private _resultIndex = new Map<TestResult, string>();\n private _stepIndex = new Map<TestStep, string>();\n private _needNewLine = false;\n private _printSteps: boolean;\n\n constructor(options?: ListReporterOptions & CommonReporterOptions & TerminalReporterOptions) {\n super(options);\n this._printSteps = getAsBooleanFromENV('PLAYWRIGHT_LIST_PRINT_STEPS', options?.printSteps);\n }\n\n override onBegin(suite: Suite) {\n super.onBegin(suite);\n const startingMessage = this.generateStartingMessage();\n if (startingMessage) {\n this.writeLine(startingMessage);\n this.writeLine('');\n }\n }\n\n onTestBegin(test: TestCase, result: TestResult) {\n const index = String(this._resultIndex.size + 1);\n this._resultIndex.set(result, index);\n\n if (!this.screen.isTTY)\n return;\n this._maybeWriteNewLine();\n this._testRows.set(test, this._lastRow);\n const prefix = this._testPrefix(index, '');\n const line = this.screen.colors.dim(this.formatTestTitle(test)) + this._retrySuffix(result);\n this._appendLine(line, prefix);\n }\n\n override onStdOut(chunk: string | Buffer, test?: TestCase, result?: TestResult) {\n super.onStdOut(chunk, test, result);\n this._dumpToStdio(test, chunk, this.screen.stdout, 'out');\n }\n\n override onStdErr(chunk: string | Buffer, test?: TestCase, result?: TestResult) {\n super.onStdErr(chunk, test, result);\n this._dumpToStdio(test, chunk, this.screen.stderr, 'err');\n }\n\n private getStepIndex(testIndex: string, result: TestResult, step: TestStep): string {\n if (this._stepIndex.has(step))\n return this._stepIndex.get(step)!;\n\n const ordinal = ((result as any)[lastStepOrdinalSymbol] || 0) + 1;\n (result as any)[lastStepOrdinalSymbol] = ordinal;\n const stepIndex = `${testIndex}.${ordinal}`;\n this._stepIndex.set(step, stepIndex);\n return stepIndex;\n }\n\n onStepBegin(test: TestCase, result: TestResult, step: TestStep) {\n if (step.category !== 'test.step')\n return;\n const testIndex = this._resultIndex.get(result) || '';\n\n if (!this.screen.isTTY)\n return;\n\n if (this._printSteps) {\n this._maybeWriteNewLine();\n this._stepRows.set(step, this._lastRow);\n const prefix = this._testPrefix(this.getStepIndex(testIndex, result, step), '');\n const line = test.title + this.screen.colors.dim(stepSuffix(step));\n this._appendLine(line, prefix);\n } else {\n this._updateOrAppendLine(this._testRows, test, this.screen.colors.dim(this.formatTestTitle(test, step)) + this._retrySuffix(result), this._testPrefix(testIndex, ''));\n }\n }\n\n onStepEnd(test: TestCase, result: TestResult, step: TestStep) {\n if (step.category !== 'test.step')\n return;\n\n const testIndex = this._resultIndex.get(result) || '';\n if (!this._printSteps) {\n if (this.screen.isTTY)\n this._updateOrAppendLine(this._testRows, test, this.screen.colors.dim(this.formatTestTitle(test, step.parent)) + this._retrySuffix(result), this._testPrefix(testIndex, ''));\n return;\n }\n\n const index = this.getStepIndex(testIndex, result, step);\n const title = this.screen.isTTY ? test.title + this.screen.colors.dim(stepSuffix(step)) : this.formatTestTitle(test, step);\n const prefix = this._testPrefix(index, '');\n let text = '';\n if (step.error)\n text = this.screen.colors.red(title);\n else\n text = title;\n text += this.screen.colors.dim(` (${milliseconds(step.duration)})`);\n\n this._updateOrAppendLine(this._stepRows, step, text, prefix);\n }\n\n private _maybeWriteNewLine() {\n if (this._needNewLine) {\n this._needNewLine = false;\n this.screen.stdout.write('\\n');\n ++this._lastRow;\n this._lastColumn = 0;\n }\n }\n\n private _updateLineCountAndNewLineFlagForOutput(text: string) {\n this._needNewLine = text[text.length - 1] !== '\\n';\n if (!this.screen.ttyWidth)\n return;\n for (const ch of text) {\n if (ch === '\\n') {\n this._lastColumn = 0;\n ++this._lastRow;\n continue;\n }\n ++this._lastColumn;\n if (this._lastColumn > this.screen.ttyWidth) {\n this._lastColumn = 0;\n ++this._lastRow;\n }\n }\n }\n\n private _dumpToStdio(test: TestCase | undefined, chunk: string | Buffer, stream: NodeJS.WriteStream, stdio: 'out' | 'err') {\n if (this.config.quiet)\n return;\n const text = chunk.toString('utf-8');\n this._updateLineCountAndNewLineFlagForOutput(text);\n stream.write(chunk);\n }\n\n override onTestEnd(test: TestCase, result: TestResult) {\n super.onTestEnd(test, result);\n\n const title = this.formatTestTitle(test);\n let prefix = '';\n let text = '';\n\n // In TTY mode test index is incremented in onTestStart\n // and in non-TTY mode it is incremented onTestEnd.\n let index = this._resultIndex.get(result);\n if (!index) {\n index = String(this._resultIndex.size + 1);\n this._resultIndex.set(result, index);\n }\n\n if (result.status === 'skipped') {\n prefix = this._testPrefix(index, this.screen.colors.green('-'));\n // Do not show duration for skipped.\n text = this.screen.colors.cyan(title) + this._retrySuffix(result);\n } else {\n const statusMark = result.status === 'passed' ? POSITIVE_STATUS_MARK : NEGATIVE_STATUS_MARK;\n if (result.status === test.expectedStatus) {\n prefix = this._testPrefix(index, this.screen.colors.green(statusMark));\n text = title;\n } else {\n prefix = this._testPrefix(index, this.screen.colors.red(statusMark));\n text = this.screen.colors.red(title);\n }\n text += this._retrySuffix(result) + this.screen.colors.dim(` (${milliseconds(result.duration)})`);\n }\n\n this._updateOrAppendLine(this._testRows, test, text, prefix);\n }\n\n private _updateOrAppendLine<T>(entityRowNumbers: Map<T, number>, entity: T, text: string, prefix: string) {\n const row = entityRowNumbers.get(entity);\n // Only update the line if we assume that the line is still on the screen\n if (row !== undefined && this.screen.isTTY && this._lastRow - row < this.screen.ttyHeight) {\n this._updateLine(row, text, prefix);\n } else {\n this._maybeWriteNewLine();\n entityRowNumbers.set(entity, this._lastRow);\n this._appendLine(text, prefix);\n }\n }\n\n private _appendLine(text: string, prefix: string) {\n const line = prefix + this.fitToScreen(text, prefix);\n if (process.env.PW_TEST_DEBUG_REPORTERS) {\n this.screen.stdout.write('#' + this._lastRow + ' : ' + line + '\\n');\n } else {\n this.screen.stdout.write(line);\n this.screen.stdout.write('\\n');\n }\n ++this._lastRow;\n this._lastColumn = 0;\n }\n\n private _updateLine(row: number, text: string, prefix: string) {\n const line = prefix + this.fitToScreen(text, prefix);\n if (process.env.PW_TEST_DEBUG_REPORTERS)\n this.screen.stdout.write('#' + row + ' : ' + line + '\\n');\n else\n this._updateLineForTTY(row, line);\n }\n\n private _updateLineForTTY(row: number, line: string) {\n // Go up if needed\n if (row !== this._lastRow)\n this.screen.stdout.write(`\\u001B[${this._lastRow - row}A`);\n // Erase line, go to the start\n this.screen.stdout.write('\\u001B[2K\\u001B[0G');\n this.screen.stdout.write(line);\n // Go down if needed.\n if (row !== this._lastRow)\n this.screen.stdout.write(`\\u001B[${this._lastRow - row}E`);\n }\n\n private _testPrefix(index: string, statusMark: string) {\n const statusMarkLength = stripAnsiEscapes(statusMark).length;\n const indexLength = Math.ceil(Math.log10(this.totalTestCount + 1));\n return ' ' + statusMark + ' '.repeat(3 - statusMarkLength) + this.screen.colors.dim(index.padStart(indexLength) + ' ');\n }\n\n private _retrySuffix(result: TestResult) {\n return (result.retry ? this.screen.colors.yellow(` (retry #${result.retry})`) : '');\n }\n\n override onError(error: TestError): void {\n super.onError(error);\n this._maybeWriteNewLine();\n const message = this.formatError(error).message + '\\n';\n this._updateLineCountAndNewLineFlagForOutput(message);\n this.screen.stdout.write(message);\n }\n\n override async onEnd(result: FullResult) {\n await super.onEnd(result);\n this.screen.stdout.write('\\n');\n this.epilogue(true);\n }\n}\n\nconst lastStepOrdinalSymbol = Symbol('lastStepOrdinal');\n\nexport default ListReporter;\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBA,mBAAoC;AACpC,yBAAmC;AAEnC,kBAA6C;AAC7C,kBAAiC;AAOjC,MAAM,oCAAoC,QAAQ,aAAa,WAAW,QAAQ,IAAI,iBAAiB,YAAY,CAAC,QAAQ,IAAI;AAChI,MAAM,uBAAuB,oCAAoC,OAAO;AACxE,MAAM,uBAAuB,oCAAoC,MAAM;AAEvE,MAAM,qBAAqB,6BAAiB;AAAA,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;AACxB,UAAM,UAAU,KAAK,YAAY,KAAK,EAAE,UAAU;AAClD,SAAK,wCAAwC,OAAO;AACpD,SAAK,OAAO,OAAO,MAAM,OAAO;AAAA,EAClC;AAAA,EAEA,MAAe,MAAM,QAAoB;AACvC,UAAM,MAAM,MAAM,MAAM;AACxB,SAAK,OAAO,OAAO,MAAM,IAAI;AAC7B,SAAK,SAAS,IAAI;AAAA,EACpB;AACF;AAEA,MAAM,wBAAwB,OAAO,iBAAiB;AAEtD,IAAO,eAAQ;",
6
- "names": ["milliseconds"]
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/reporters/listModeReporter.ts"],
4
- "sourcesContent": ["/**\n * Copyright Microsoft Corporation. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport path from 'path';\n\nimport { formatError, terminalScreen } from './base';\n\nimport type { FullConfig, TestError } from '../../types/testReporter';\nimport type { Suite } from '../common/test';\nimport type { TerminalScreen } from './base';\nimport type { ReporterV2 } from './reporterV2';\n\nclass ListModeReporter implements ReporterV2 {\n private config!: FullConfig;\n private screen: TerminalScreen;\n private _options: { screen?: TerminalScreen, includeTestId?: boolean };\n\n constructor(options: { screen?: TerminalScreen, includeTestId?: boolean } = {}) {\n this._options = options;\n this.screen = options?.screen ?? terminalScreen;\n }\n\n version(): 'v2' {\n return 'v2';\n }\n\n onConfigure(config: FullConfig) {\n this.config = config;\n }\n\n onBegin(suite: Suite): void {\n this._writeLine(`Listing tests:`);\n const tests = suite.allTests();\n const files = new Set<string>();\n for (const test of tests) {\n // root, project, file, ...describes, test\n const [, projectName, , ...titles] = test.titlePath();\n const location = `${path.relative(this.config.rootDir, test.location.file)}:${test.location.line}:${test.location.column}`;\n const testId = this._options.includeTestId ? `[id=${test.id}] ` : '';\n const projectLabel = this._options.includeTestId ? `project=` : '';\n const projectTitle = projectName ? `[${projectLabel}${projectName}] \u203A ` : '';\n this._writeLine(` ${testId}${projectTitle}${location} \u203A ${titles.join(' \u203A ')}`);\n files.add(test.location.file);\n }\n this._writeLine(`Total: ${tests.length} ${tests.length === 1 ? 'test' : 'tests'} in ${files.size} ${files.size === 1 ? 'file' : 'files'}`);\n }\n\n onError(error: TestError) {\n this.screen.stderr.write('\\n' + formatError(terminalScreen, error).message + '\\n');\n }\n\n private _writeLine(line: string) {\n this.screen.stdout.write(line + '\\n');\n }\n}\n\nexport default ListModeReporter;\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBA,kBAAiB;AAEjB,kBAA4C;AAO5C,MAAM,iBAAuC;AAAA,EAK3C,YAAY,UAAgE,CAAC,GAAG;AAC9E,SAAK,WAAW;AAChB,SAAK,SAAS,SAAS,UAAU;AAAA,EACnC;AAAA,EAEA,UAAgB;AACd,WAAO;AAAA,EACT;AAAA,EAEA,YAAY,QAAoB;AAC9B,SAAK,SAAS;AAAA,EAChB;AAAA,EAEA,QAAQ,OAAoB;AAC1B,SAAK,WAAW,gBAAgB;AAChC,UAAM,QAAQ,MAAM,SAAS;AAC7B,UAAM,QAAQ,oBAAI,IAAY;AAC9B,eAAW,QAAQ,OAAO;AAExB,YAAM,CAAC,EAAE,aAAa,EAAE,GAAG,MAAM,IAAI,KAAK,UAAU;AACpD,YAAM,WAAW,GAAG,YAAAA,QAAK,SAAS,KAAK,OAAO,SAAS,KAAK,SAAS,IAAI,CAAC,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,SAAS,MAAM;AACxH,YAAM,SAAS,KAAK,SAAS,gBAAgB,OAAO,KAAK,EAAE,OAAO;AAClE,YAAM,eAAe,KAAK,SAAS,gBAAgB,aAAa;AAChE,YAAM,eAAe,cAAc,IAAI,YAAY,GAAG,WAAW,cAAS;AAC1E,WAAK,WAAW,KAAK,MAAM,GAAG,YAAY,GAAG,QAAQ,WAAM,OAAO,KAAK,UAAK,CAAC,EAAE;AAC/E,YAAM,IAAI,KAAK,SAAS,IAAI;AAAA,IAC9B;AACA,SAAK,WAAW,UAAU,MAAM,MAAM,IAAI,MAAM,WAAW,IAAI,SAAS,OAAO,OAAO,MAAM,IAAI,IAAI,MAAM,SAAS,IAAI,SAAS,OAAO,EAAE;AAAA,EAC3I;AAAA,EAEA,QAAQ,OAAkB;AACxB,SAAK,OAAO,OAAO,MAAM,WAAO,yBAAY,4BAAgB,KAAK,EAAE,UAAU,IAAI;AAAA,EACnF;AAAA,EAEQ,WAAW,MAAc;AAC/B,SAAK,OAAO,OAAO,MAAM,OAAO,IAAI;AAAA,EACtC;AACF;AAEA,IAAO,2BAAQ;",
6
- "names": ["path"]
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/reporters/markdown.ts"],
4
- "sourcesContent": ["/**\n * Copyright (c) Microsoft Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport fs from 'fs';\nimport path from 'path';\n\nimport type { FullConfig, FullResult, Reporter, Suite, TestCase, TestError } from '@playwright/test/reporter';\n\ntype MarkdownReporterOptions = {\n configDir: string, // TODO: make it public?\n outputFile?: string;\n};\n\nclass MarkdownReporter implements Reporter {\n private _options: MarkdownReporterOptions;\n private _fatalErrors: TestError[] = [];\n protected _config!: FullConfig;\n private _suite!: Suite;\n\n constructor(options: MarkdownReporterOptions) {\n this._options = options;\n }\n\n printsToStdio() {\n return false;\n }\n\n onBegin(config: FullConfig, suite: Suite) {\n this._config = config;\n this._suite = suite;\n }\n\n onError(error: TestError) {\n this._fatalErrors.push(error);\n }\n\n async onEnd(result: FullResult) {\n const summary = this._generateSummary();\n const lines: string[] = [];\n if (this._fatalErrors.length)\n lines.push(`**${this._fatalErrors.length} fatal errors, not part of any test**`);\n if (summary.unexpected.length) {\n lines.push(`**${summary.unexpected.length} failed**`);\n this._printTestList(':x:', summary.unexpected, lines);\n }\n if (summary.flaky.length) {\n lines.push(`<details>`);\n lines.push(`<summary><b>${summary.flaky.length} flaky</b></summary>`);\n this._printTestList(':warning:', summary.flaky, lines, ' <br/>');\n lines.push(`</details>`);\n lines.push(``);\n }\n if (summary.interrupted.length) {\n lines.push(`<details>`);\n lines.push(`<summary><b>${summary.interrupted.length} interrupted</b></summary>`);\n this._printTestList(':warning:', summary.interrupted, lines, ' <br/>');\n lines.push(`</details>`);\n lines.push(``);\n }\n const skipped = summary.skipped ? `, ${summary.skipped} skipped` : '';\n const didNotRun = summary.didNotRun ? `, ${summary.didNotRun} did not run` : '';\n lines.push(`**${summary.expected} passed${skipped}${didNotRun}**`);\n lines.push(``);\n\n await this.publishReport(lines.join('\\n'));\n }\n\n protected async publishReport(report: string): Promise<void> {\n const maybeRelativeFile = this._options.outputFile || 'report.md';\n const reportFile = path.resolve(this._options.configDir, maybeRelativeFile);\n await fs.promises.mkdir(path.dirname(reportFile), { recursive: true });\n await fs.promises.writeFile(reportFile, report);\n }\n\n protected _generateSummary() {\n let didNotRun = 0;\n let skipped = 0;\n let expected = 0;\n const interrupted: TestCase[] = [];\n const interruptedToPrint: TestCase[] = [];\n const unexpected: TestCase[] = [];\n const flaky: TestCase[] = [];\n\n this._suite.allTests().forEach(test => {\n switch (test.outcome()) {\n case 'skipped': {\n if (test.results.some(result => result.status === 'interrupted')) {\n if (test.results.some(result => !!result.error))\n interruptedToPrint.push(test);\n interrupted.push(test);\n } else if (!test.results.length || test.expectedStatus !== 'skipped') {\n ++didNotRun;\n } else {\n ++skipped;\n }\n break;\n }\n case 'expected': ++expected; break;\n case 'unexpected': unexpected.push(test); break;\n case 'flaky': flaky.push(test); break;\n }\n });\n\n return {\n didNotRun,\n skipped,\n expected,\n interrupted,\n unexpected,\n flaky,\n };\n }\n\n private _printTestList(prefix: string, tests: TestCase[], lines: string[], suffix?: string) {\n for (const test of tests)\n lines.push(`${prefix} ${formatTestTitle(this._config.rootDir, test)}${suffix || ''}`);\n lines.push(``);\n }\n}\n\nfunction formatTestTitle(rootDir: string, test: TestCase): string {\n // root, project, file, ...describes, test\n const [, projectName, , ...titles] = test.titlePath();\n const relativeTestPath = path.relative(rootDir, test.location.file);\n // intentionally leave out column to prevent writing test.spec.ts:100:5 - GitHub turns that into \uD83D\uDCAF\n const location = `${relativeTestPath}:${test.location.line}`;\n const projectTitle = projectName ? `[${projectName}] \u203A ` : '';\n const testTitle = `${projectTitle}${location} \u203A ${titles.join(' \u203A ')}`;\n const extraTags = test.tags.filter(t => !testTitle.includes(t));\n const formattedTags = extraTags.map(t => `\\`${t}\\``).join(' ');\n return `${testTitle}${extraTags.length ? ' ' + formattedTags : ''}`;\n}\n\nexport default MarkdownReporter;\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBA,gBAAe;AACf,kBAAiB;AASjB,MAAM,iBAAqC;AAAA,EAMzC,YAAY,SAAkC;AAJ9C,SAAQ,eAA4B,CAAC;AAKnC,SAAK,WAAW;AAAA,EAClB;AAAA,EAEA,gBAAgB;AACd,WAAO;AAAA,EACT;AAAA,EAEA,QAAQ,QAAoB,OAAc;AACxC,SAAK,UAAU;AACf,SAAK,SAAS;AAAA,EAChB;AAAA,EAEA,QAAQ,OAAkB;AACxB,SAAK,aAAa,KAAK,KAAK;AAAA,EAC9B;AAAA,EAEA,MAAM,MAAM,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,QAAK,SAAS,SAAS,KAAK,SAAS,IAAI;AAElE,QAAM,WAAW,GAAG,gBAAgB,IAAI,KAAK,SAAS,IAAI;AAC1D,QAAM,eAAe,cAAc,IAAI,WAAW,cAAS;AAC3D,QAAM,YAAY,GAAG,YAAY,GAAG,QAAQ,WAAM,OAAO,KAAK,UAAK,CAAC;AACpE,QAAM,YAAY,KAAK,KAAK,OAAO,OAAK,CAAC,UAAU,SAAS,CAAC,CAAC;AAC9D,QAAM,gBAAgB,UAAU,IAAI,OAAK,KAAK,CAAC,IAAI,EAAE,KAAK,GAAG;AAC7D,SAAO,GAAG,SAAS,GAAG,UAAU,SAAS,MAAM,gBAAgB,EAAE;AACnE;AAEA,IAAO,mBAAQ;",
6
- "names": ["path", "fs"]
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/reporters/merge.ts"],
4
- "sourcesContent": ["/**\n * Copyright (c) Microsoft Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport fs from 'fs';\nimport path from 'path';\n\nimport { ZipFile } from 'playwright-core/lib/utils';\n\nimport { currentBlobReportVersion } from './blob';\nimport { Multiplexer } from './multiplexer';\nimport { JsonStringInternalizer, StringInternPool } from '../isomorphic/stringInternPool';\nimport { TeleReporterReceiver } from '../isomorphic/teleReceiver';\nimport { createReporters } from '../runner/reporters';\nimport { relativeFilePath } from '../util';\n\nimport type { ReporterDescription, TestAnnotation } from '../../types/test';\nimport type { TestError } from '../../types/testReporter';\nimport type { FullConfigInternal } from '../common/config';\nimport type { BlobReportMetadata, JsonAttachment, JsonConfig, JsonEvent, JsonFullResult, JsonLocation, JsonOnConfigureEvent, JsonOnEndEvent, JsonOnProjectEvent, JsonProject, JsonSuite, JsonTestCase } from '../isomorphic/teleReceiver';\nimport type * as blobV1 from './versions/blobV1';\n\ntype StatusCallback = (message: string) => void;\n\ntype ReportData = {\n eventPatchers: JsonEventPatchers;\n reportFile: string;\n metadata: BlobReportMetadata;\n tags: string[];\n};\n\nexport async function createMergedReport(config: FullConfigInternal, dir: string, reporterDescriptions: ReporterDescription[], rootDirOverride: string | undefined) {\n const reporters = await createReporters(config, 'merge', reporterDescriptions);\n const multiplexer = new Multiplexer(reporters);\n const stringPool = new StringInternPool();\n\n let printStatus: StatusCallback = () => {};\n if (!multiplexer.printsToStdio()) {\n printStatus = printStatusToStdout;\n printStatus(`merging reports from ${dir}`);\n }\n\n const shardFiles = await sortedShardFiles(dir);\n if (shardFiles.length === 0)\n throw new Error(`No report files found in ${dir}`);\n const eventData = await mergeEvents(dir, shardFiles, stringPool, printStatus, rootDirOverride);\n // If explicit config is provided, use platform path separator, otherwise use the one from the report (if any).\n const pathSeparator = rootDirOverride ? path.sep : (eventData.pathSeparatorFromMetadata ?? path.sep);\n const receiver = new TeleReporterReceiver(multiplexer, {\n mergeProjects: false,\n mergeTestCases: false,\n resolvePath: (rootDir, relativePath) => stringPool.internString(rootDir + pathSeparator + relativePath),\n configOverrides: config.config,\n });\n printStatus(`processing test events`);\n\n const dispatchEvents = async (events: JsonEvent[]) => {\n for (const event of events) {\n if (event.method === 'onEnd')\n printStatus(`building final report`);\n await receiver.dispatch(event);\n if (event.method === 'onEnd')\n printStatus(`finished building report`);\n }\n };\n\n await dispatchEvents(eventData.prologue);\n for (const { reportFile, eventPatchers, metadata, tags } of eventData.reports) {\n const reportJsonl = await fs.promises.readFile(reportFile);\n const events = parseTestEvents(reportJsonl);\n new JsonStringInternalizer(stringPool).traverse(events);\n eventPatchers.patchers.push(new AttachmentPathPatcher(dir));\n if (metadata.name)\n eventPatchers.patchers.push(new GlobalErrorPatcher(metadata.name));\n if (tags.length)\n eventPatchers.patchers.push(new GlobalErrorPatcher(tags.join(' ')));\n eventPatchers.patchEvents(events);\n await dispatchEvents(events);\n }\n await dispatchEvents(eventData.epilogue);\n}\n\nconst commonEventNames = ['onBlobReportMetadata', 'onConfigure', 'onProject', 'onBegin', 'onEnd'];\nconst commonEvents = new Set(commonEventNames);\nconst commonEventRegex = new RegExp(`${commonEventNames.join('|')}`);\n\nfunction parseCommonEvents(reportJsonl: Buffer): JsonEvent[] {\n return splitBufferLines(reportJsonl)\n .map(line => line.toString('utf8'))\n .filter(line => commonEventRegex.test(line)) // quick filter\n .map(line => JSON.parse(line) as JsonEvent)\n .filter(event => commonEvents.has(event.method));\n}\n\nfunction parseTestEvents(reportJsonl: Buffer): JsonEvent[] {\n return splitBufferLines(reportJsonl)\n .map(line => line.toString('utf8'))\n .filter(line => line.length)\n .map(line => JSON.parse(line) as JsonEvent)\n .filter(event => !commonEvents.has(event.method));\n}\n\nfunction splitBufferLines(buffer: Buffer) {\n const lines = [];\n let start = 0;\n while (start < buffer.length) {\n // 0x0A is the byte for '\\n'\n const end = buffer.indexOf(0x0A, start);\n if (end === -1) {\n lines.push(buffer.slice(start));\n break;\n }\n lines.push(buffer.slice(start, end));\n start = end + 1;\n }\n return lines;\n}\n\nasync function extractAndParseReports(dir: string, shardFiles: string[], internalizer: JsonStringInternalizer, printStatus: StatusCallback) {\n const shardEvents: { file: string, localPath: string, metadata: BlobReportMetadata, parsedEvents: JsonEvent[] }[] = [];\n await fs.promises.mkdir(path.join(dir, 'resources'), { recursive: true });\n\n const reportNames = new UniqueFileNameGenerator();\n for (const file of shardFiles) {\n const absolutePath = path.join(dir, file);\n printStatus(`extracting: ${relativeFilePath(absolutePath)}`);\n const zipFile = new ZipFile(absolutePath);\n const entryNames = await zipFile.entries();\n for (const entryName of entryNames.sort()) {\n let fileName = path.join(dir, entryName);\n const content = await zipFile.read(entryName);\n if (entryName.endsWith('.jsonl')) {\n fileName = reportNames.makeUnique(fileName);\n let parsedEvents = parseCommonEvents(content);\n // Passing reviver to JSON.parse doesn't work, as the original strings\n // keep being used. To work around that we traverse the parsed events\n // as a post-processing step.\n internalizer.traverse(parsedEvents);\n const metadata = findMetadata(parsedEvents, file);\n parsedEvents = modernizer.modernize(metadata.version, parsedEvents);\n shardEvents.push({\n file,\n localPath: fileName,\n metadata,\n parsedEvents\n });\n }\n await fs.promises.writeFile(fileName, content);\n }\n zipFile.close();\n }\n return shardEvents;\n}\n\nfunction findMetadata(events: JsonEvent[], file: string): BlobReportMetadata {\n if (events[0]?.method !== 'onBlobReportMetadata')\n throw new Error(`No metadata event found in ${file}`);\n const metadata = events[0].params;\n if (metadata.version > currentBlobReportVersion)\n throw new Error(`Blob report ${file} was created with a newer version of Playwright.`);\n return metadata;\n}\n\nasync function mergeEvents(dir: string, shardReportFiles: string[], stringPool: StringInternPool, printStatus: StatusCallback, rootDirOverride: string | undefined): Promise<{\n prologue: JsonEvent[];\n reports: ReportData[];\n epilogue: JsonEvent[];\n pathSeparatorFromMetadata?: string;\n}> {\n const internalizer = new JsonStringInternalizer(stringPool);\n\n const configureEvents: JsonOnConfigureEvent[] = [];\n const projectEvents: JsonOnProjectEvent[] = [];\n const endEvents: JsonOnEndEvent[] = [];\n\n const blobs = await extractAndParseReports(dir, shardReportFiles, internalizer, printStatus);\n // Sort by (report name; shard; file name), so that salt generation below is deterministic when:\n // - report names are unique;\n // - report names are missing;\n // - report names are clashing between shards.\n blobs.sort((a, b) => {\n const nameA = a.metadata.name ?? '';\n const nameB = b.metadata.name ?? '';\n if (nameA !== nameB)\n return nameA.localeCompare(nameB);\n const shardA = a.metadata.shard?.current ?? 0;\n const shardB = b.metadata.shard?.current ?? 0;\n if (shardA !== shardB)\n return shardA - shardB;\n return a.file.localeCompare(b.file);\n });\n\n printStatus(`merging events`);\n\n const reports: ReportData[] = [];\n const globalTestIdSet = new Set<string>();\n\n for (let i = 0; i < blobs.length; ++i) {\n // Generate unique salt for each blob.\n const { parsedEvents, metadata, localPath } = blobs[i];\n const eventPatchers = new JsonEventPatchers();\n eventPatchers.patchers.push(new IdsPatcher(\n stringPool,\n metadata.name,\n String(i),\n globalTestIdSet,\n ));\n // Only patch path separators if we are merging reports with explicit config.\n if (rootDirOverride)\n eventPatchers.patchers.push(new PathSeparatorPatcher(metadata.pathSeparator));\n eventPatchers.patchEvents(parsedEvents);\n\n let tags: string[] = [];\n for (const event of parsedEvents) {\n if (event.method === 'onConfigure') {\n configureEvents.push(event);\n tags = event.params.config.tags || [];\n } else if (event.method === 'onProject') {\n projectEvents.push(event);\n } else if (event.method === 'onEnd') {\n endEvents.push(event);\n }\n }\n\n // Save information about the reports to stream their test events later.\n reports.push({\n eventPatchers,\n reportFile: localPath,\n metadata,\n tags,\n });\n }\n\n return {\n prologue: [\n mergeConfigureEvents(configureEvents, rootDirOverride),\n ...projectEvents,\n { method: 'onBegin', params: undefined },\n ],\n reports,\n epilogue: [\n mergeEndEvents(endEvents),\n { method: 'onExit', params: undefined },\n ],\n pathSeparatorFromMetadata: blobs[0]?.metadata.pathSeparator,\n };\n}\n\nfunction mergeConfigureEvents(configureEvents: JsonOnConfigureEvent[], rootDirOverride: string | undefined): JsonEvent {\n if (!configureEvents.length)\n throw new Error('No configure events found');\n let config: JsonConfig = {\n configFile: undefined,\n globalTimeout: 0,\n maxFailures: 0,\n metadata: {\n },\n rootDir: '',\n version: '',\n workers: 0,\n globalSetup: null,\n globalTeardown: null,\n };\n for (const event of configureEvents)\n config = mergeConfigs(config, event.params.config);\n\n if (rootDirOverride) {\n config.rootDir = rootDirOverride;\n } else {\n const rootDirs = new Set(configureEvents.map(e => e.params.config.rootDir));\n if (rootDirs.size > 1) {\n throw new Error([\n `Blob reports being merged were recorded with different test directories, and`,\n `merging cannot proceed. This may happen if you are merging reports from`,\n `machines with different environments, like different operating systems or`,\n `if the tests ran with different playwright configs.`,\n ``,\n `You can force merge by specifying a merge config file with \"-c\" option. If`,\n `you'd like all test paths to be correct, make sure 'testDir' in the merge config`,\n `file points to the actual tests location.`,\n ``,\n `Found directories:`,\n ...rootDirs\n ].join('\\n'));\n }\n }\n\n return {\n method: 'onConfigure',\n params: {\n config,\n }\n };\n}\n\nfunction mergeConfigs(to: JsonConfig, from: JsonConfig): JsonConfig {\n return {\n ...to,\n ...from,\n metadata: {\n ...to.metadata,\n ...from.metadata,\n actualWorkers: (to.metadata.actualWorkers || 0) + (from.metadata.actualWorkers || 0),\n },\n workers: to.workers + from.workers,\n };\n}\n\nfunction mergeEndEvents(endEvents: JsonOnEndEvent[]): JsonEvent {\n let startTime = endEvents.length ? 10000000000000 : Date.now();\n let status: JsonFullResult['status'] = 'passed';\n let duration: number = 0;\n\n for (const event of endEvents) {\n const shardResult = event.params.result;\n if (shardResult.status === 'failed')\n status = 'failed';\n else if (shardResult.status === 'timedout' && status !== 'failed')\n status = 'timedout';\n else if (shardResult.status === 'interrupted' && status !== 'failed' && status !== 'timedout')\n status = 'interrupted';\n startTime = Math.min(startTime, shardResult.startTime);\n duration = Math.max(duration, shardResult.duration);\n }\n const result: JsonFullResult = {\n status,\n startTime,\n duration,\n };\n return {\n method: 'onEnd',\n params: {\n result\n }\n };\n}\n\nasync function sortedShardFiles(dir: string) {\n const files = await fs.promises.readdir(dir);\n return files.filter(file => file.endsWith('.zip')).sort();\n}\n\nfunction printStatusToStdout(message: string) {\n // eslint-disable-next-line no-restricted-properties\n process.stdout.write(`${message}\\n`);\n}\n\nclass UniqueFileNameGenerator {\n private _usedNames = new Set<string>();\n\n makeUnique(name: string): string {\n if (!this._usedNames.has(name)) {\n this._usedNames.add(name);\n return name;\n }\n const extension = path.extname(name);\n name = name.substring(0, name.length - extension.length);\n let index = 0;\n while (true) {\n const candidate = `${name}-${++index}${extension}`;\n if (!this._usedNames.has(candidate)) {\n this._usedNames.add(candidate);\n return candidate;\n }\n }\n }\n}\n\nclass IdsPatcher {\n private _stringPool: StringInternPool;\n private _botName: string | undefined;\n private _salt: string;\n private _testIdsMap: Map<string, string>;\n private _globalTestIdSet: Set<string>;\n\n constructor(\n stringPool: StringInternPool,\n botName: string | undefined,\n salt: string,\n globalTestIdSet: Set<string>,\n ) {\n this._stringPool = stringPool;\n this._botName = botName;\n this._salt = salt;\n this._testIdsMap = new Map();\n this._globalTestIdSet = globalTestIdSet;\n }\n\n patchEvent(event: JsonEvent) {\n const { method, params } = event;\n switch (method) {\n case 'onProject':\n this._onProject(params.project);\n return;\n case 'onAttach':\n case 'onTestBegin':\n case 'onStepBegin':\n case 'onStepEnd':\n case 'onStdIO':\n params.testId = params.testId ? this._mapTestId(params.testId) : undefined;\n return;\n case 'onTestEnd':\n params.test.testId = this._mapTestId(params.test.testId);\n return;\n }\n }\n\n private _onProject(project: JsonProject) {\n project.metadata ??= {};\n project.suites.forEach(suite => this._updateTestIds(suite));\n }\n\n private _updateTestIds(suite: JsonSuite) {\n suite.entries.forEach(entry => {\n if ('testId' in entry)\n this._updateTestId(entry);\n else\n this._updateTestIds(entry);\n });\n }\n\n private _updateTestId(test: JsonTestCase) {\n test.testId = this._mapTestId(test.testId);\n if (this._botName) {\n test.tags = test.tags || [];\n test.tags.unshift('@' + this._botName);\n }\n }\n\n private _mapTestId(testId: string): string {\n const t1 = this._stringPool.internString(testId);\n if (this._testIdsMap.has(t1))\n // already mapped\n return this._testIdsMap.get(t1)!;\n if (this._globalTestIdSet.has(t1)) {\n // test id is used in another blob, so we need to salt it.\n const t2 = this._stringPool.internString(testId + this._salt);\n this._globalTestIdSet.add(t2);\n this._testIdsMap.set(t1, t2);\n return t2;\n }\n this._globalTestIdSet.add(t1);\n this._testIdsMap.set(t1, t1);\n return t1;\n }\n}\n\nclass AttachmentPathPatcher {\n constructor(private _resourceDir: string) {\n }\n\n patchEvent(event: JsonEvent) {\n if (event.method === 'onAttach')\n this._patchAttachments(event.params.attachments);\n else if (event.method === 'onTestEnd')\n this._patchAttachments(event.params.result.attachments ?? []);\n }\n\n private _patchAttachments(attachments: JsonAttachment[]) {\n for (const attachment of attachments) {\n if (!attachment.path)\n continue;\n\n attachment.path = path.join(this._resourceDir, attachment.path);\n }\n }\n}\n\nclass PathSeparatorPatcher {\n private _from: string;\n private _to: string;\n constructor(from?: string) {\n this._from = from ?? (path.sep === '/' ? '\\\\' : '/');\n this._to = path.sep;\n }\n\n patchEvent(jsonEvent: JsonEvent) {\n if (this._from === this._to)\n return;\n if (jsonEvent.method === 'onProject') {\n this._updateProject(jsonEvent.params.project);\n return;\n }\n if (jsonEvent.method === 'onTestEnd') {\n const test = jsonEvent.params.test;\n test.annotations?.forEach(annotation => this._updateAnnotationLocation(annotation));\n const testResult = jsonEvent.params.result;\n testResult.annotations?.forEach(annotation => this._updateAnnotationLocation(annotation));\n testResult.errors.forEach(error => this._updateErrorLocations(error));\n (testResult.attachments ?? []).forEach(attachment => {\n if (attachment.path)\n attachment.path = this._updatePath(attachment.path);\n });\n return;\n }\n if (jsonEvent.method === 'onStepBegin') {\n const step = jsonEvent.params.step;\n this._updateLocation(step.location);\n return;\n }\n if (jsonEvent.method === 'onStepEnd') {\n const step = jsonEvent.params.step;\n this._updateErrorLocations(step.error);\n step.annotations?.forEach(annotation => this._updateAnnotationLocation(annotation));\n return;\n }\n if (jsonEvent.method === 'onAttach') {\n const attach = jsonEvent.params;\n attach.attachments.forEach(attachment => {\n if (attachment.path)\n attachment.path = this._updatePath(attachment.path);\n });\n return;\n }\n }\n\n private _updateProject(project: JsonProject) {\n project.outputDir = this._updatePath(project.outputDir);\n project.testDir = this._updatePath(project.testDir);\n project.snapshotDir = this._updatePath(project.snapshotDir);\n project.suites.forEach(suite => this._updateSuite(suite, true));\n }\n\n private _updateSuite(suite: JsonSuite, isFileSuite: boolean = false) {\n this._updateLocation(suite.location);\n if (isFileSuite)\n suite.title = this._updatePath(suite.title);\n for (const entry of suite.entries) {\n if ('testId' in entry) {\n this._updateLocation(entry.location);\n entry.annotations?.forEach(annotation => this._updateAnnotationLocation(annotation));\n } else {\n this._updateSuite(entry);\n }\n }\n }\n\n private _updateErrorLocations(error: TestError | undefined) {\n while (error) {\n this._updateLocation(error.location);\n error = error.cause;\n }\n }\n\n private _updateAnnotationLocation(annotation: TestAnnotation) {\n this._updateLocation(annotation.location);\n }\n\n private _updateLocation(location?: JsonLocation) {\n if (location)\n location.file = this._updatePath(location.file);\n }\n\n private _updatePath(text: string): string {\n return text.split(this._from).join(this._to);\n }\n}\n\nclass GlobalErrorPatcher {\n private _prefix: string;\n\n constructor(botName: string) {\n this._prefix = `(${botName}) `;\n }\n\n patchEvent(event: JsonEvent) {\n if (event.method !== 'onError')\n return;\n const error = event.params.error;\n if (error.message !== undefined)\n error.message = this._prefix + error.message;\n if (error.stack !== undefined)\n error.stack = this._prefix + error.stack;\n }\n}\n\ninterface JsonEventPatcher {\n patchEvent(event: JsonEvent): void;\n}\n\nclass JsonEventPatchers {\n readonly patchers: JsonEventPatcher[] = [];\n\n patchEvents(events: JsonEvent[]) {\n for (const event of events) {\n for (const patcher of this.patchers)\n patcher.patchEvent(event);\n }\n }\n}\n\nclass BlobModernizer {\n modernize(fromVersion: number, events: JsonEvent[]): JsonEvent[] {\n const result = [];\n for (const event of events)\n result.push(...this._modernize(fromVersion, event));\n return result;\n }\n\n private _modernize(fromVersion: number, event: JsonEvent): JsonEvent[] {\n let events = [event];\n for (let version = fromVersion; version < currentBlobReportVersion; ++version)\n events = (this as any)[`_modernize_${version}_to_${version + 1}`].call(this, events);\n return events;\n }\n\n _modernize_1_to_2(events: JsonEvent[]): JsonEvent[] {\n return events.map(event => {\n if (event.method === 'onProject') {\n const modernizeSuite = (suite: blobV1.JsonSuite): JsonSuite => {\n const newSuites = suite.suites.map(modernizeSuite);\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { suites, tests, ...remainder } = suite;\n return { entries: [...newSuites, ...tests], ...remainder };\n };\n const project = event.params.project;\n project.suites = (project.suites as unknown as blobV1.JsonSuite[]).map(modernizeSuite);\n }\n return event;\n });\n }\n}\n\nconst modernizer = new BlobModernizer();\n"],
5
- "mappings": ";;;;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poration.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { ReporterV2 } from './reporterV2';\nimport type { FullConfig, FullResult, TestCase, TestError, TestResult, TestStep } from '../../types/testReporter';\nimport type { Suite } from '../common/test';\n\nexport class Multiplexer implements ReporterV2 {\n private _reporters: ReporterV2[];\n\n constructor(reporters: ReporterV2[]) {\n this._reporters = reporters;\n }\n\n version(): 'v2' {\n return 'v2';\n }\n\n onConfigure(config: FullConfig) {\n for (const reporter of this._reporters)\n wrap(() => reporter.onConfigure?.(config));\n }\n\n onBegin(suite: Suite) {\n for (const reporter of this._reporters)\n wrap(() => reporter.onBegin?.(suite));\n }\n\n onTestBegin(test: TestCase, result: TestResult) {\n for (const reporter of this._reporters)\n wrap(() => reporter.onTestBegin?.(test, result));\n }\n\n onStdOut(chunk: string | Buffer, test?: TestCase, result?: TestResult) {\n for (const reporter of this._reporters)\n wrap(() => reporter.onStdOut?.(chunk, test, result));\n }\n\n onStdErr(chunk: string | Buffer, test?: TestCase, result?: TestResult) {\n for (const reporter of this._reporters)\n wrap(() => reporter.onStdErr?.(chunk, test, result));\n }\n\n onTestEnd(test: TestCase, result: TestResult) {\n for (const reporter of this._reporters)\n wrap(() => reporter.onTestEnd?.(test, result));\n }\n\n async onEnd(result: FullResult) {\n for (const reporter of this._reporters) {\n const outResult = await wrapAsync(() => reporter.onEnd?.(result));\n if (outResult?.status)\n result.status = outResult.status;\n }\n return result;\n }\n\n async onExit() {\n for (const reporter of this._reporters)\n await wrapAsync(() => reporter.onExit?.());\n }\n\n onError(error: TestError) {\n for (const reporter of this._reporters)\n wrap(() => reporter.onError?.(error));\n }\n\n onStepBegin(test: TestCase, result: TestResult, step: TestStep) {\n for (const reporter of this._reporters)\n wrap(() => reporter.onStepBegin?.(test, result, step));\n }\n\n onStepEnd(test: TestCase, result: TestResult, step: TestStep) {\n for (const reporter of this._reporters)\n wrap(() => reporter.onStepEnd?.(test, result, step));\n }\n\n printsToStdio(): boolean {\n return this._reporters.some(r => {\n let prints = false;\n wrap(() => prints = r.printsToStdio ? r.printsToStdio() : true);\n return prints;\n });\n }\n}\n\nasync function wrapAsync<T>(callback: () => T | Promise<T>) {\n try {\n return await callback();\n } catch (e) {\n // eslint-disable-next-line no-console\n console.error('Error in reporter', e);\n }\n}\n\nfunction wrap(callback: () => void) {\n try {\n callback();\n } catch (e) {\n // eslint-disable-next-line no-console\n console.error('Error in reporter', e);\n }\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAoBO,MAAM,YAAkC;AAAA,EAG7C,YAAY,WAAyB;AACnC,SAAK,aAAa;AAAA,EACpB;AAAA,EAEA,UAAgB;AACd,WAAO;AAAA,EACT;AAAA,EAEA,YAAY,QAAoB;AAC9B,eAAW,YAAY,KAAK;AAC1B,WAAK,MAAM,SAAS,cAAc,MAAM,CAAC;AAAA,EAC7C;AAAA,EAEA,QAAQ,OAAc;AACpB,eAAW,YAAY,KAAK;AAC1B,WAAK,MAAM,SAAS,UAAU,KAAK,CAAC;AAAA,EACxC;AAAA,EAEA,YAAY,MAAgB,QAAoB;AAC9C,eAAW,YAAY,KAAK;AAC1B,WAAK,MAAM,SAAS,cAAc,MAAM,MAAM,CAAC;AAAA,EACnD;AAAA,EAEA,SAAS,OAAwB,MAAiB,QAAqB;AACrE,eAAW,YAAY,KAAK;AAC1B,WAAK,MAAM,SAAS,WAAW,OAAO,MAAM,MAAM,CAAC;AAAA,EACvD;AAAA,EAEA,SAAS,OAAwB,MAAiB,QAAqB;AACrE,eAAW,YAAY,KAAK;AAC1B,WAAK,MAAM,SAAS,WAA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AQ,MAAM,qBAAqB,CAAC;AAAA,EACtC;AACF;",
6
- "names": []
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/reporters/reporterV2.ts"],
4
- "sourcesContent": ["/**\n * Copyright (c) Microsoft Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { FullConfig, FullResult, Reporter, Suite, TestCase, TestError, TestResult, TestStep } from '../../types/testReporter';\n\nexport interface ReporterV2 {\n onConfigure?(config: FullConfig): void;\n onBegin?(suite: Suite): void;\n onTestBegin?(test: TestCase, result: TestResult): void;\n onStdOut?(chunk: string | Buffer, test?: TestCase, result?: TestResult): void;\n onStdErr?(chunk: string | Buffer, test?: TestCase, result?: TestResult): void;\n onTestEnd?(test: TestCase, result: TestResult): void;\n onEnd?(result: FullResult): Promise<{ status?: FullResult['status'] } | undefined | void> | void;\n onExit?(): void | Promise<void>;\n onError?(error: TestError): void;\n onStepBegin?(test: TestCase, result: TestResult, step: TestStep): void;\n onStepEnd?(test: TestCase, result: TestResult, step: TestStep): void;\n printsToStdio?(): boolean;\n version(): 'v2';\n}\n\nexport type AnyReporter = ReporterV2 | Reporter;\n\ntype StdIOChunk = {\n chunk: string | Buffer;\n test?: TestCase;\n result?: TestResult;\n};\n\nexport function wrapReporterAsV2(reporter: Reporter | ReporterV2): ReporterV2 {\n try {\n if ('version' in reporter && reporter.version() === 'v2')\n return reporter as ReporterV2;\n } catch (e) {\n }\n return new ReporterV2Wrapper(reporter as Reporter);\n}\n\nclass ReporterV2Wrapper implements ReporterV2 {\n private _reporter: Reporter;\n private _deferred: { error?: TestError, stdout?: StdIOChunk, stderr?: StdIOChunk }[] | null = [];\n private _config!: FullConfig;\n\n constructor(reporter: Reporter) {\n this._reporter = reporter;\n }\n\n version(): 'v2' {\n return 'v2';\n }\n\n onConfigure(config: FullConfig) {\n this._config = config;\n }\n\n onBegin(suite: Suite) {\n this._reporter.onBegin?.(this._config, suite);\n\n const deferred = this._deferred!;\n this._deferred = null;\n for (const item of deferred) {\n if (item.error)\n this.onError(item.error);\n if (item.stdout)\n this.onStdOut(item.stdout.chunk, item.stdout.test, item.stdout.result);\n if (item.stderr)\n this.onStdErr(item.stderr.chunk, item.stderr.test, item.stderr.result);\n }\n }\n\n onTestBegin(test: TestCase, result: TestResult) {\n this._reporter.onTestBegin?.(test, result);\n }\n\n onStdOut(chunk: string | Buffer, test?: TestCase, result?: TestResult) {\n if (this._deferred) {\n this._deferred.push({ stdout: { chunk, test, result } });\n return;\n }\n this._reporter.onStdOut?.(chunk, test, result);\n }\n\n onStdErr(chunk: string | Buffer, test?: TestCase, result?: TestResult) {\n if (this._deferred) {\n this._deferred.push({ stderr: { chunk, test, result } });\n return;\n }\n this._reporter.onStdErr?.(chunk, test, result);\n }\n\n onTestEnd(test: TestCase, result: TestResult) {\n this._reporter.onTestEnd?.(test, result);\n }\n\n async onEnd(result: FullResult) {\n return await this._reporter.onEnd?.(result);\n }\n\n async onExit() {\n await this._reporter.onExit?.();\n }\n\n onError(error: TestError) {\n if (this._deferred) {\n this._deferred.push({ error });\n return;\n }\n this._reporter.onError?.(error);\n }\n\n onStepBegin(test: TestCase, result: TestResult, step: TestStep) {\n this._reporter.onStepBegin?.(test, result, step);\n }\n\n onStepEnd(test: TestCase, result: TestResult, step: TestStep) {\n this._reporter.onStepEnd?.(test, result, step);\n }\n\n printsToStdio() {\n return this._reporter.printsToStdio ? this._reporter.printsToStdio() : true;\n }\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA0CO,SAAS,iBAAiB,UAA6C;A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A,EAEA,UAAU,MAAgB,QAAoB;AAC5C,SAAK,UAAU,YAAY,MAAM,MAAM;AAAA,EACzC;AAAA,EAEA,MAAM,MAAM,QAAoB;AAC9B,WAAO,MAAM,KAAK,UAAU,QAAQ,MAAM;AAAA,EAC5C;AAAA,EAEA,MAAM,SAAS;AACb,UAAM,KAAK,UAAU,SAAS;AAAA,EAChC;AAAA,EAEA,QAAQ,OAAkB;AACxB,QAAI,KAAK,WAAW;AAClB,WAAK,UAAU,KAAK,EAAE,MAAM,CAAC;AAC7B;AAAA,IACF;AACA,SAAK,UAAU,UAAU,KAAK;AAAA,EAChC;AAAA,EAEA,YAAY,MAAgB,QAAoB,MAAgB;AAC9D,SAAK,UAAU,cAAc,MAAM,QAAQ,IAAI;AAAA,EACjD;AAAA,EAEA,UAAU,MAAgB,QAAoB,MAAgB;AAC5D,SAAK,UAAU,YAAY,MAAM,QAAQ,IAAI;AAAA,EAC/C;AAAA,EAEA,gBAAgB;AACd,WAAO,KAAK,UAAU,gBAAgB,KAAK,UAAU,cAAc,IAAI;AAAA,EACzE;AACF;",
6
- "names": []
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/reporters/teleEmitter.ts"],
4
- "sourcesContent": ["/**\n * Copyright (c) Microsoft Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport path from 'path';\n\nimport { createGuid } from 'playwright-core/lib/utils';\n\nimport { serializeRegexPatterns } from '../isomorphic/teleReceiver';\n\nimport type { ReporterV2 } from './reporterV2';\nimport type * as reporterTypes from '../../types/testReporter';\nimport type { TestAnnotation } from '../../types/test';\nimport type * as teleReceiver from '../isomorphic/teleReceiver';\n\nexport type TeleReporterEmitterOptions = {\n omitOutput?: boolean;\n omitBuffers?: boolean;\n};\n\nexport class TeleReporterEmitter implements ReporterV2 {\n private _messageSink: (message: teleReceiver.JsonEvent) => void;\n private _rootDir!: string;\n private _emitterOptions: TeleReporterEmitterOptions;\n private _resultKnownAttachmentCounts = new Map<string, number>();\n // In case there is blob reporter and UI mode, make sure one does override\n // the id assigned by the other.\n private readonly _idSymbol = Symbol('id');\n\n constructor(messageSink: (message: teleReceiver.JsonEvent) => void, options: TeleReporterEmitterOptions = {}) {\n this._messageSink = messageSink;\n this._emitterOptions = options;\n }\n\n version(): 'v2' {\n return 'v2';\n }\n\n onConfigure(config: reporterTypes.FullConfig) {\n this._rootDir = config.rootDir;\n this._messageSink({ method: 'onConfigure', params: { config: this._serializeConfig(config) } });\n }\n\n onBegin(suite: reporterTypes.Suite) {\n const projects = suite.suites.map(projectSuite => this._serializeProject(projectSuite));\n for (const project of projects)\n this._messageSink({ method: 'onProject', params: { project } });\n this._messageSink({ method: 'onBegin', params: undefined });\n }\n\n onTestBegin(test: reporterTypes.TestCase, result: reporterTypes.TestResult): void {\n (result as any)[this._idSymbol] = createGuid();\n this._messageSink({\n method: 'onTestBegin',\n params: {\n testId: test.id,\n result: this._serializeResultStart(result)\n }\n });\n }\n\n onTestEnd(test: reporterTypes.TestCase, result: reporterTypes.TestResult): void {\n const testEnd: teleReceiver.JsonTestEnd = {\n testId: test.id,\n expectedStatus: test.expectedStatus,\n timeout: test.timeout,\n annotations: []\n };\n this._sendNewAttachments(result, test.id);\n this._messageSink({\n method: 'onTestEnd',\n params: {\n test: testEnd,\n result: this._serializeResultEnd(result),\n }\n });\n\n this._resultKnownAttachmentCounts.delete((result as any)[this._idSymbol]);\n }\n\n onStepBegin(test: reporterTypes.TestCase, result: reporterTypes.TestResult, step: reporterTypes.TestStep): void {\n (step as any)[this._idSymbol] = createGuid();\n this._messageSink({\n method: 'onStepBegin',\n params: {\n testId: test.id,\n resultId: (result as any)[this._idSymbol],\n step: this._serializeStepStart(step)\n }\n });\n }\n\n onStepEnd(test: reporterTypes.TestCase, result: reporterTypes.TestResult, step: reporterTypes.TestStep): void {\n // Create synthetic onAttach event so we serialize the entire attachment along with the step\n const resultId = (result as any)[this._idSymbol] as string;\n this._sendNewAttachments(result, test.id);\n\n this._messageSink({\n method: 'onStepEnd',\n params: {\n testId: test.id,\n resultId,\n step: this._serializeStepEnd(step, result)\n }\n });\n }\n\n onError(error: reporterTypes.TestError): void {\n this._messageSink({\n method: 'onError',\n params: { error }\n });\n }\n\n onStdOut(chunk: string | Buffer, test?: reporterTypes.TestCase, result?: reporterTypes.TestResult): void {\n this._onStdIO('stdout', chunk, test, result);\n }\n\n onStdErr(chunk: string | Buffer, test?: reporterTypes.TestCase, result?: reporterTypes.TestResult): void {\n this._onStdIO('stderr', chunk, test, result);\n }\n\n private _onStdIO(type: teleReceiver.JsonStdIOType, chunk: string | Buffer, test: void | reporterTypes.TestCase, result: void | reporterTypes.TestResult): void {\n if (this._emitterOptions.omitOutput)\n return;\n const isBase64 = typeof chunk !== 'string';\n const data = isBase64 ? chunk.toString('base64') : chunk;\n this._messageSink({\n method: 'onStdIO',\n params: { testId: test?.id, resultId: result ? (result as any)[this._idSymbol] : undefined, type, data, isBase64 }\n });\n }\n\n async onEnd(result: reporterTypes.FullResult) {\n const resultPayload: teleReceiver.JsonFullResult = {\n status: result.status,\n startTime: result.startTime.getTime(),\n duration: result.duration,\n };\n this._messageSink({\n method: 'onEnd',\n params: {\n result: resultPayload\n }\n });\n }\n\n printsToStdio() {\n return false;\n }\n\n private _serializeConfig(config: reporterTypes.FullConfig): teleReceiver.JsonConfig {\n return {\n configFile: this._relativePath(config.configFile),\n globalTimeout: config.globalTimeout,\n maxFailures: config.maxFailures,\n metadata: config.metadata,\n rootDir: config.rootDir,\n version: config.version,\n workers: config.workers,\n globalSetup: config.globalSetup,\n globalTeardown: config.globalTeardown,\n tags: config.tags,\n };\n }\n\n private _serializeProject(suite: reporterTypes.Suite): teleReceiver.JsonProject {\n const project = suite.project()!;\n const report: teleReceiver.JsonProject = {\n metadata: project.metadata,\n name: project.name,\n outputDir: this._relativePath(project.outputDir),\n repeatEach: project.repeatEach,\n retries: project.retries,\n testDir: this._relativePath(project.testDir),\n testIgnore: serializeRegexPatterns(project.testIgnore),\n testMatch: serializeRegexPatterns(project.testMatch),\n timeout: project.timeout,\n suites: suite.suites.map(fileSuite => {\n return this._serializeSuite(fileSuite);\n }),\n grep: serializeRegexPatterns(project.grep),\n grepInvert: serializeRegexPatterns(project.grepInvert || []),\n dependencies: project.dependencies,\n snapshotDir: this._relativePath(project.snapshotDir),\n teardown: project.teardown,\n use: this._serializeProjectUseOptions(project.use),\n };\n return report;\n }\n\n private _serializeProjectUseOptions(use: reporterTypes.FullProject['use']): Record<string, any> {\n return {\n testIdAttribute: use.testIdAttribute,\n };\n }\n\n private _serializeSuite(suite: reporterTypes.Suite): teleReceiver.JsonSuite {\n const result = {\n title: suite.title,\n location: this._relativeLocation(suite.location),\n entries: suite.entries().map(e => {\n if (e.type === 'test')\n return this._serializeTest(e);\n return this._serializeSuite(e);\n })\n };\n return result;\n }\n\n private _serializeTest(test: reporterTypes.TestCase): teleReceiver.JsonTestCase {\n return {\n testId: test.id,\n title: test.title,\n location: this._relativeLocation(test.location),\n retries: test.retries,\n tags: test.tags,\n repeatEachIndex: test.repeatEachIndex,\n annotations: this._relativeAnnotationLocations(test.annotations),\n };\n }\n\n private _serializeResultStart(result: reporterTypes.TestResult): teleReceiver.JsonTestResultStart {\n return {\n id: (result as any)[this._idSymbol],\n retry: result.retry,\n workerIndex: result.workerIndex,\n parallelIndex: result.parallelIndex,\n startTime: +result.startTime,\n };\n }\n\n private _serializeResultEnd(result: reporterTypes.TestResult): teleReceiver.JsonTestResultEnd {\n return {\n id: (result as any)[this._idSymbol],\n duration: result.duration,\n status: result.status,\n errors: result.errors,\n annotations: result.annotations?.length ? this._relativeAnnotationLocations(result.annotations) : undefined,\n };\n }\n\n private _sendNewAttachments(result: reporterTypes.TestResult, testId: string) {\n const resultId = (result as any)[this._idSymbol] as string;\n // Track whether this step (or something else since the last step) has added attachments and send them\n const knownAttachmentCount = this._resultKnownAttachmentCounts.get(resultId) ?? 0;\n if (result.attachments.length > knownAttachmentCount) {\n this._messageSink({\n method: 'onAttach',\n params: {\n testId,\n resultId,\n attachments: this._serializeAttachments((result.attachments.slice(knownAttachmentCount))),\n }\n });\n }\n\n this._resultKnownAttachmentCounts.set(resultId, result.attachments.length);\n }\n\n _serializeAttachments(attachments: reporterTypes.TestResult['attachments']): teleReceiver.JsonAttachment[] {\n return attachments.map(a => {\n const { body, ...rest } = a;\n return {\n ...rest,\n // There is no Buffer in the browser, so there is no point in sending the data there.\n base64: (body && !this._emitterOptions.omitBuffers) ? body.toString('base64') : undefined,\n };\n });\n }\n\n private _serializeStepStart(step: reporterTypes.TestStep): teleReceiver.JsonTestStepStart {\n return {\n id: (step as any)[this._idSymbol],\n parentStepId: (step.parent as any)?.[this._idSymbol],\n title: step.title,\n category: step.category,\n startTime: +step.startTime,\n location: this._relativeLocation(step.location),\n };\n }\n\n private _serializeStepEnd(step: reporterTypes.TestStep, result: reporterTypes.TestResult): teleReceiver.JsonTestStepEnd {\n return {\n id: (step as any)[this._idSymbol],\n duration: step.duration,\n error: step.error,\n attachments: step.attachments.length ? step.attachments.map(a => result.attachments.indexOf(a)) : undefined,\n annotations: step.annotations.length ? this._relativeAnnotationLocations(step.annotations) : undefined,\n };\n }\n\n private _relativeAnnotationLocations(annotations: TestAnnotation[]): TestAnnotation[] {\n return annotations.map(annotation => ({\n ...annotation,\n location: annotation.location ? this._relativeLocation(annotation.location) : undefined,\n }));\n }\n\n private _relativeLocation(location: reporterTypes.Location): reporterTypes.Location;\n private _relativeLocation(location?: reporterTypes.Location): reporterTypes.Location | undefined;\n private _relativeLocation(location: reporterTypes.Location | undefined): reporterTypes.Location | undefined {\n if (!location)\n return location;\n return {\n ...location,\n file: this._relativePath(location.file),\n };\n }\n\n private _relativePath(absolutePath: string): string;\n private _relativePath(absolutePath?: string): string | undefined;\n private _relativePath(absolutePath?: string): string | undefined {\n if (!absolutePath)\n return absolutePath;\n return path.relative(this._rootDir, absolutePath);\n }\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBA,kBAAiB;AAEjB,mBAA2B;AAE3B,0BAAuC;AAYhC,MAAM,oBAA0C;AAAA,EASrD,YAAY,aAAwD,UAAsC,CAAC,GAAG;AAL9G,SAAQ,+BAA+B,oBAAI,IAAoB;AAG/D;AAAA;AAAA,SAAiB,YAAY,OAAO,IAAI;AAGtC,SAAK,eAAe;AACpB,SAAK,kBAAkB;AAAA,EACzB;AAAA,EAEA,UAAgB;AACd,WAAO;AAAA,EACT;AAAA,EAEA,YAAY,QAAkC;AAC5C,SAAK,WAAW,OAAO;AACvB,SAAK,aAAa,EAAE,QAAQ,eAAe,QAAQ,EAAE,QAAQ,KAAK,iBAAiB,MAAM,EAAE,EAAE,CAAC;AAAA,EAChG;AAAA,EAEA,QAAQ,OAA4B;AAClC,UAAM,WAAW,MAAM,OAAO,IAAI,kBAAgB,KAAK,kBAAkB,YAAY,CAAC;AACtF,eAAW,WAAW;AACpB,WAAK,aAAa,EAAE,QAAQ,aAAa,QAAQ,EAAE,QAAQ,EAAE,CAAC;AAChE,SAAK,aAAa,EAAE,QAAQ,WAAW,QAAQ,OAAU,CAAC;AAAA,EAC5D;AAAA,EAEA,YAAY,MAA8B,QAAwC;AAChF,IAAC,OAAe,KAAK,SAAS,QAAI,yBAAW;AAC7C,SAAK,aAAa;AAAA,MAChB,QAAQ;AAAA,MACR,QAAQ;AAAA,QACN,QAAQ,KAAK;AAAA,QACb,QAAQ,KAAK,sBAAsB,MAAM;AAAA,MAC3C;AAAA,IACF,CAAC;AAAA,EACH;AAAA,EAEA,UAAU,MAA8B,QAAwC;AAC9E,U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,KAAK,kBAAkB,KAAK,QAAQ;AAAA,IAChD;AAAA,EACF;AAAA,EAEQ,kBAAkB,MAA8B,QAAgE;AACtH,WAAO;AAAA,MACL,IAAK,KAAa,KAAK,SAAS;AAAA,MAChC,UAAU,KAAK;AAAA,MACf,OAAO,KAAK;AAAA,MACZ,aAAa,KAAK,YAAY,SAAS,KAAK,YAAY,IAAI,OAAK,OAAO,YAAY,QAAQ,CAAC,CAAC,IAAI;AAAA,MAClG,aAAa,KAAK,YAAY,SAAS,KAAK,6BAA6B,KAAK,WAAW,IAAI;AAAA,IAC/F;AAAA,EACF;AAAA,EAEQ,6BAA6B,aAAiD;AACpF,WAAO,YAAY,IAAI,iBAAe;AAAA,MACpC,GAAG;AAAA,MACH,UAAU,WAAW,WAAW,KAAK,kBAAkB,WAAW,QAAQ,IAAI;AAAA,IAChF,EAAE;AAAA,EACJ;AAAA,EAIQ,kBAAkB,UAAkF;AAC1G,QAAI,CAAC;AACH,aAAO;AACT,WAAO;AAAA,MACL,GAAG;AAAA,MACH,MAAM,KAAK,cAAc,SAAS,IAAI;AAAA,IACxC;AAAA,EACF;AAAA,EAIQ,cAAc,cAA2C;AAC/D,QAAI,CAAC;AACH,aAAO;AACT,WAAO,YAAAA,QAAK,SAAS,KAAK,UAAU,YAAY;AAAA,EAClD;AACF;",
6
- "names": ["path"]
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/reporters/versions/blobV1.ts"],
4
- "sourcesContent": ["/**\n * Copyright (c) Microsoft Corporation.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { Metadata } from '../../../types/test';\nimport type * as reporterTypes from '../../../types/testReporter';\n\nexport type JsonLocation = reporterTypes.Location;\nexport type JsonError = string;\nexport type JsonStackFrame = { file: string, line: number, column: number };\n\nexport type JsonStdIOType = 'stdout' | 'stderr';\n\nexport type JsonConfig = Pick<reporterTypes.FullConfig, 'configFile' | 'globalTimeout' | 'maxFailures' | 'metadata' | 'rootDir' | 'version' | 'workers'>;\n\nexport type JsonPattern = {\n s?: string;\n r?: { source: string, flags: string };\n};\n\nexport type JsonProject = {\n grep: JsonPattern[];\n grepInvert: JsonPattern[];\n metadata: Metadata;\n name: string;\n dependencies: string[];\n // This is relative to root dir.\n snapshotDir: string;\n // This is relative to root dir.\n outputDir: string;\n repeatEach: number;\n retries: number;\n suites: JsonSuite[];\n teardown?: string;\n // This is relative to root dir.\n testDir: string;\n testIgnore: JsonPattern[];\n testMatch: JsonPattern[];\n timeout: number;\n};\n\nexport type JsonSuite = {\n title: string;\n location?: JsonLocation;\n suites: JsonSuite[];\n tests: JsonTestCase[];\n};\n\nexport type JsonTestCase = {\n testId: string;\n title: string;\n location: JsonLocation;\n retries: number;\n tags?: string[];\n repeatEachIndex: number;\n};\n\nexport type JsonTestEnd = {\n testId: string;\n expectedStatus: reporterTypes.TestStatus;\n timeout: number;\n annotations: { type: string, description?: string }[];\n};\n\nexport type JsonTestResultStart = {\n id: string;\n retry: number;\n workerIndex: number;\n parallelIndex: number;\n startTime: number;\n};\n\nexport type JsonAttachment = Omit<reporterTypes.TestResult['attachments'][0], 'body'> & { base64?: string };\n\nexport type JsonTestResultEnd = {\n id: string;\n duration: number;\n status: reporterTypes.TestStatus;\n errors: reporterTypes.TestError[];\n attachments: JsonAttachment[];\n};\n\nexport type JsonTestStepStart = {\n id: string;\n parentStepId?: string;\n title: string;\n category: string,\n startTime: number;\n location?: reporterTypes.Location;\n};\n\nexport type JsonTestStepEnd = {\n id: string;\n duration: number;\n error?: reporterTypes.TestError;\n};\n\nexport type JsonFullResult = {\n status: reporterTypes.FullResult['status'];\n startTime: number;\n duration: number;\n};\n\nexport type JsonEvent = {\n method: string;\n params: any\n};\n\nexport type BlobReportMetadata = {\n version: number;\n userAgent: string;\n name?: string;\n shard?: { total: number, current: number };\n pathSeparator?: string;\n};\n"],
5
- "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;",
6
- "names": []
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/runner/dispatcher.ts"],
4
- "sourcesContent": ["/**\n * Copyright Microsoft Corporation. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ManualPromise, eventsHelper } from 'playwright-core/lib/utils';\nimport { colors } from 'playwright-core/lib/utils';\n\nimport { addSuggestedRebaseline } from './rebase';\nimport { WorkerHost } from './workerHost';\nimport { serializeConfig } from '../common/ipc';\n\nimport type { FailureTracker } from './failureTracker';\nimport type { ProcessExitData } from './processHost';\nimport type { TestGroup } from './testGroups';\nimport type { TestError, TestResult, TestStep } from '../../types/testReporter';\nimport type { FullConfigInternal } from '../common/config';\nimport type { AttachmentPayload, DonePayload, RunPayload, SerializedConfig, StepBeginPayload, StepEndPayload, TeardownErrorsPayload, TestBeginPayload, TestEndPayload, TestOutputPayload } from '../common/ipc';\nimport type { Suite } from '../common/test';\nimport type { TestCase } from '../common/test';\nimport type { ReporterV2 } from '../reporters/reporterV2';\nimport type { RegisteredListener } from 'playwright-core/lib/utils';\n\n\nexport type EnvByProjectId = Map<string, Record<string, string | undefined>>;\n\nexport class Dispatcher {\n private _workerSlots: { busy: boolean, worker?: WorkerHost, jobDispatcher?: JobDispatcher }[] = [];\n private _queue: TestGroup[] = [];\n private _workerLimitPerProjectId = new Map<string, number>();\n private _queuedOrRunningHashCount = new Map<string, number>();\n private _finished = new ManualPromise<void>();\n private _isStopped = true;\n\n private _config: FullConfigInternal;\n private _reporter: ReporterV2;\n private _failureTracker: FailureTracker;\n\n private _extraEnvByProjectId: EnvByProjectId = new Map();\n private _producedEnvByProjectId: EnvByProjectId = new Map();\n\n constructor(config: FullConfigInternal, reporter: ReporterV2, failureTracker: FailureTracker) {\n this._config = config;\n this._reporter = reporter;\n this._failureTracker = failureTracker;\n for (const project of config.projects) {\n if (project.workers)\n this._workerLimitPerProjectId.set(project.id, project.workers);\n }\n }\n\n private _findFirstJobToRun() {\n // Always pick the first job that can be run while respecting the project worker limit.\n for (let index = 0; index < this._queue.length; index++) {\n const job = this._queue[index];\n const projectIdWorkerLimit = this._workerLimitPerProjectId.get(job.projectId);\n if (!projectIdWorkerLimit)\n return index;\n const runningWorkersWithSameProjectId = this._workerSlots.filter(w => w.busy && w.worker && w.worker.projectId() === job.projectId).length;\n if (runningWorkersWithSameProjectId < projectIdWorkerLimit)\n return index;\n }\n return -1;\n }\n\n private _scheduleJob() {\n // NOTE: keep this method synchronous for easier reasoning.\n\n // 0. No more running jobs after stop.\n if (this._isStopped)\n return;\n\n // 1. Find a job to run.\n const jobIndex = this._findFirstJobToRun();\n if (jobIndex === -1)\n return;\n const job = this._queue[jobIndex];\n\n // 2. Find a worker with the same hash, or just some free worker.\n let workerIndex = this._workerSlots.findIndex(w => !w.busy && w.worker && w.worker.hash() === job.workerHash && !w.worker.didSendStop());\n if (workerIndex === -1)\n workerIndex = this._workerSlots.findIndex(w => !w.busy);\n if (workerIndex === -1) {\n // No workers available, bail out.\n return;\n }\n\n // 3. Claim both the job and the worker slot.\n this._queue.splice(jobIndex, 1);\n const jobDispatcher = new JobDispatcher(job, this._reporter, this._failureTracker, () => this.stop().catch(() => {}));\n this._workerSlots[workerIndex].busy = true;\n this._workerSlots[workerIndex].jobDispatcher = jobDispatcher;\n\n // 4. Run the job. This is the only async operation.\n void this._runJobInWorker(workerIndex, jobDispatcher).then(() => {\n\n // 5. Release the worker slot.\n this._workerSlots[workerIndex].jobDispatcher = undefined;\n this._workerSlots[workerIndex].busy = false;\n\n // 6. Check whether we are done or should schedule another job.\n this._checkFinished();\n this._scheduleJob();\n });\n }\n\n private async _runJobInWorker(index: number, jobDispatcher: JobDispatcher) {\n const job = jobDispatcher.job;\n\n // 0. Perhaps skip the whole job?\n if (jobDispatcher.skipWholeJob())\n return;\n\n let worker = this._workerSlots[index].worker;\n\n // 1. Restart the worker if it has the wrong hash or is being stopped already.\n if (worker && (worker.hash() !== job.workerHash || worker.didSendStop())) {\n await worker.stop();\n worker = undefined;\n if (this._isStopped) // Check stopped signal after async hop.\n return;\n }\n\n // 2. Start the worker if it is down.\n let startError;\n if (!worker) {\n worker = this._createWorker(job, index, serializeConfig(this._config, true));\n this._workerSlots[index].worker = worker;\n worker.on('exit', () => this._workerSlots[index].worker = undefined);\n startError = await worker.start();\n if (this._isStopped) // Check stopped signal after async hop.\n return;\n }\n\n // 3. Finally, run some tests in the worker! Or fail all of them because of startup error...\n if (startError)\n jobDispatcher.onExit(startError);\n else\n jobDispatcher.runInWorker(worker);\n const result = await jobDispatcher.jobResult;\n this._updateCounterForWorkerHash(job.workerHash, -1);\n\n // 4. When worker encounters error, we stop it and create a new one.\n // We also do not keep the worker alive if it cannot serve any more jobs.\n if (result.didFail)\n void worker.stop(true /* didFail */);\n else if (this._isWorkerRedundant(worker))\n void worker.stop();\n\n // 5. Possibly queue a new job with leftover tests and/or retries.\n if (!this._isStopped && result.newJob) {\n this._queue.unshift(result.newJob);\n this._updateCounterForWorkerHash(result.newJob.workerHash, +1);\n }\n }\n\n private _checkFinished() {\n if (this._finished.isDone())\n return;\n\n // Check that we have no more work to do.\n if (this._queue.length && !this._isStopped)\n return;\n\n // Make sure all workers have finished the current job.\n if (this._workerSlots.some(w => w.busy))\n return;\n\n this._finished.resolve();\n }\n\n private _isWorkerRedundant(worker: WorkerHost) {\n let workersWithSameHash = 0;\n for (const slot of this._workerSlots) {\n if (slot.worker && !slot.worker.didSendStop() && slot.worker.hash() === worker.hash())\n workersWithSameHash++;\n }\n return workersWithSameHash > this._queuedOrRunningHashCount.get(worker.hash())!;\n }\n\n private _updateCounterForWorkerHash(hash: string, delta: number) {\n this._queuedOrRunningHashCount.set(hash, delta + (this._queuedOrRunningHashCount.get(hash) || 0));\n }\n\n async run(testGroups: TestGroup[], extraEnvByProjectId: EnvByProjectId) {\n this._extraEnvByProjectId = extraEnvByProjectId;\n this._queue = testGroups;\n for (const group of testGroups)\n this._updateCounterForWorkerHash(group.workerHash, +1);\n this._isStopped = false;\n this._workerSlots = [];\n // 0. Stop right away if we have reached max failures.\n if (this._failureTracker.hasReachedMaxFailures())\n void this.stop();\n // 1. Allocate workers.\n for (let i = 0; i < this._config.config.workers; i++)\n this._workerSlots.push({ busy: false });\n // 2. Schedule enough jobs.\n for (let i = 0; i < this._workerSlots.length; i++)\n this._scheduleJob();\n this._checkFinished();\n // 3. More jobs are scheduled when the worker becomes free.\n // 4. Wait for all jobs to finish.\n await this._finished;\n }\n\n _createWorker(testGroup: TestGroup, parallelIndex: number, loaderData: SerializedConfig) {\n const projectConfig = this._config.projects.find(p => p.id === testGroup.projectId)!;\n const outputDir = projectConfig.project.outputDir;\n const worker = new WorkerHost(testGroup, {\n parallelIndex,\n config: loaderData,\n extraEnv: this._extraEnvByProjectId.get(testGroup.projectId) || {},\n outputDir,\n pauseOnError: this._failureTracker.pauseOnError(),\n pauseAtEnd: this._failureTracker.pauseAtEnd(projectConfig),\n });\n const handleOutput = (params: TestOutputPayload) => {\n const chunk = chunkFromParams(params);\n if (worker.didFail()) {\n // Note: we keep reading stdio from workers that are currently stopping after failure,\n // to debug teardown issues. However, we avoid spoiling the test result from\n // the next retry.\n return { chunk };\n }\n const currentlyRunning = this._workerSlots[parallelIndex].jobDispatcher?.currentlyRunning();\n if (!currentlyRunning)\n return { chunk };\n return { chunk, test: currentlyRunning.test, result: currentlyRunning.result };\n };\n worker.on('stdOut', (params: TestOutputPayload) => {\n const { chunk, test, result } = handleOutput(params);\n result?.stdout.push(chunk);\n this._reporter.onStdOut?.(chunk, test, result);\n });\n worker.on('stdErr', (params: TestOutputPayload) => {\n const { chunk, test, result } = handleOutput(params);\n result?.stderr.push(chunk);\n this._reporter.onStdErr?.(chunk, test, result);\n });\n worker.on('teardownErrors', (params: TeardownErrorsPayload) => {\n this._failureTracker.onWorkerError();\n for (const error of params.fatalErrors)\n this._reporter.onError?.(error);\n });\n worker.on('exit', () => {\n const producedEnv = this._producedEnvByProjectId.get(testGroup.projectId) || {};\n this._producedEnvByProjectId.set(testGroup.projectId, { ...producedEnv, ...worker.producedEnv() });\n });\n return worker;\n }\n\n producedEnvByProjectId() {\n return this._producedEnvByProjectId;\n }\n\n async stop() {\n if (this._isStopped)\n return;\n this._isStopped = true;\n await Promise.all(this._workerSlots.map(({ worker }) => worker?.stop()));\n this._checkFinished();\n }\n}\n\nclass JobDispatcher {\n jobResult = new ManualPromise<{ newJob?: TestGroup, didFail: boolean }>();\n\n readonly job: TestGroup;\n private _reporter: ReporterV2;\n private _failureTracker: FailureTracker;\n private _stopCallback: () => void;\n private _listeners: RegisteredListener[] = [];\n private _failedTests = new Set<TestCase>();\n private _failedWithNonRetriableError = new Set<TestCase|Suite>();\n private _remainingByTestId = new Map<string, TestCase>();\n private _dataByTestId = new Map<string, { test: TestCase, result: TestResult, steps: Map<string, TestStep> }>();\n private _parallelIndex = 0;\n private _workerIndex = 0;\n private _currentlyRunning: { test: TestCase, result: TestResult } | undefined;\n\n constructor(job: TestGroup, reporter: ReporterV2, failureTracker: FailureTracker, stopCallback: () => void) {\n this.job = job;\n this._reporter = reporter;\n this._failureTracker = failureTracker;\n this._stopCallback = stopCallback;\n this._remainingByTestId = new Map(this.job.tests.map(e => [e.id, e]));\n }\n\n private _onTestBegin(params: TestBeginPayload) {\n const test = this._remainingByTestId.get(params.testId);\n if (!test) {\n // TODO: this should never be the case, report an internal error?\n return;\n }\n const result = test._appendTestResult();\n this._dataByTestId.set(test.id, { test, result, steps: new Map() });\n result.parallelIndex = this._parallelIndex;\n result.workerIndex = this._workerIndex;\n result.startTime = new Date(params.startWallTime);\n this._reporter.onTestBegin?.(test, result);\n this._currentlyRunning = { test, result };\n }\n\n private _onTestEnd(params: TestEndPayload) {\n if (this._failureTracker.hasReachedMaxFailures()) {\n // Do not show more than one error to avoid confusion, but report\n // as interrupted to indicate that we did actually start the test.\n params.status = 'interrupted';\n params.errors = [];\n }\n const data = this._dataByTestId.get(params.testId);\n if (!data) {\n // TODO: this should never be the case, report an internal error?\n return;\n }\n this._dataByTestId.delete(params.testId);\n this._remainingByTestId.delete(params.testId);\n const { result, test } = data;\n result.duration = params.duration;\n result.errors = params.errors;\n result.error = result.errors[0];\n result.status = params.status;\n result.annotations = params.annotations;\n test.annotations = [...params.annotations]; // last test result wins\n test.expectedStatus = params.expectedStatus;\n test.timeout = params.timeout;\n const isFailure = result.status !== 'skipped' && result.status !== test.expectedStatus;\n if (isFailure)\n this._failedTests.add(test);\n if (params.hasNonRetriableError)\n this._addNonretriableTestAndSerialModeParents(test);\n this._reportTestEnd(test, result);\n this._currentlyRunning = undefined;\n }\n\n private _addNonretriableTestAndSerialModeParents(test: TestCase) {\n this._failedWithNonRetriableError.add(test);\n for (let parent: Suite | undefined = test.parent; parent; parent = parent.parent) {\n if (parent._parallelMode === 'serial')\n this._failedWithNonRetriableError.add(parent);\n }\n }\n\n private _onStepBegin(params: StepBeginPayload) {\n const data = this._dataByTestId.get(params.testId);\n if (!data) {\n // The test has finished, but steps are still coming. Just ignore them.\n return;\n }\n const { result, steps, test } = data;\n const parentStep = params.parentStepId ? steps.get(params.parentStepId) : undefined;\n const step: TestStep = {\n title: params.title,\n titlePath: () => {\n const parentPath = parentStep?.titlePath() || [];\n return [...parentPath, params.title];\n },\n parent: parentStep,\n category: params.category,\n startTime: new Date(params.wallTime),\n duration: -1,\n steps: [],\n attachments: [],\n annotations: [],\n location: params.location,\n };\n steps.set(params.stepId, step);\n (parentStep || result).steps.push(step);\n this._reporter.onStepBegin?.(test, result, step);\n }\n\n private _onStepEnd(params: StepEndPayload) {\n const data = this._dataByTestId.get(params.testId);\n if (!data) {\n // The test has finished, but steps are still coming. Just ignore them.\n return;\n }\n const { result, steps, test } = data;\n const step = steps.get(params.stepId);\n if (!step) {\n this._reporter.onStdErr?.('Internal error: step end without step begin: ' + params.stepId, test, result);\n return;\n }\n step.duration = params.wallTime - step.startTime.getTime();\n if (params.error)\n step.error = params.error;\n if (params.suggestedRebaseline)\n addSuggestedRebaseline(step.location!, params.suggestedRebaseline);\n step.annotations = params.annotations;\n steps.delete(params.stepId);\n this._reporter.onStepEnd?.(test, result, step);\n }\n\n private _onAttach(params: AttachmentPayload) {\n const data = this._dataByTestId.get(params.testId)!;\n if (!data) {\n // The test has finished, but attachments are still coming. Just ignore them.\n return;\n }\n const attachment = {\n name: params.name,\n path: params.path,\n contentType: params.contentType,\n body: params.body !== undefined ? Buffer.from(params.body, 'base64') : undefined\n };\n data.result.attachments.push(attachment);\n if (params.stepId) {\n const step = data.steps.get(params.stepId);\n if (step)\n step.attachments.push(attachment);\n else\n this._reporter.onStdErr?.('Internal error: step id not found: ' + params.stepId);\n }\n }\n\n private _failTestWithErrors(test: TestCase, errors: TestError[]) {\n const runData = this._dataByTestId.get(test.id);\n // There might be a single test that has started but has not finished yet.\n let result: TestResult;\n if (runData) {\n result = runData.result;\n } else {\n result = test._appendTestResult();\n this._reporter.onTestBegin?.(test, result);\n }\n result.errors = [...errors];\n result.error = result.errors[0];\n result.status = errors.length ? 'failed' : 'skipped';\n this._reportTestEnd(test, result);\n this._failedTests.add(test);\n }\n\n private _massSkipTestsFromRemaining(testIds: Set<string>, errors: TestError[]) {\n for (const test of this._remainingByTestId.values()) {\n if (!testIds.has(test.id))\n continue;\n if (!this._failureTracker.hasReachedMaxFailures()) {\n this._failTestWithErrors(test, errors);\n errors = []; // Only report errors for the first test.\n }\n this._remainingByTestId.delete(test.id);\n }\n if (errors.length) {\n // We had fatal errors after all tests have passed - most likely in some teardown.\n // Let's just fail the test run.\n this._failureTracker.onWorkerError();\n for (const error of errors)\n this._reporter.onError?.(error);\n }\n }\n\n private _onDone(params: DonePayload & { unexpectedExitError?: TestError }) {\n // We won't file remaining if:\n // - there are no remaining\n // - we are here not because something failed\n // - no unrecoverable worker error\n if (!this._remainingByTestId.size && !this._failedTests.size && !params.fatalErrors.length && !params.skipTestsDueToSetupFailure.length && !params.fatalUnknownTestIds && !params.unexpectedExitError && !params.stoppedDueToUnhandledErrorInTestFail) {\n this._finished({ didFail: false });\n return;\n }\n\n for (const testId of params.fatalUnknownTestIds || []) {\n const test = this._remainingByTestId.get(testId);\n if (test) {\n this._remainingByTestId.delete(testId);\n this._failTestWithErrors(test, [{ message: `Test not found in the worker process. Make sure test title does not change.` }]);\n }\n }\n\n if (params.fatalErrors.length) {\n // In case of fatal errors, report first remaining test as failing with these errors,\n // and all others as skipped.\n this._massSkipTestsFromRemaining(new Set(this._remainingByTestId.keys()), params.fatalErrors);\n }\n // Handle tests that should be skipped because of the setup failure.\n this._massSkipTestsFromRemaining(new Set(params.skipTestsDueToSetupFailure), []);\n\n if (params.unexpectedExitError) {\n // When worker exits during a test, we blame the test itself.\n //\n // The most common situation when worker exits while not running a test is:\n // worker failed to require the test file (at the start) because of an exception in one of imports.\n // In this case, \"skip\" all remaining tests, to avoid running into the same exception over and over.\n if (this._currentlyRunning)\n this._massSkipTestsFromRemaining(new Set([this._currentlyRunning.test.id]), [params.unexpectedExitError]);\n else\n this._massSkipTestsFromRemaining(new Set(this._remainingByTestId.keys()), [params.unexpectedExitError]);\n }\n\n const retryCandidates = new Set<TestCase>();\n const serialSuitesWithFailures = new Set<Suite>();\n\n for (const failedTest of this._failedTests) {\n if (this._failedWithNonRetriableError.has(failedTest))\n continue;\n retryCandidates.add(failedTest);\n\n let outermostSerialSuite: Suite | undefined;\n for (let parent: Suite | undefined = failedTest.parent; parent; parent = parent.parent) {\n if (parent._parallelMode === 'serial')\n outermostSerialSuite = parent;\n }\n if (outermostSerialSuite && !this._failedWithNonRetriableError.has(outermostSerialSuite))\n serialSuitesWithFailures.add(outermostSerialSuite);\n }\n\n // If we have failed tests that belong to a serial suite,\n // we should skip all future tests from the same serial suite.\n const testsBelongingToSomeSerialSuiteWithFailures = [...this._remainingByTestId.values()].filter(test => {\n let parent: Suite | undefined = test.parent;\n while (parent && !serialSuitesWithFailures.has(parent))\n parent = parent.parent;\n return !!parent;\n });\n this._massSkipTestsFromRemaining(new Set(testsBelongingToSomeSerialSuiteWithFailures.map(test => test.id)), []);\n\n for (const serialSuite of serialSuitesWithFailures) {\n // Add all tests from failed serial suites for possible retry.\n // These will only be retried together, because they have the same\n // \"retries\" setting and the same number of previous runs.\n serialSuite.allTests().forEach(test => retryCandidates.add(test));\n }\n\n const remaining = [...this._remainingByTestId.values()];\n for (const test of retryCandidates) {\n if (test.results.length < test.retries + 1)\n remaining.push(test);\n }\n\n // This job is over, we will schedule another one.\n const newJob = remaining.length ? { ...this.job, tests: remaining } : undefined;\n this._finished({ didFail: true, newJob });\n }\n\n onExit(data: ProcessExitData) {\n const unexpectedExitError: TestError | undefined = data.unexpectedly ? {\n message: `Error: worker process exited unexpectedly (code=${data.code}, signal=${data.signal})`\n } : undefined;\n this._onDone({ skipTestsDueToSetupFailure: [], fatalErrors: [], unexpectedExitError });\n }\n\n private _finished(result: { newJob?: TestGroup, didFail: boolean }) {\n eventsHelper.removeEventListeners(this._listeners);\n this.jobResult.resolve(result);\n }\n\n runInWorker(worker: WorkerHost) {\n this._parallelIndex = worker.parallelIndex;\n this._workerIndex = worker.workerIndex;\n\n const runPayload: RunPayload = {\n file: this.job.requireFile,\n entries: this.job.tests.map(test => {\n return { testId: test.id, retry: test.results.length };\n }),\n };\n worker.runTestGroup(runPayload);\n\n this._listeners = [\n eventsHelper.addEventListener(worker, 'testBegin', this._onTestBegin.bind(this)),\n eventsHelper.addEventListener(worker, 'testEnd', this._onTestEnd.bind(this)),\n eventsHelper.addEventListener(worker, 'stepBegin', this._onStepBegin.bind(this)),\n eventsHelper.addEventListener(worker, 'stepEnd', this._onStepEnd.bind(this)),\n eventsHelper.addEventListener(worker, 'attach', this._onAttach.bind(this)),\n eventsHelper.addEventListener(worker, 'done', this._onDone.bind(this)),\n eventsHelper.addEventListener(worker, 'exit', this.onExit.bind(this)),\n ];\n }\n\n skipWholeJob(): boolean {\n // If all the tests in a group are skipped, we report them immediately\n // without sending anything to a worker. This avoids creating unnecessary worker processes.\n //\n // However, if there is at least one non-skipped test in a group, we'll send\n // the whole group to the worker process and report tests in the natural order,\n // with skipped tests mixed in-between non-skipped. This makes\n // for a better reporter experience.\n const allTestsSkipped = this.job.tests.every(test => test.expectedStatus === 'skipped');\n if (allTestsSkipped && !this._failureTracker.hasReachedMaxFailures()) {\n for (const test of this.job.tests) {\n const result = test._appendTestResult();\n this._reporter.onTestBegin?.(test, result);\n result.status = 'skipped';\n this._reportTestEnd(test, result);\n }\n return true;\n }\n return false;\n }\n\n currentlyRunning() {\n return this._currentlyRunning;\n }\n\n private _reportTestEnd(test: TestCase, result: TestResult) {\n this._reporter.onTestEnd?.(test, result);\n const hadMaxFailures = this._failureTracker.hasReachedMaxFailures();\n this._failureTracker.onTestEnd(test, result);\n if (this._failureTracker.hasReachedMaxFailures()) {\n this._stopCallback();\n if (!hadMaxFailures)\n this._reporter.onError?.({ message: colors.red(`Testing stopped early after ${this._failureTracker.maxFailures()} maximum allowed failures.`) });\n }\n }\n}\n\nfunction chunkFromParams(params: TestOutputPayload): string | Buffer {\n if (typeof params.text === 'string')\n return params.text;\n return Buffer.from(params.buffer!, 'base64');\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBA,mBAA6C;AAC7C,IAAAA,gBAAuB;AAEvB,oBAAuC;AACvC,wBAA2B;AAC3B,iBAAgC;AAgBzB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;AACvC,UAAM,iBAAiB,KAAK,gBAAgB,sBAAsB;AAClE,SAAK,gBAAgB,UAAU,MAAM,MAAM;AAC3C,QAAI,KAAK,gBAAgB,sBAAsB,GAAG;AAChD,WAAK,cAAc;AACnB,UAAI,CAAC;AACH,aAAK,UAAU,UAAU,EAAE,SAAS,qBAAO,IAAI,+BAA+B,KAAK,gBAAgB,YAAY,CAAC,4BAA4B,EAAE,CAAC;AAAA,IACnJ;AAAA,EACF;AACF;AAEA,SAAS,gBAAgB,QAA4C;AACnE,MAAI,OAAO,OAAO,SAAS;AACzB,WAAO,OAAO;AAChB,SAAO,OAAO,KAAK,OAAO,QAAS,QAAQ;AAC7C;",
6
- "names": ["import_utils"]
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/runner/failureTracker.ts"],
4
- "sourcesContent": ["/**\n * Copyright Microsoft Corporation. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { TestResult } from '../../types/testReporter';\nimport type { FullConfigInternal, FullProjectInternal } from '../common/config';\nimport type { Suite, TestCase } from '../common/test';\n\nexport class FailureTracker {\n private _failureCount = 0;\n private _hasWorkerErrors = false;\n private _rootSuite: Suite | undefined;\n private _topLevelProjects: FullProjectInternal[] = [];\n private _pauseOnError: boolean;\n private _pauseAtEnd: boolean;\n\n constructor(private _config: FullConfigInternal, options?: { pauseOnError?: boolean, pauseAtEnd?: boolean }) {\n this._pauseOnError = options?.pauseOnError ?? false;\n this._pauseAtEnd = options?.pauseAtEnd ?? false;\n }\n\n onRootSuite(rootSuite: Suite, topLevelProjects: FullProjectInternal[]) {\n this._rootSuite = rootSuite;\n this._topLevelProjects = topLevelProjects;\n }\n\n onTestEnd(test: TestCase, result: TestResult) {\n // Test is considered failing after the last retry.\n if (test.outcome() === 'unexpected' && test.results.length > test.retries)\n ++this._failureCount;\n }\n\n onWorkerError() {\n this._hasWorkerErrors = true;\n }\n\n pauseOnError(): boolean {\n return this._pauseOnError;\n }\n\n pauseAtEnd(inProject: FullProjectInternal): boolean {\n return this._pauseAtEnd && this._topLevelProjects.includes(inProject);\n }\n\n hasReachedMaxFailures() {\n return this.maxFailures() > 0 && this._failureCount >= this.maxFailures();\n }\n\n hasWorkerErrors() {\n return this._hasWorkerErrors;\n }\n\n result(): 'failed' | 'passed' {\n return this._hasWorkerErrors || this.hasReachedMaxFailures() || this.hasFailedTests() || (this._config.failOnFlakyTests && this.hasFlakyTests()) ? 'failed' : 'passed';\n }\n\n hasFailedTests() {\n return this._rootSuite?.allTests().some(test => !test.ok());\n }\n\n hasFlakyTests() {\n return this._rootSuite?.allTests().some(test => (test.outcome() === 'flaky'));\n }\n\n maxFailures() {\n return this._config.config.maxFailures;\n }\n\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAoBO,MAAM,eAAe;AAAA,EAQ1B,YAAoB,SAA6B,SAA4D;AAAzF;AAPpB,SAAQ,gBAAgB;AACxB,SAAQ,mBAAmB;AAE3B,SAAQ,oBAA2C,CAAC;AAKlD,SAAK,gBAAgB,SAAS,gBAAgB;AAC9C,SAAK,cAAc,SAAS,cAAc;AAAA,EAC5C;AAAA,EAEA,YAAY,WAAkB,kBAAyC;AACrE,SAAK,aAAa;AAClB,SAAK,oBAAoB;AAAA,EAC3B;AAAA,EAEA,UAAU,MAAgB,QAAoB;AAE5C,QAAI,KAAK,QAAQ,MAAM,gBAAgB,KAAK,QAAQ,SAAS,KAAK;AAChE,QAAE,KAAK;AAAA,EACX;AAAA,EAEA,gBAAgB;AACd,SAAK,mBAAmB;AAAA,EAC1B;AAAA,EAEA,eAAwB;AACtB,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,WAAW,WAAyC;AAClD,WAAO,KAAK,eAAe,KAAK,kBAAkB,SAAS,SAAS;AAAA,EACtE;AAAA,EAEA,wBAAwB;AACtB,WAAO,KAAK,YAAY,IAAI,KAAK,KAAK,iBAAiB,KAAK,YAAY;AAAA,EAC1E;AAAA,EAEA,kBAAkB;AAChB,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,SAA8B;AAC5B,WAAO,KAAK,oBAAoB,KAAK,sBAAsB,KAAK,KAAK,eAAe,KAAM,KAAK,QAAQ,oBAAoB,KAAK,cAAc,IAAK,WAAW;AAAA,EAChK;AAAA,EAEA,iBAAiB;AACf,WAAO,KAAK,YAAY,SAAS,EAAE,KAAK,UAAQ,CAAC,KAAK,GAAG,CAAC;AAAA,EAC5D;AAAA,EAEA,gBAAgB;AACd,WAAO,KAAK,YAAY,SAAS,EAAE,KAAK,UAAS,KAAK,QAAQ,MAAM,OAAQ;AAAA,EAC9E;AAAA,EAEA,cAAc;AACZ,WAAO,KAAK,QAAQ,OAAO;AAAA,EAC7B;AAEF;",
6
- "names": []
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/runner/lastRun.ts"],
4
- "sourcesContent": ["/**\n * Copyright Microsoft Corporation. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport fs from 'fs';\nimport path from 'path';\n\nimport { filterProjects } from './projectUtils';\n\nimport type { FullResult, Suite } from '../../types/testReporter';\nimport type { FullConfigInternal } from '../common/config';\nimport type { ReporterV2 } from '../reporters/reporterV2';\n\ntype LastRunInfo = {\n status: FullResult['status'];\n failedTests: string[];\n};\n\nexport class LastRunReporter implements ReporterV2 {\n private _config: FullConfigInternal;\n private _lastRunFile: string | undefined;\n private _suite: Suite | undefined;\n\n constructor(config: FullConfigInternal) {\n this._config = config;\n const [project] = filterProjects(config.projects, config.cliProjectFilter);\n if (project)\n this._lastRunFile = path.join(project.project.outputDir, '.last-run.json');\n }\n\n async filterLastFailed() {\n if (!this._lastRunFile)\n return;\n try {\n const lastRunInfo = JSON.parse(await fs.promises.readFile(this._lastRunFile, 'utf8')) as LastRunInfo;\n const failedTestIds = new Set(lastRunInfo.failedTests);\n // Explicitly apply --last-failed filter after sharding.\n this._config.postShardTestFilters.push(test => failedTestIds.has(test.id));\n } catch {\n }\n }\n\n version(): 'v2' {\n return 'v2';\n }\n\n printsToStdio() {\n return false;\n }\n\n onBegin(suite: Suite) {\n this._suite = suite;\n }\n\n async onEnd(result: FullResult) {\n if (!this._lastRunFile || this._config.cliListOnly)\n return;\n const lastRunInfo: LastRunInfo = {\n status: result.status,\n failedTests: this._suite?.allTests().filter(t => !t.ok()).map(t => t.id) || [],\n };\n await fs.promises.mkdir(path.dirname(this._lastRunFile), { recursive: true });\n await fs.promises.writeFile(this._lastRunFile, JSON.stringify(lastRunInfo, undefined, 2));\n }\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBA,gBAAe;AACf,kBAAiB;AAEjB,0BAA+B;AAWxB,MAAM,gBAAsC;AAAA,EAKjD,YAAY,QAA4B;AACtC,SAAK,UAAU;AACf,UAAM,CAAC,OAAO,QAAI,oCAAe,OAAO,UAAU,OAAO,gBAAgB;AACzE,QAAI;AACF,WAAK,eAAe,YAAAA,QAAK,KAAK,QAAQ,QAAQ,WAAW,gBAAgB;AAAA,EAC7E;AAAA,EAEA,MAAM,mBAAmB;AACvB,QAAI,CAAC,KAAK;AACR;AACF,QAAI;AACF,YAAM,cAAc,KAAK,MAAM,MAAM,UAAAC,QAAG,SAAS,SAAS,KAAK,cAAc,MAAM,CAAC;AACpF,YAAM,gBAAgB,IAAI,IAAI,YAAY,WAAW;AAErD,WAAK,QAAQ,qBAAqB,KAAK,UAAQ,cAAc,IAAI,KAAK,EAAE,CAAC;AAAA,IAC3E,QAAQ;AAAA,IACR;AAAA,EACF;AAAA,EAEA,UAAgB;AACd,WAAO;AAAA,EACT;AAAA,EAEA,gBAAgB;AACd,WAAO;AAAA,EACT;AAAA,EAEA,QAAQ,OAAc;AACpB,SAAK,SAAS;AAAA,EAChB;AAAA,EAEA,MAAM,MAAM,QAAoB;AAC9B,QAAI,CAAC,KAAK,gBAAgB,KAAK,QAAQ;AACrC;AACF,UAAM,cAA2B;AAAA,MAC/B,QAAQ,OAAO;AAAA,MACf,aAAa,KAAK,QAAQ,SAAS,EAAE,OAAO,OAAK,CAAC,EAAE,GAAG,CAAC,EAAE,IAAI,OAAK,EAAE,EAAE,KAAK,CAAC;AAAA,IAC/E;AACA,UAAM,UAAAA,QAAG,SAAS,MAAM,YAAAD,QAAK,QAAQ,KAAK,YAAY,GAAG,EAAE,WAAW,KAAK,CAAC;AAC5E,UAAM,UAAAC,QAAG,SAAS,UAAU,KAAK,cAAc,KAAK,UAAU,aAAa,QAAW,CAAC,CAAC;AAAA,EAC1F;AACF;",
6
- "names": ["path", "fs"]
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/runner/loadUtils.ts"],
4
- "sourcesContent": ["/**\n * Copyright Microsoft Corporation. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport path from 'path';\nimport fs from 'fs';\nimport { toPosixPath } from 'playwright-core/lib/utils';\n\nimport { InProcessLoaderHost, OutOfProcessLoaderHost } from './loaderHost';\nimport { createFileFiltersFromArguments, createFileMatcherFromArguments, createTitleMatcher, errorWithFile, forceRegExp, parseLocationArg } from '../util';\nimport { buildProjectsClosure, collectFilesForProject, filterProjects } from './projectUtils';\nimport { createTestGroups, filterForShard } from './testGroups';\nimport { applyRepeatEachIndex, bindFileSuiteToProject, filterByFocusedLine, filterOnly, filterTestsRemoveEmptySuites } from '../common/suiteUtils';\nimport { Suite } from '../common/test';\nimport { dependenciesForTestFile } from '../transform/compilationCache';\nimport { requireOrImport } from '../transform/transform';\nimport { sourceMapSupport } from '../utilsBundle';\n\nimport type { TestRun } from './tasks';\nimport type { TestGroup } from './testGroups';\nimport type { FullConfig, Reporter, TestError } from '../../types/testReporter';\nimport type { FullProjectInternal } from '../common/config';\nimport type { FullConfigInternal } from '../common/config';\nimport type { TestCase } from '../common/test';\nimport type { Matcher, TestCaseFilter, TestFileFilter } from '../util';\nimport type { RawSourceMap } from '../utilsBundle';\n\n\nexport async function collectProjectsAndTestFiles(testRun: TestRun, doNotRunTestsOutsideProjectFilter: boolean) {\n const config = testRun.config;\n const fsCache = new Map();\n const sourceMapCache = new Map();\n const cliFileMatcher = config.cliArgs.length ? createFileMatcherFromArguments(config.cliArgs) : null;\n\n // First collect all files for the projects in the command line, don't apply any file filters.\n const allFilesForProject = new Map<FullProjectInternal, string[]>();\n const filteredProjects = filterProjects(config.projects, config.cliProjectFilter);\n for (const project of filteredProjects) {\n const files = await collectFilesForProject(project, fsCache);\n allFilesForProject.set(project, files);\n }\n\n // Filter files based on the file filters, eliminate the empty projects.\n const filesToRunByProject = new Map<FullProjectInternal, string[]>();\n for (const [project, files] of allFilesForProject) {\n const matchedFiles = files.filter(file => {\n const hasMatchingSources = sourceMapSources(file, sourceMapCache).some(source => {\n if (cliFileMatcher && !cliFileMatcher(source))\n return false;\n return true;\n });\n return hasMatchingSources;\n });\n const filteredFiles = matchedFiles.filter(Boolean) as string[];\n filesToRunByProject.set(project, filteredFiles);\n }\n\n // (Re-)add all files for dependent projects, disregard filters.\n const projectClosure = buildProjectsClosure([...filesToRunByProject.keys()]);\n for (const [project, type] of projectClosure) {\n if (type === 'dependency') {\n const treatProjectAsEmpty = doNotRunTestsOutsideProjectFilter && !filteredProjects.includes(project);\n const files = treatProjectAsEmpty ? [] : allFilesForProject.get(project) || await collectFilesForProject(project, fsCache);\n filesToRunByProject.set(project, files);\n }\n }\n\n testRun.projectFiles = filesToRunByProject;\n testRun.projectSuites = new Map();\n}\n\nexport async function loadFileSuites(testRun: TestRun, mode: 'out-of-process' | 'in-process', errors: TestError[]) {\n // Determine all files to load.\n const config = testRun.config;\n const allTestFiles = new Set<string>();\n for (const files of testRun.projectFiles.values())\n files.forEach(file => allTestFiles.add(file));\n\n // Load test files.\n const fileSuiteByFile = new Map<string, Suite>();\n const loaderHost = mode === 'out-of-process' ? new OutOfProcessLoaderHost(config) : new InProcessLoaderHost(config);\n if (await loaderHost.start(errors)) {\n for (const file of allTestFiles) {\n const fileSuite = await loaderHost.loadTestFile(file, errors);\n fileSuiteByFile.set(file, fileSuite);\n errors.push(...createDuplicateTitlesErrors(config, fileSuite));\n }\n await loaderHost.stop();\n }\n\n // Check that no test file imports another test file.\n // Loader must be stopped first, since it populates the dependency tree.\n for (const file of allTestFiles) {\n for (const dependency of dependenciesForTestFile(file)) {\n if (allTestFiles.has(dependency)) {\n const importer = path.relative(config.config.rootDir, file);\n const importee = path.relative(config.config.rootDir, dependency);\n errors.push({\n message: `Error: test file \"${importer}\" should not import test file \"${importee}\"`,\n location: { file, line: 1, column: 1 },\n });\n }\n }\n }\n\n // Collect file suites for each project.\n for (const [project, files] of testRun.projectFiles) {\n const suites = files.map(file => fileSuiteByFile.get(file)).filter(Boolean) as Suite[];\n testRun.projectSuites.set(project, suites);\n }\n}\n\nexport async function createRootSuite(testRun: TestRun, errors: TestError[], shouldFilterOnly: boolean): Promise<{ rootSuite: Suite, topLevelProjects: FullProjectInternal[] }> {\n const config = testRun.config;\n // Create root suite, where each child will be a project suite with cloned file suites inside it.\n const rootSuite = new Suite('', 'root');\n const projectSuites = new Map<FullProjectInternal, Suite>();\n const filteredProjectSuites = new Map<FullProjectInternal, Suite>();\n\n // Filter all the projects using grep, testId, file names.\n {\n // Interpret cli parameters.\n const cliFileFilters = createFileFiltersFromArguments(config.cliArgs);\n const grepMatcher = config.cliGrep ? createTitleMatcher(forceRegExp(config.cliGrep)) : () => true;\n const grepInvertMatcher = config.cliGrepInvert ? createTitleMatcher(forceRegExp(config.cliGrepInvert)) : () => false;\n const cliTitleMatcher = (title: string) => !grepInvertMatcher(title) && grepMatcher(title);\n\n // Filter file suites for all projects.\n for (const [project, fileSuites] of testRun.projectSuites) {\n const projectSuite = createProjectSuite(project, fileSuites);\n projectSuites.set(project, projectSuite);\n\n const filteredProjectSuite = filterProjectSuite(projectSuite, { cliFileFilters, cliTitleMatcher, testFilters: config.preOnlyTestFilters });\n filteredProjectSuites.set(project, filteredProjectSuite);\n }\n }\n\n if (shouldFilterOnly) {\n // Create a fake root to execute the exclusive semantics across the projects.\n const filteredRoot = new Suite('', 'root');\n for (const filteredProjectSuite of filteredProjectSuites.values())\n filteredRoot._addSuite(filteredProjectSuite);\n filterOnly(filteredRoot);\n for (const [project, filteredProjectSuite] of filteredProjectSuites) {\n if (!filteredRoot.suites.includes(filteredProjectSuite))\n filteredProjectSuites.delete(project);\n }\n }\n\n // Add post-filtered top-level projects to the root suite for sharding and 'only' processing.\n const projectClosure = buildProjectsClosure([...filteredProjectSuites.keys()], project => filteredProjectSuites.get(project)!._hasTests());\n for (const [project, type] of projectClosure) {\n if (type === 'top-level') {\n project.project.repeatEach = project.fullConfig.configCLIOverrides.repeatEach ?? project.project.repeatEach;\n rootSuite._addSuite(buildProjectSuite(project, filteredProjectSuites.get(project)!));\n }\n }\n\n // Complain about only.\n if (config.config.forbidOnly) {\n const onlyTestsAndSuites = rootSuite._getOnlyItems();\n if (onlyTestsAndSuites.length > 0) {\n const configFilePath = config.config.configFile ? path.relative(config.config.rootDir, config.config.configFile) : undefined;\n errors.push(...createForbidOnlyErrors(onlyTestsAndSuites, config.configCLIOverrides.forbidOnly, configFilePath));\n }\n }\n\n // Shard only the top-level projects.\n if (config.config.shard) {\n // Create test groups for top-level projects.\n const testGroups: TestGroup[] = [];\n for (const projectSuite of rootSuite.suites) {\n // Split beforeAll-grouped tests into \"config.shard.total\" groups when needed.\n // Later on, we'll re-split them between workers by using \"config.workers\" instead.\n for (const group of createTestGroups(projectSuite, config.config.shard.total))\n testGroups.push(group);\n }\n\n // Shard test groups.\n const testGroupsInThisShard = filterForShard(config.config.shard, testGroups);\n const testsInThisShard = new Set<TestCase>();\n for (const group of testGroupsInThisShard) {\n for (const test of group.tests)\n testsInThisShard.add(test);\n }\n\n // Update project suites, removing empty ones.\n filterTestsRemoveEmptySuites(rootSuite, test => testsInThisShard.has(test));\n }\n\n if (config.postShardTestFilters.length)\n filterTestsRemoveEmptySuites(rootSuite, test => config.postShardTestFilters.every(filter => filter(test)));\n\n const topLevelProjects = [];\n // Now prepend dependency projects without filtration.\n {\n // Filtering 'only' and sharding might have reduced the number of top-level projects.\n // Build the project closure to only include dependencies that are still needed.\n const projectClosure = new Map(buildProjectsClosure(rootSuite.suites.map(suite => suite._fullProject!)));\n\n // Clone file suites for dependency projects.\n for (const [project, level] of projectClosure.entries()) {\n if (level === 'dependency')\n rootSuite._prependSuite(buildProjectSuite(project, projectSuites.get(project)!));\n else\n topLevelProjects.push(project);\n }\n }\n\n return { rootSuite, topLevelProjects };\n}\n\nfunction createProjectSuite(project: FullProjectInternal, fileSuites: Suite[]): Suite {\n const projectSuite = new Suite(project.project.name, 'project');\n for (const fileSuite of fileSuites)\n projectSuite._addSuite(bindFileSuiteToProject(project, fileSuite));\n\n const grepMatcher = createTitleMatcher(project.project.grep);\n const grepInvertMatcher = project.project.grepInvert ? createTitleMatcher(project.project.grepInvert) : null;\n filterTestsRemoveEmptySuites(projectSuite, (test: TestCase) => {\n const grepTitle = test._grepTitleWithTags();\n if (grepInvertMatcher?.(grepTitle))\n return false;\n return grepMatcher(grepTitle);\n });\n return projectSuite;\n}\n\nfunction filterProjectSuite(projectSuite: Suite, options: { cliFileFilters: TestFileFilter[], cliTitleMatcher?: Matcher, testFilters: TestCaseFilter[] }): Suite {\n // Fast path.\n if (!options.cliFileFilters.length && !options.cliTitleMatcher && !options.testFilters.length)\n return projectSuite;\n\n const result = projectSuite._deepClone();\n if (options.cliFileFilters.length)\n filterByFocusedLine(result, options.cliFileFilters);\n filterTestsRemoveEmptySuites(result, (test: TestCase) => {\n if (!options.testFilters.every(filter => filter(test)))\n return false;\n if (options.cliTitleMatcher && !options.cliTitleMatcher(test._grepTitleWithTags()))\n return false;\n return true;\n });\n return result;\n}\n\nfunction buildProjectSuite(project: FullProjectInternal, projectSuite: Suite): Suite {\n const result = new Suite(project.project.name, 'project');\n result._fullProject = project;\n if (project.fullyParallel)\n result._parallelMode = 'parallel';\n\n for (const fileSuite of projectSuite.suites) {\n // Fast path for the repeatEach = 0.\n result._addSuite(fileSuite);\n\n for (let repeatEachIndex = 1; repeatEachIndex < project.project.repeatEach; repeatEachIndex++) {\n const clone = fileSuite._deepClone();\n applyRepeatEachIndex(project, clone, repeatEachIndex);\n result._addSuite(clone);\n }\n }\n return result;\n}\n\nfunction createForbidOnlyErrors(onlyTestsAndSuites: (TestCase | Suite)[], forbidOnlyCLIFlag: boolean | undefined, configFilePath: string | undefined): TestError[] {\n const errors: TestError[] = [];\n for (const testOrSuite of onlyTestsAndSuites) {\n // Skip root and file.\n const title = testOrSuite.titlePath().slice(2).join(' ');\n const configFilePathName = configFilePath ? `'${configFilePath}'` : 'the Playwright configuration file';\n const forbidOnlySource = forbidOnlyCLIFlag ? `'--forbid-only' CLI flag` : `'forbidOnly' option in ${configFilePathName}`;\n const error: TestError = {\n message: `Error: item focused with '.only' is not allowed due to the ${forbidOnlySource}: \"${title}\"`,\n location: testOrSuite.location!,\n };\n errors.push(error);\n }\n return errors;\n}\n\nfunction createDuplicateTitlesErrors(config: FullConfigInternal, fileSuite: Suite): TestError[] {\n const errors: TestError[] = [];\n const testsByFullTitle = new Map<string, TestCase>();\n for (const test of fileSuite.allTests()) {\n const fullTitle = test.titlePath().slice(1).join(' \u203A ');\n const existingTest = testsByFullTitle.get(fullTitle);\n if (existingTest) {\n const error: TestError = {\n message: `Error: duplicate test title \"${fullTitle}\", first declared in ${buildItemLocation(config.config.rootDir, existingTest)}`,\n location: test.location,\n };\n errors.push(error);\n }\n testsByFullTitle.set(fullTitle, test);\n }\n return errors;\n}\n\nfunction buildItemLocation(rootDir: string, testOrSuite: Suite | TestCase) {\n if (!testOrSuite.location)\n return '';\n return `${path.relative(rootDir, testOrSuite.location.file)}:${testOrSuite.location.line}`;\n}\n\nasync function requireOrImportDefaultFunction(file: string, expectConstructor: boolean) {\n let func = await requireOrImport(file);\n if (func && typeof func === 'object' && ('default' in func))\n func = func['default'];\n if (typeof func !== 'function')\n throw errorWithFile(file, `file must export a single ${expectConstructor ? 'class' : 'function'}.`);\n return func;\n}\n\nexport function loadGlobalHook(config: FullConfigInternal, file: string): Promise<(config: FullConfig) => any> {\n return requireOrImportDefaultFunction(path.resolve(config.config.rootDir, file), false);\n}\n\nexport function loadReporter(config: FullConfigInternal | null, file: string): Promise<new (arg?: any) => Reporter> {\n return requireOrImportDefaultFunction(config ? path.resolve(config.config.rootDir, file) : file, true);\n}\n\nfunction sourceMapSources(file: string, cache: Map<string, string[]>): string[] {\n let sources = [file];\n if (!file.endsWith('.js'))\n return sources;\n if (cache.has(file))\n return cache.get(file)!;\n\n try {\n const sourceMap = sourceMapSupport.retrieveSourceMap(file);\n const sourceMapData: RawSourceMap | undefined = typeof sourceMap?.map === 'string' ? JSON.parse(sourceMap.map) : sourceMap?.map;\n if (sourceMapData?.sources)\n sources = sourceMapData.sources.map(source => path.resolve(path.dirname(file), source));\n } finally {\n cache.set(file, sources);\n return sources;\n }\n}\n\nexport async function loadTestList(config: FullConfigInternal, filePath: string): Promise<TestCaseFilter> {\n try {\n const content = await fs.promises.readFile(filePath, 'utf-8');\n const lines = content.split('\\n').map(line => line.trim()).filter(line => line && !line.startsWith('#'));\n const descriptions = lines.map(line => {\n const delimiter = line.includes('\u203A') ? '\u203A' : '>';\n const tokens = line.split(delimiter).map(token => token.trim());\n let project: string | undefined;\n if (tokens[0].startsWith('[')) {\n if (!tokens[0].endsWith(']'))\n throw new Error(`Malformed test description: ${line}`);\n project = tokens[0].substring(1, tokens[0].length - 1);\n tokens.shift();\n }\n return { project, file: toPosixPath(parseLocationArg(tokens[0]).file), titlePath: tokens.slice(1) };\n });\n return (test: TestCase) => descriptions.some(d => {\n // Note: there is no root yet at the time of filtering.\n const [projectName, , ...titles] = test.titlePath();\n if (d.project !== undefined && d.project !== projectName)\n return false;\n const relativeFile = toPosixPath(path.relative(config.config.rootDir, test.location.file));\n if (relativeFile !== d.file)\n return false;\n return d.titlePath.length === titles.length && d.titlePath.every((_, index) => titles[index] === d.titlePath[index]);\n });\n } catch (e) {\n throw errorWithFile(filePath, 'Cannot read test list file: ' + e.message);\n }\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBA,kBAAiB;AACjB,gBAAe;AACf,mBAA4B;AAE5B,wBAA4D;AAC5D,kBAAiJ;AACjJ,0BAA6E;AAC7E,wBAAkD;AAClD,wBAA4H;AAC5H,kBAAsB;AACtB,8BAAwC;AACxC,uBAAgC;AAChC,yBAAiC;AAYjC,eAAsB,4BAA4B,SAAkB,mCAA4C;AAC9G,QAAM,SAAS,QAAQ;AACvB,QAAM,UAAU,oBAAI,IAAI;AACxB,QAAM,iBAAiB,oBAAI,IAAI;AAC/B,QAAM,iBAAiB,OAAO,QAAQ,a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ACvD,kBAAU,OAAO,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,EAAE,SAAS,CAAC;AACrD,eAAO,MAAM;AAAA,MACf;AACA,aAAO,EAAE,SAAS,UAAM,8BAAY,8BAAiB,OAAO,CAAC,CAAC,EAAE,IAAI,GAAG,WAAW,OAAO,MAAM,CAAC,EAAE;AAAA,IACpG,CAAC;AACD,WAAO,CAAC,SAAmB,aAAa,KAAK,OAAK;AAEhD,YAAM,CAAC,aAAa,EAAE,GAAG,MAAM,IAAI,KAAK,UAAU;AAClD,UAAI,EAAE,YAAY,UAAa,EAAE,YAAY;AAC3C,eAAO;AACT,YAAM,mBAAe,0BAAY,YAAAF,QAAK,SAAS,OAAO,OAAO,SAAS,KAAK,SAAS,IAAI,CAAC;AACzF,UAAI,iBAAiB,EAAE;AACrB,eAAO;AACT,aAAO,EAAE,UAAU,WAAW,OAAO,UAAU,EAAE,UAAU,MAAM,CAAC,GAAG,UAAU,OAAO,KAAK,MAAM,EAAE,UAAU,KAAK,CAAC;AAAA,IACrH,CAAC;AAAA,EACH,SAAS,GAAG;AACV,cAAM,2BAAc,UAAU,iCAAiC,EAAE,OAAO;AAAA,EAC1E;AACF;",
6
- "names": ["path", "projectClosure", "fs"]
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/runner/loaderHost.ts"],
4
- "sourcesContent": ["/**\n * Copyright Microsoft Corporation. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ProcessHost } from './processHost';\nimport { incorporateCompilationCache } from '../common/esmLoaderHost';\nimport { serializeConfig } from '../common/ipc';\nimport { PoolBuilder } from '../common/poolBuilder';\nimport { Suite } from '../common/test';\nimport { loadTestFile } from '../common/testLoader';\nimport { addToCompilationCache } from '../transform/compilationCache';\n\nimport type { TestError } from '../../types/testReporter';\nimport type { FullConfigInternal } from '../common/config';\n\n\nexport class InProcessLoaderHost {\n private _config: FullConfigInternal;\n private _poolBuilder: PoolBuilder;\n\n constructor(config: FullConfigInternal) {\n this._config = config;\n this._poolBuilder = PoolBuilder.createForLoader();\n }\n\n async start(errors: TestError[]) {\n return true;\n }\n\n async loadTestFile(file: string, testErrors: TestError[]): Promise<Suite> {\n const result = await loadTestFile(file, this._config, testErrors);\n this._poolBuilder.buildPools(result, testErrors);\n return result;\n }\n\n async stop() {\n await incorporateCompilationCache();\n }\n}\n\nexport class OutOfProcessLoaderHost {\n private _config: FullConfigInternal;\n private _processHost: ProcessHost;\n\n constructor(config: FullConfigInternal) {\n this._config = config;\n this._processHost = new ProcessHost(require.resolve('../loader/loaderMain.js'), 'loader', {});\n }\n\n async start(errors: TestError[]) {\n const startError = await this._processHost.startRunner(serializeConfig(this._config, false));\n if (startError) {\n errors.push({\n message: `Test loader process failed to start with code \"${startError.code}\" and signal \"${startError.signal}\"`,\n });\n return false;\n }\n return true;\n }\n\n async loadTestFile(file: string, testErrors: TestError[]): Promise<Suite> {\n const result = await this._processHost.sendMessage({ method: 'loadTestFile', params: { file } }) as any;\n testErrors.push(...result.testErrors);\n return Suite._deepParse(result.fileSuite);\n }\n\n async stop() {\n const result = await this._processHost.sendMessage({ method: 'getCompilationCacheFromLoader' }) as any;\n addToCompilationCache(result);\n await this._processHost.stop();\n }\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBA,yBAA4B;AAC5B,2BAA4C;AAC5C,iBAAgC;AAChC,yBAA4B;AAC5B,kBAAsB;AACtB,wBAA6B;AAC7B,8BAAsC;AAM/B,MAAM,oBAAoB;AAAA,EAI/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
- "sourcesContent": ["/**\n * Copyright Microsoft Corporation. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport child_process from 'child_process';\nimport { EventEmitter } from 'events';\n\nimport { assert, timeOrigin } from 'playwright-core/lib/utils';\nimport { debug } from 'playwright-core/lib/utilsBundle';\n\nimport type { EnvProducedPayload, ProcessInitParams } from '../common/ipc';\nimport type { ProtocolResponse } from '../common/process';\n\nexport type ProcessExitData = {\n unexpectedly: boolean;\n code: number | null;\n signal: NodeJS.Signals | null;\n};\n\nexport class ProcessHost extends EventEmitter {\n private process: child_process.ChildProcess | undefined;\n private _didSendStop = false;\n private _processDidExit = false;\n private _didExitAndRanOnExit = false;\n private _runnerScript: string;\n private _lastMessageId = 0;\n private _callbacks = new Map<number, { resolve: (result: any) => void, reject: (error: Error) => void }>();\n private _processName: string;\n private _producedEnv: Record<string, string | undefined> = {};\n private _extraEnv: Record<string, string | undefined>;\n\n constructor(runnerScript: string, processName: string, env: Record<string, string | undefined>) {\n super();\n this._runnerScript = runnerScript;\n this._processName = processName;\n this._extraEnv = env;\n }\n\n async startRunner(runnerParams: any, options: { onStdOut?: (chunk: Buffer | string) => void, onStdErr?: (chunk: Buffer | string) => void } = {}): Promise<ProcessExitData | undefined> {\n assert(!this.process, 'Internal error: starting the same process twice');\n this.process = child_process.fork(require.resolve('../common/process'), {\n detached: false,\n env: {\n ...process.env,\n ...this._extraEnv,\n },\n stdio: [\n 'ignore',\n options.onStdOut ? 'pipe' : 'inherit',\n (options.onStdErr && !process.env.PW_RUNNER_DEBUG) ? 'pipe' : 'inherit',\n 'ipc',\n ],\n });\n this.process.on('exit', async (code, signal) => {\n this._processDidExit = true;\n await this.onExit();\n this._didExitAndRanOnExit = true;\n this.emit('exit', { unexpectedly: !this._didSendStop, code, signal } as ProcessExitData);\n });\n this.process.on('error', e => {}); // do not yell at a send to dead process.\n this.process.on('message', (message: any) => {\n if (debug.enabled('pw:test:protocol'))\n debug('pw:test:protocol')('\u25C0 RECV ' + JSON.stringify(message));\n if (message.method === '__env_produced__') {\n const producedEnv: EnvProducedPayload = message.params;\n this._producedEnv = Object.fromEntries(producedEnv.map(e => [e[0], e[1] ?? undefined]));\n } else if (message.method === '__dispatch__') {\n const { id, error, method, params, result } = message.params as ProtocolResponse;\n if (id && this._callbacks.has(id)) {\n const { resolve, reject } = this._callbacks.get(id)!;\n this._callbacks.delete(id);\n if (error) {\n const errorObject = new Error(error.message);\n errorObject.stack = error.stack;\n reject(errorObject);\n } else {\n resolve(result);\n }\n } else {\n this.emit(method!, params);\n }\n } else {\n this.emit(message.method!, message.params);\n }\n });\n\n if (options.onStdOut)\n this.process.stdout?.on('data', options.onStdOut);\n if (options.onStdErr)\n this.process.stderr?.on('data', options.onStdErr);\n\n const error = await new Promise<ProcessExitData | undefined>(resolve => {\n this.process!.once('exit', (code, signal) => resolve({ unexpectedly: true, code, signal }));\n this.once('ready', () => resolve(undefined));\n });\n\n if (error)\n return error;\n\n const processParams: ProcessInitParams = {\n processName: this._processName,\n timeOrigin: timeOrigin(),\n };\n\n this.send({\n method: '__init__', params: {\n processParams,\n runnerScript: this._runnerScript,\n runnerParams\n }\n });\n }\n\n sendMessage(message: { method: string, params?: any }) {\n const id = ++this._lastMessageId;\n this.send({\n method: '__dispatch__',\n params: { id, ...message }\n });\n return new Promise((resolve, reject) => {\n this._callbacks.set(id, { resolve, reject });\n });\n }\n\n protected sendMessageNoReply(message: { method: string, params?: any }) {\n this.sendMessage(message).catch(() => {});\n }\n\n protected async onExit() {\n }\n\n async stop() {\n if (!this._processDidExit && !this._didSendStop) {\n this.send({ method: '__stop__' });\n this._didSendStop = true;\n }\n if (!this._didExitAndRanOnExit)\n await new Promise(f => this.once('exit', f));\n }\n\n didSendStop() {\n return this._didSendStop;\n }\n\n producedEnv() {\n return this._producedEnv;\n }\n\n private send(message: { method: string, params?: any }) {\n if (debug.enabled('pw:test:protocol'))\n debug('pw:test:protocol')('SEND \u25BA ' + JSON.stringify(message));\n this.process?.send(message);\n }\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBA,2BAA0B;AAC1B,oBAA6B;AAE7B,mBAAmC;AACnC,yBAAsB;AAWf,MAAM,oBAAoB,2BAAa;AAAA,EAY5C,YAAY,cAAsB,aAAqB,KAAyC;AAC9F,UAAM;AAXR,SAAQ,eAAe;AACvB,SAAQ,kBAAkB;AAC1B,SAAQ,uBAAuB;AAE/B,SAAQ,iBAAiB;AACzB,SAAQ,aAAa,oBAAI,IAAgF;AAEzG,SAAQ,eAAmD,CAAC;AAK1D,SAAK,gBAAgB;AACrB,SAAK,eAAe;AACpB,SAAK,YAAY;AAAA,EACnB;AAAA,EAEA,MAAM,YAAY,cAAmB,UAAwG,CAAC,GAAyC;AACrL,6BAAO,CAAC,KAAK,SAAS,iDAAiD;AACvE,SAAK,UAAU,qBAAAA,QAAc,KAAK,gBAAgB,mBAAmB,GAAG;AAAA,MACtE,UAAU;AAAA,MACV,KAAK;AAAA,QACH,GAAG,QAAQ;AAAA,QACX,GAAG,KAAK;AAAA,MACV;AAAA,MACA,OAAO;AAAA,QACL;AAAA,QACA,QAAQ,WAAW,SAAS;AAAA,QAC3B,QAAQ,YAAY,CAAC,QAAQ,IAAI,kBAAmB,SAAS;AAAA,QAC9D;AAAA,MACF;AAAA,IACF,CAAC;AACD,SAAK,QAAQ,GAAG,QAAQ,OAAO,MAAM,WAAW;AAC9C,WAAK,kBAAkB;AACvB,YAAM,KAAK,OAAO;AAClB,WAAK,uBAAuB;AAC5B,WAAK,KAAK,QAAQ,EAAE,cA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