( args: BaseReportArgs, )
| 361 | } |
| 362 | |
| 363 | async function loadCachedBaseReportFromArtifacts( |
| 364 | args: BaseReportArgs, |
| 365 | ): Promise<string | null> { |
| 366 | const { |
| 367 | env: { api }, |
| 368 | project, |
| 369 | } = args; |
| 370 | |
| 371 | if (api.downloadReportArtifact == null) { |
| 372 | return null; |
| 373 | } |
| 374 | |
| 375 | const reportPath = await api |
| 376 | .downloadReportArtifact(project?.name) |
| 377 | .catch((error: unknown) => { |
| 378 | logWarning( |
| 379 | `Error when downloading previous report artifact, skipping - ${stringifyError(error)}`, |
| 380 | ); |
| 381 | return null; |
| 382 | }); |
| 383 | |
| 384 | logInfo(`Previous report artifact ${reportPath ? 'found' : 'not found'}`); |
| 385 | if (reportPath) { |
| 386 | logDebug(`Previous report artifact downloaded to ${reportPath}`); |
| 387 | } |
| 388 | |
| 389 | return reportPath; |
| 390 | } |
| 391 | |
| 392 | async function loadCachedBaseReportFromPortal( |
| 393 | args: BaseReportArgs, |
no test coverage detected